overtype 1.1.5 → 1.1.6
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/README.md +4 -1
- package/dist/overtype.esm.js +12 -7
- package/dist/overtype.esm.js.map +2 -2
- package/dist/overtype.js +12 -7
- package/dist/overtype.js.map +2 -2
- package/dist/overtype.min.js +2 -2
- package/package.json +1 -1
- package/src/parser.js +26 -11
package/README.md
CHANGED
|
@@ -483,7 +483,10 @@ OverType uses a unique invisible textarea overlay approach:
|
|
|
483
483
|
## Contributors
|
|
484
484
|
|
|
485
485
|
Special thanks to:
|
|
486
|
-
- [Josh Doman](https://github.com/joshdoman) - Fixed inline code formatting preservation ([#6](https://github.com/panphora/overtype/pull/6))
|
|
486
|
+
- [Josh Doman](https://github.com/joshdoman) - Fixed inline code formatting preservation ([#6](https://github.com/panphora/overtype/pull/6)), improved code fence detection ([#19](https://github.com/panphora/overtype/pull/19))
|
|
487
|
+
- [kbhomes](https://github.com/kbhomes) - Fixed text selection desynchronization during overscroll ([#17](https://github.com/panphora/overtype/pull/17))
|
|
488
|
+
- [merlinz01](https://github.com/merlinz01) - Initial TypeScript definitions implementation ([#20](https://github.com/panphora/overtype/pull/20))
|
|
489
|
+
- [Max Bernstein](https://github.com/tekknolagi) - Fixed typo in website ([#11](https://github.com/panphora/overtype/pull/11))
|
|
487
490
|
|
|
488
491
|
## License
|
|
489
492
|
|
package/dist/overtype.esm.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* OverType v1.1.
|
|
2
|
+
* OverType v1.1.6
|
|
3
3
|
* A lightweight markdown editor library with perfect WYSIWYG alignment
|
|
4
4
|
* @license MIT
|
|
5
5
|
* @author Demo User
|
|
@@ -148,7 +148,7 @@ var MarkdownParser = class {
|
|
|
148
148
|
static parseLinks(html) {
|
|
149
149
|
return html.replace(/\[(.+?)\]\((.+?)\)/g, (match, text, url) => {
|
|
150
150
|
const anchorName = `--link-${this.linkIndex++}`;
|
|
151
|
-
return `<a href="${url}" style="anchor-name: ${anchorName}"><span class="syntax-marker">[</span>${text}<span class="syntax-marker">](</span><span class="syntax-marker">${url}</span><span class="syntax-marker">)</span></a>`;
|
|
151
|
+
return `<a href="${url}" style="anchor-name: ${anchorName}"><span class="syntax-marker">[</span>${text}<span class="syntax-marker">](</span><span class="syntax-marker link-url">${url}</span><span class="syntax-marker">)</span></a>`;
|
|
152
152
|
});
|
|
153
153
|
}
|
|
154
154
|
/**
|
|
@@ -159,17 +159,22 @@ var MarkdownParser = class {
|
|
|
159
159
|
static parseInlineElements(text) {
|
|
160
160
|
let html = text;
|
|
161
161
|
html = this.parseInlineCode(html);
|
|
162
|
-
const
|
|
162
|
+
const sanctuaries = /* @__PURE__ */ new Map();
|
|
163
163
|
html = html.replace(/(<code>.*?<\/code>)/g, (match) => {
|
|
164
|
-
const placeholder = `\uE000${
|
|
165
|
-
|
|
164
|
+
const placeholder = `\uE000${sanctuaries.size}\uE001`;
|
|
165
|
+
sanctuaries.set(placeholder, match);
|
|
166
166
|
return placeholder;
|
|
167
167
|
});
|
|
168
168
|
html = this.parseLinks(html);
|
|
169
|
+
html = html.replace(/(<a[^>]*>.*?<\/a>)/g, (match) => {
|
|
170
|
+
const placeholder = `\uE000${sanctuaries.size}\uE001`;
|
|
171
|
+
sanctuaries.set(placeholder, match);
|
|
172
|
+
return placeholder;
|
|
173
|
+
});
|
|
169
174
|
html = this.parseBold(html);
|
|
170
175
|
html = this.parseItalic(html);
|
|
171
|
-
|
|
172
|
-
html = html.replace(placeholder,
|
|
176
|
+
sanctuaries.forEach((content, placeholder) => {
|
|
177
|
+
html = html.replace(placeholder, content);
|
|
173
178
|
});
|
|
174
179
|
return html;
|
|
175
180
|
}
|