@lvce-editor/markdown-worker 1.3.0 → 1.5.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.
@@ -797,6 +797,9 @@ const createRpc = ipc => {
797
797
  },
798
798
  invokeAndTransfer(method, ...params) {
799
799
  return invokeAndTransfer(ipc, method, ...params);
800
+ },
801
+ async dispose() {
802
+ await ipc?.dispose();
800
803
  }
801
804
  };
802
805
  return rpc;
@@ -1363,7 +1366,7 @@ const getMarkdownVirtualDom = html => {
1363
1366
  };
1364
1367
 
1365
1368
  /**
1366
- * marked v15.0.7 - a markdown parser
1369
+ * marked v15.0.9 - a markdown parser
1367
1370
  * Copyright (c) 2011-2025, Christopher Jeffrey. (MIT Licensed)
1368
1371
  * https://github.com/markedjs/marked
1369
1372
  */
@@ -1803,6 +1806,9 @@ function findClosingBracket(str, b) {
1803
1806
  }
1804
1807
  }
1805
1808
  }
1809
+ if (level > 0) {
1810
+ return -2;
1811
+ }
1806
1812
  return -1;
1807
1813
  }
1808
1814
  function outputLink(cap, link, raw, lexer, rules) {
@@ -2348,6 +2354,10 @@ class _Tokenizer {
2348
2354
  } else {
2349
2355
  // find closing parenthesis
2350
2356
  const lastParenIndex = findClosingBracket(cap[2], '()');
2357
+ if (lastParenIndex === -2) {
2358
+ // more open parens than closed
2359
+ return;
2360
+ }
2351
2361
  if (lastParenIndex > -1) {
2352
2362
  const start = cap[0].indexOf('!') === 0 ? 5 : 4;
2353
2363
  const linkLen = start + cap[1].length + lastParenIndex;
@@ -2839,14 +2849,14 @@ class _Lexer {
2839
2849
  }
2840
2850
  }
2841
2851
  }
2842
- // Mask out other blocks
2843
- while ((match = this.tokenizer.rules.inline.blockSkip.exec(maskedSrc)) != null) {
2844
- maskedSrc = maskedSrc.slice(0, match.index) + '[' + 'a'.repeat(match[0].length - 2) + ']' + maskedSrc.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
2845
- }
2846
2852
  // Mask out escaped characters
2847
2853
  while ((match = this.tokenizer.rules.inline.anyPunctuation.exec(maskedSrc)) != null) {
2848
2854
  maskedSrc = maskedSrc.slice(0, match.index) + '++' + maskedSrc.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
2849
2855
  }
2856
+ // Mask out other blocks
2857
+ while ((match = this.tokenizer.rules.inline.blockSkip.exec(maskedSrc)) != null) {
2858
+ maskedSrc = maskedSrc.slice(0, match.index) + '[' + 'a'.repeat(match[0].length - 2) + ']' + maskedSrc.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
2859
+ }
2850
2860
  let keepPrevChar = false;
2851
2861
  let prevChar = '';
2852
2862
  while (src) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/markdown-worker",
3
- "version": "1.3.0",
3
+ "version": "1.5.0",
4
4
  "description": "Markdown Worker",
5
5
  "license": "MIT",
6
6
  "author": "Lvce Editor",