@lvce-editor/markdown-worker 1.2.0 → 1.4.0
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/dist/markdownWorkerMain.js +13 -2
- package/package.json +1 -1
|
@@ -1363,7 +1363,7 @@ const getMarkdownVirtualDom = html => {
|
|
|
1363
1363
|
};
|
|
1364
1364
|
|
|
1365
1365
|
/**
|
|
1366
|
-
* marked v15.0.
|
|
1366
|
+
* marked v15.0.7 - a markdown parser
|
|
1367
1367
|
* Copyright (c) 2011-2025, Christopher Jeffrey. (MIT Licensed)
|
|
1368
1368
|
* https://github.com/markedjs/marked
|
|
1369
1369
|
*/
|
|
@@ -1479,12 +1479,22 @@ const fences = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\
|
|
|
1479
1479
|
const hr = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/;
|
|
1480
1480
|
const heading = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/;
|
|
1481
1481
|
const bullet = /(?:[*+-]|\d{1,9}[.)])/;
|
|
1482
|
-
const
|
|
1482
|
+
const lheadingCore = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/;
|
|
1483
|
+
const lheading = edit(lheadingCore).replace(/bull/g, bullet) // lists can interrupt
|
|
1483
1484
|
.replace(/blockCode/g, /(?: {4}| {0,3}\t)/) // indented code blocks can interrupt
|
|
1484
1485
|
.replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/) // fenced code blocks can interrupt
|
|
1485
1486
|
.replace(/blockquote/g, / {0,3}>/) // blockquote can interrupt
|
|
1486
1487
|
.replace(/heading/g, / {0,3}#{1,6}/) // ATX heading can interrupt
|
|
1487
1488
|
.replace(/html/g, / {0,3}<[^\n>]+>\n/) // block html can interrupt
|
|
1489
|
+
.replace(/\|table/g, '') // table not in commonmark
|
|
1490
|
+
.getRegex();
|
|
1491
|
+
const lheadingGfm = edit(lheadingCore).replace(/bull/g, bullet) // lists can interrupt
|
|
1492
|
+
.replace(/blockCode/g, /(?: {4}| {0,3}\t)/) // indented code blocks can interrupt
|
|
1493
|
+
.replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/) // fenced code blocks can interrupt
|
|
1494
|
+
.replace(/blockquote/g, / {0,3}>/) // blockquote can interrupt
|
|
1495
|
+
.replace(/heading/g, / {0,3}#{1,6}/) // ATX heading can interrupt
|
|
1496
|
+
.replace(/html/g, / {0,3}<[^\n>]+>\n/) // block html can interrupt
|
|
1497
|
+
.replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/) // table can interrupt
|
|
1488
1498
|
.getRegex();
|
|
1489
1499
|
const _paragraph = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/;
|
|
1490
1500
|
const blockText = /^[^\n]+/;
|
|
@@ -1537,6 +1547,7 @@ const gfmTable = edit('^ *([^\\n ].*)\\n' // Header
|
|
|
1537
1547
|
.getRegex();
|
|
1538
1548
|
const blockGfm = {
|
|
1539
1549
|
...blockNormal,
|
|
1550
|
+
lheading: lheadingGfm,
|
|
1540
1551
|
table: gfmTable,
|
|
1541
1552
|
paragraph: edit(_paragraph).replace('hr', hr).replace('heading', ' {0,3}#{1,6}(?:\\s|$)').replace('|lheading', '') // setext headings don't interrupt commonmark paragraphs
|
|
1542
1553
|
.replace('table', gfmTable) // interrupt paragraphs with table
|