@lvce-editor/markdown-worker 1.1.0 → 1.3.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.
@@ -1363,7 +1363,7 @@ const getMarkdownVirtualDom = html => {
1363
1363
  };
1364
1364
 
1365
1365
  /**
1366
- * marked v15.0.6 - a markdown parser
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 lheading = edit(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g, bullet) // lists can interrupt
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
@@ -3856,9 +3867,12 @@ const terminate = () => {
3856
3867
  };
3857
3868
 
3858
3869
  const commandMap = {
3859
- 'Markdown.getMarkDownVirtualDom': getMarkdownVirtualDom,
3870
+ 'Markdown.getVirtualDom': getMarkdownVirtualDom,
3871
+ 'Markdown.render': renderMarkdown,
3872
+ 'Markdown.terminate': terminate,
3873
+ // deprecated
3860
3874
  'Markdown.renderMarkdown': renderMarkdown,
3861
- 'Markdown.terminate': terminate
3875
+ 'Markdown.getMarkDownVirtualDom': getMarkdownVirtualDom
3862
3876
  };
3863
3877
 
3864
3878
  const RendererWorker = 1;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/markdown-worker",
3
- "version": "1.1.0",
3
+ "version": "1.3.0",
4
4
  "description": "Markdown Worker",
5
5
  "license": "MIT",
6
6
  "author": "Lvce Editor",