marked 14.1.2 → 14.1.4
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 +0 -1
- package/bin/main.js +8 -4
- package/lib/marked.cjs +4 -4
- package/lib/marked.cjs.map +1 -1
- package/lib/marked.esm.js +4 -4
- package/lib/marked.esm.js.map +1 -1
- package/lib/marked.umd.js +4 -4
- package/lib/marked.umd.js.map +1 -1
- package/man/marked.1 +1 -1
- package/marked.min.js +2 -2
- package/package.json +12 -12
package/lib/marked.esm.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* marked v14.1.
|
|
2
|
+
* marked v14.1.4 - a markdown parser
|
|
3
3
|
* Copyright (c) 2011-2024, Christopher Jeffrey. (MIT Licensed)
|
|
4
4
|
* https://github.com/markedjs/marked
|
|
5
5
|
*/
|
|
@@ -441,7 +441,7 @@ class _Tokenizer {
|
|
|
441
441
|
const hrRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`);
|
|
442
442
|
const fencesBeginRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}(?:\`\`\`|~~~)`);
|
|
443
443
|
const headingBeginRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}#`);
|
|
444
|
-
const htmlBeginRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}<[a-z]
|
|
444
|
+
const htmlBeginRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}<(?:[a-z].*>|!--)`, 'i');
|
|
445
445
|
// Check if following lines should be included in List Item
|
|
446
446
|
while (src) {
|
|
447
447
|
const rawLine = src.split('\n', 1)[0];
|
|
@@ -1122,7 +1122,7 @@ const _punctuation = '\\p{P}\\p{S}';
|
|
|
1122
1122
|
const punctuation = edit(/^((?![*_])[\spunctuation])/, 'u')
|
|
1123
1123
|
.replace(/punctuation/g, _punctuation).getRegex();
|
|
1124
1124
|
// sequences em should skip over [title](link), `code`, <html>
|
|
1125
|
-
const blockSkip = /\[[^[\]]*?\]\([
|
|
1125
|
+
const blockSkip = /\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g;
|
|
1126
1126
|
const emStrongLDelim = edit(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/, 'u')
|
|
1127
1127
|
.replace(/punct/g, _punctuation)
|
|
1128
1128
|
.getRegex();
|
|
@@ -1226,7 +1226,7 @@ const inlineGfm = {
|
|
|
1226
1226
|
.replace('email', /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/)
|
|
1227
1227
|
.getRegex(),
|
|
1228
1228
|
_backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
|
|
1229
|
-
del: /^(~~?)(?=[^\s~])([
|
|
1229
|
+
del: /^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,
|
|
1230
1230
|
text: /^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/,
|
|
1231
1231
|
};
|
|
1232
1232
|
/**
|