marked 9.1.3 → 9.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/lib/marked.cjs +5 -3
- package/lib/marked.cjs.map +1 -1
- package/lib/marked.d.cts +509 -0
- package/lib/marked.d.ts +496 -603
- package/lib/marked.esm.js +5 -3
- package/lib/marked.esm.js.map +1 -1
- package/lib/marked.umd.js +5 -3
- package/lib/marked.umd.js.map +1 -1
- package/man/marked.1 +1 -1
- package/marked.min.js +2 -2
- package/package.json +16 -9
package/lib/marked.esm.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* marked v9.1.
|
|
2
|
+
* marked v9.1.5 - a markdown parser
|
|
3
3
|
* Copyright (c) 2011-2023, Christopher Jeffrey. (MIT Licensed)
|
|
4
4
|
* https://github.com/markedjs/marked
|
|
5
5
|
*/
|
|
@@ -749,7 +749,7 @@ class _Tokenizer {
|
|
|
749
749
|
const endReg = match[0][0] === '*' ? this.rules.inline.emStrong.rDelimAst : this.rules.inline.emStrong.rDelimUnd;
|
|
750
750
|
endReg.lastIndex = 0;
|
|
751
751
|
// Clip maskedSrc to same section of string as src (move to lexer?)
|
|
752
|
-
maskedSrc = maskedSrc.slice(-1 * src.length +
|
|
752
|
+
maskedSrc = maskedSrc.slice(-1 * src.length + lLength);
|
|
753
753
|
while ((match = endReg.exec(maskedSrc)) != null) {
|
|
754
754
|
rDelim = match[1] || match[2] || match[3] || match[4] || match[5] || match[6];
|
|
755
755
|
if (!rDelim)
|
|
@@ -770,7 +770,9 @@ class _Tokenizer {
|
|
|
770
770
|
continue; // Haven't found enough closing delimiters
|
|
771
771
|
// Remove extra characters. *a*** -> *a*
|
|
772
772
|
rLength = Math.min(rLength, rLength + delimTotal + midDelimTotal);
|
|
773
|
-
|
|
773
|
+
// char length can be >1 for unicode characters;
|
|
774
|
+
const lastCharLength = [...match[0]][0].length;
|
|
775
|
+
const raw = src.slice(0, lLength + match.index + lastCharLength + rLength);
|
|
774
776
|
// Create `em` if smallest delimiter has odd char count. *a***
|
|
775
777
|
if (Math.min(lLength, rLength) % 2) {
|
|
776
778
|
const text = raw.slice(1, -1);
|