marked 14.1.1 → 14.1.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/bin/main.js +8 -4
- package/lib/marked.cjs +7 -2
- package/lib/marked.cjs.map +1 -1
- package/lib/marked.esm.js +7 -2
- package/lib/marked.esm.js.map +1 -1
- package/lib/marked.umd.js +7 -2
- package/lib/marked.umd.js.map +1 -1
- package/man/marked.1 +1 -1
- package/marked.min.js +2 -2
- package/package.json +11 -11
package/bin/main.js
CHANGED
|
@@ -35,10 +35,14 @@ export async function main(nodeProcess) {
|
|
|
35
35
|
const helpText = await readFile(resolve(__dirname, '../man/marked.1.md'), 'utf8');
|
|
36
36
|
|
|
37
37
|
await new Promise(res => {
|
|
38
|
-
spawn('man', [resolve(__dirname, '../man/marked.1')], options)
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
38
|
+
const manProcess = spawn('man', [resolve(__dirname, '../man/marked.1')], options);
|
|
39
|
+
nodeProcess.on('SIGINT', () => {
|
|
40
|
+
manProcess.kill('SIGINT');
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
manProcess.on('error', () => {
|
|
44
|
+
console.log(helpText);
|
|
45
|
+
})
|
|
42
46
|
.on('close', res);
|
|
43
47
|
});
|
|
44
48
|
}
|
package/lib/marked.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* marked v14.1.
|
|
2
|
+
* marked v14.1.3 - a markdown parser
|
|
3
3
|
* Copyright (c) 2011-2024, Christopher Jeffrey. (MIT Licensed)
|
|
4
4
|
* https://github.com/markedjs/marked
|
|
5
5
|
*/
|
|
@@ -443,6 +443,7 @@ class _Tokenizer {
|
|
|
443
443
|
const hrRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`);
|
|
444
444
|
const fencesBeginRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}(?:\`\`\`|~~~)`);
|
|
445
445
|
const headingBeginRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}#`);
|
|
446
|
+
const htmlBeginRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}<[a-z].*>`, 'i');
|
|
446
447
|
// Check if following lines should be included in List Item
|
|
447
448
|
while (src) {
|
|
448
449
|
const rawLine = src.split('\n', 1)[0];
|
|
@@ -464,6 +465,10 @@ class _Tokenizer {
|
|
|
464
465
|
if (headingBeginRegex.test(nextLine)) {
|
|
465
466
|
break;
|
|
466
467
|
}
|
|
468
|
+
// End list item if found start of html block
|
|
469
|
+
if (htmlBeginRegex.test(nextLine)) {
|
|
470
|
+
break;
|
|
471
|
+
}
|
|
467
472
|
// End list item if found start of new bullet
|
|
468
473
|
if (nextBulletRegex.test(nextLine)) {
|
|
469
474
|
break;
|
|
@@ -1119,7 +1124,7 @@ const _punctuation = '\\p{P}\\p{S}';
|
|
|
1119
1124
|
const punctuation = edit(/^((?![*_])[\spunctuation])/, 'u')
|
|
1120
1125
|
.replace(/punctuation/g, _punctuation).getRegex();
|
|
1121
1126
|
// sequences em should skip over [title](link), `code`, <html>
|
|
1122
|
-
const blockSkip = /\[[^[\]]*?\]\([
|
|
1127
|
+
const blockSkip = /\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g;
|
|
1123
1128
|
const emStrongLDelim = edit(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/, 'u')
|
|
1124
1129
|
.replace(/punct/g, _punctuation)
|
|
1125
1130
|
.getRegex();
|