marked 15.0.2 → 15.0.3
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 +23 -17
- package/lib/marked.cjs.map +1 -1
- package/lib/marked.esm.js +23 -17
- package/lib/marked.esm.js.map +1 -1
- package/lib/marked.umd.js +23 -17
- package/lib/marked.umd.js.map +1 -1
- package/man/marked.1 +1 -1
- package/marked.min.js +2 -2
- package/package.json +3 -3
package/lib/marked.umd.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* marked v15.0.
|
|
2
|
+
* marked v15.0.3 - a markdown parser
|
|
3
3
|
* Copyright (c) 2011-2024, Christopher Jeffrey. (MIT Licensed)
|
|
4
4
|
* https://github.com/markedjs/marked
|
|
5
5
|
*/
|
|
@@ -259,35 +259,41 @@
|
|
|
259
259
|
const br = /^( {2,}|\\)\n(?!\s*$)/;
|
|
260
260
|
const inlineText = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/;
|
|
261
261
|
// list of unicode punctuation marks, plus any missing characters from CommonMark spec
|
|
262
|
-
const _punctuation =
|
|
263
|
-
const
|
|
264
|
-
|
|
262
|
+
const _punctuation = /[\p{P}\p{S}]/u;
|
|
263
|
+
const _punctuationOrSpace = /[\s\p{P}\p{S}]/u;
|
|
264
|
+
const _notPunctuationOrSpace = /[^\s\p{P}\p{S}]/u;
|
|
265
|
+
const punctuation = edit(/^((?![*_])punctSpace)/, 'u')
|
|
266
|
+
.replace(/punctSpace/g, _punctuationOrSpace).getRegex();
|
|
265
267
|
// sequences em should skip over [title](link), `code`, <html>
|
|
266
268
|
const blockSkip = /\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g;
|
|
267
|
-
const emStrongLDelim = edit(/^(?:\*+(?:((?!\*)
|
|
269
|
+
const emStrongLDelim = edit(/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/, 'u')
|
|
268
270
|
.replace(/punct/g, _punctuation)
|
|
269
271
|
.getRegex();
|
|
270
272
|
const emStrongRDelimAst = edit('^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)' // Skip orphan inside strong
|
|
271
273
|
+ '|[^*]+(?=[^*])' // Consume to delim
|
|
272
|
-
+ '|(?!\\*)
|
|
273
|
-
+ '|
|
|
274
|
-
+ '|(?!\\*)
|
|
275
|
-
+ '|[\\s](\\*+)(?!\\*)(?=
|
|
276
|
-
+ '|(?!\\*)
|
|
277
|
-
+ '|
|
|
274
|
+
+ '|(?!\\*)punct(\\*+)(?=[\\s]|$)' // (1) #*** can only be a Right Delimiter
|
|
275
|
+
+ '|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)' // (2) a***#, a*** can only be a Right Delimiter
|
|
276
|
+
+ '|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)' // (3) #***a, ***a can only be Left Delimiter
|
|
277
|
+
+ '|[\\s](\\*+)(?!\\*)(?=punct)' // (4) ***# can only be Left Delimiter
|
|
278
|
+
+ '|(?!\\*)punct(\\*+)(?!\\*)(?=punct)' // (5) #***# can be either Left or Right Delimiter
|
|
279
|
+
+ '|notPunctSpace(\\*+)(?=notPunctSpace)', 'gu') // (6) a***a can be either Left or Right Delimiter
|
|
280
|
+
.replace(/notPunctSpace/g, _notPunctuationOrSpace)
|
|
281
|
+
.replace(/punctSpace/g, _punctuationOrSpace)
|
|
278
282
|
.replace(/punct/g, _punctuation)
|
|
279
283
|
.getRegex();
|
|
280
284
|
// (6) Not allowed for _
|
|
281
285
|
const emStrongRDelimUnd = edit('^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)' // Skip orphan inside strong
|
|
282
286
|
+ '|[^_]+(?=[^_])' // Consume to delim
|
|
283
|
-
+ '|(?!_)
|
|
284
|
-
+ '|
|
|
285
|
-
+ '|(?!_)
|
|
286
|
-
+ '|[\\s](_+)(?!_)(?=
|
|
287
|
-
+ '|(?!_)
|
|
287
|
+
+ '|(?!_)punct(_+)(?=[\\s]|$)' // (1) #___ can only be a Right Delimiter
|
|
288
|
+
+ '|notPunctSpace(_+)(?!_)(?=punctSpace|$)' // (2) a___#, a___ can only be a Right Delimiter
|
|
289
|
+
+ '|(?!_)punctSpace(_+)(?=notPunctSpace)' // (3) #___a, ___a can only be Left Delimiter
|
|
290
|
+
+ '|[\\s](_+)(?!_)(?=punct)' // (4) ___# can only be Left Delimiter
|
|
291
|
+
+ '|(?!_)punct(_+)(?!_)(?=punct)', 'gu') // (5) #___# can be either Left or Right Delimiter
|
|
292
|
+
.replace(/notPunctSpace/g, _notPunctuationOrSpace)
|
|
293
|
+
.replace(/punctSpace/g, _punctuationOrSpace)
|
|
288
294
|
.replace(/punct/g, _punctuation)
|
|
289
295
|
.getRegex();
|
|
290
|
-
const anyPunctuation = edit(/\\(
|
|
296
|
+
const anyPunctuation = edit(/\\(punct)/, 'gu')
|
|
291
297
|
.replace(/punct/g, _punctuation)
|
|
292
298
|
.getRegex();
|
|
293
299
|
const autolink = edit(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/)
|