overtype 1.1.4 → 1.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/overtype.esm.js +4 -2
- package/dist/overtype.esm.js.map +2 -2
- package/dist/overtype.js +4 -2
- package/dist/overtype.js.map +2 -2
- package/dist/overtype.min.js +7 -6
- package/package.json +3 -2
- package/src/overtype.d.ts +147 -0
- package/src/parser.js +12 -4
- package/src/styles.js +1 -0
package/dist/overtype.esm.js
CHANGED
|
@@ -105,7 +105,8 @@ var MarkdownParser = class {
|
|
|
105
105
|
* @returns {string|null} Parsed code fence or null
|
|
106
106
|
*/
|
|
107
107
|
static parseCodeBlock(html) {
|
|
108
|
-
|
|
108
|
+
const codeFenceRegex = /^`{3}[^`]*$/;
|
|
109
|
+
if (codeFenceRegex.test(html)) {
|
|
109
110
|
return `<div><span class="code-fence">${html}</span></div>`;
|
|
110
111
|
}
|
|
111
112
|
return null;
|
|
@@ -137,7 +138,7 @@ var MarkdownParser = class {
|
|
|
137
138
|
* @returns {string} HTML with code styling
|
|
138
139
|
*/
|
|
139
140
|
static parseInlineCode(html) {
|
|
140
|
-
return html.replace(
|
|
141
|
+
return html.replace(new RegExp("(?<!`)(`+)(?!`)((?:(?!\\1).)+?)(\\1)(?!`)", "g"), '<code><span class="syntax-marker">$1</span>$2<span class="syntax-marker">$3</span></code>');
|
|
141
142
|
}
|
|
142
143
|
/**
|
|
143
144
|
* Parse links
|
|
@@ -1417,6 +1418,7 @@ function generateStyles(options = {}) {
|
|
|
1417
1418
|
/* Overflow */
|
|
1418
1419
|
overflow-y: auto !important;
|
|
1419
1420
|
overflow-x: auto !important;
|
|
1421
|
+
overscroll-behavior: none !important;
|
|
1420
1422
|
scrollbar-width: auto !important;
|
|
1421
1423
|
scrollbar-gutter: auto !important;
|
|
1422
1424
|
|