@pilotiq/tiptap 3.10.6 → 3.10.7

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.
Files changed (82) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/markdownExtension.js +259 -164
  3. package/dist/react/BlockNodeView.d.ts +1 -1
  4. package/dist/react/FloatingToolbar.d.ts +1 -1
  5. package/dist/react/MentionMenu.d.ts +1 -1
  6. package/dist/react/Palette.d.ts +1 -1
  7. package/dist/react/SlashMenu.d.ts +1 -1
  8. package/dist/react/TableFloatingToolbar.d.ts +1 -1
  9. package/dist/react/TiptapEditor.d.ts +1 -1
  10. package/dist/react/Toolbar.d.ts +2 -2
  11. package/package.json +4 -3
  12. package/dist/Block.d.ts.map +0 -1
  13. package/dist/Block.js.map +0 -1
  14. package/dist/MentionProvider.d.ts.map +0 -1
  15. package/dist/MentionProvider.js.map +0 -1
  16. package/dist/PlainTextEditor.d.ts.map +0 -1
  17. package/dist/PlainTextEditor.js.map +0 -1
  18. package/dist/RichTextField.d.ts.map +0 -1
  19. package/dist/RichTextField.js.map +0 -1
  20. package/dist/extensions/AiInlineDiffExtension.d.ts.map +0 -1
  21. package/dist/extensions/AiInlineDiffExtension.js.map +0 -1
  22. package/dist/extensions/AiSuggestionExtension.d.ts.map +0 -1
  23. package/dist/extensions/AiSuggestionExtension.js.map +0 -1
  24. package/dist/extensions/BlockNodeExtension.d.ts.map +0 -1
  25. package/dist/extensions/BlockNodeExtension.js.map +0 -1
  26. package/dist/extensions/DragHandleExtension.d.ts.map +0 -1
  27. package/dist/extensions/DragHandleExtension.js.map +0 -1
  28. package/dist/extensions/GridExtension.d.ts.map +0 -1
  29. package/dist/extensions/GridExtension.js.map +0 -1
  30. package/dist/extensions/MentionExtension.d.ts.map +0 -1
  31. package/dist/extensions/MentionExtension.js.map +0 -1
  32. package/dist/extensions/MergeTagExtension.d.ts.map +0 -1
  33. package/dist/extensions/MergeTagExtension.js.map +0 -1
  34. package/dist/extensions/SlashCommandExtension.d.ts.map +0 -1
  35. package/dist/extensions/SlashCommandExtension.js.map +0 -1
  36. package/dist/extensions/TextSizeMarks.d.ts.map +0 -1
  37. package/dist/extensions/TextSizeMarks.js.map +0 -1
  38. package/dist/index.d.ts.map +0 -1
  39. package/dist/index.js.map +0 -1
  40. package/dist/markdownExtension.d.ts.map +0 -1
  41. package/dist/markdownStorage.d.ts.map +0 -1
  42. package/dist/markdownStorage.js.map +0 -1
  43. package/dist/plugin.d.ts.map +0 -1
  44. package/dist/plugin.js.map +0 -1
  45. package/dist/react/AiSuggestionBanner.d.ts.map +0 -1
  46. package/dist/react/AiSuggestionBanner.js.map +0 -1
  47. package/dist/react/BlockNodeView.d.ts.map +0 -1
  48. package/dist/react/BlockNodeView.js.map +0 -1
  49. package/dist/react/BlockSidePanel.d.ts.map +0 -1
  50. package/dist/react/BlockSidePanel.js.map +0 -1
  51. package/dist/react/CollabTextRenderer.d.ts.map +0 -1
  52. package/dist/react/CollabTextRenderer.js.map +0 -1
  53. package/dist/react/FloatingToolbar.d.ts.map +0 -1
  54. package/dist/react/FloatingToolbar.js.map +0 -1
  55. package/dist/react/MarkdownEditor.d.ts.map +0 -1
  56. package/dist/react/MarkdownEditor.js.map +0 -1
  57. package/dist/react/MentionMenu.d.ts.map +0 -1
  58. package/dist/react/MentionMenu.js.map +0 -1
  59. package/dist/react/Palette.d.ts.map +0 -1
  60. package/dist/react/Palette.js.map +0 -1
  61. package/dist/react/SlashMenu.d.ts.map +0 -1
  62. package/dist/react/SlashMenu.js.map +0 -1
  63. package/dist/react/TableFloatingToolbar.d.ts.map +0 -1
  64. package/dist/react/TableFloatingToolbar.js.map +0 -1
  65. package/dist/react/TiptapEditor.d.ts.map +0 -1
  66. package/dist/react/TiptapEditor.js.map +0 -1
  67. package/dist/react/Toolbar.d.ts.map +0 -1
  68. package/dist/react/Toolbar.js.map +0 -1
  69. package/dist/react/toolbarButtons.d.ts.map +0 -1
  70. package/dist/react/toolbarButtons.js.map +0 -1
  71. package/dist/react/useAiInlineDiff.d.ts.map +0 -1
  72. package/dist/react/useAiInlineDiff.js.map +0 -1
  73. package/dist/react/useAiSuggestionBridge.d.ts.map +0 -1
  74. package/dist/react/useAiSuggestionBridge.js.map +0 -1
  75. package/dist/register.d.ts.map +0 -1
  76. package/dist/register.js.map +0 -1
  77. package/dist/render.d.ts.map +0 -1
  78. package/dist/render.js.map +0 -1
  79. package/dist/surgicalOps.d.ts.map +0 -1
  80. package/dist/surgicalOps.js.map +0 -1
  81. package/dist/test/setup.d.ts.map +0 -1
  82. package/dist/test/setup.js.map +0 -1
@@ -251,7 +251,7 @@ OrderedMap.from = function(value) {
251
251
  };
252
252
  var dist_default = OrderedMap;
253
253
 
254
- // ../../node_modules/.pnpm/prosemirror-model@1.25.4/node_modules/prosemirror-model/dist/index.js
254
+ // ../../node_modules/.pnpm/prosemirror-model@1.25.7/node_modules/prosemirror-model/dist/index.js
255
255
  function findDiffStart(a, b, pos) {
256
256
  for (let i = 0; ; i++) {
257
257
  if (i == a.childCount || i == b.childCount)
@@ -557,7 +557,7 @@ var Fragment = class _Fragment {
557
557
  return _Fragment.empty;
558
558
  if (!Array.isArray(value))
559
559
  throw new RangeError("Invalid input for Fragment.fromJSON");
560
- return new _Fragment(value.map(schema2.nodeFromJSON));
560
+ return _Fragment.fromArray(value.map(schema2.nodeFromJSON));
561
561
  }
562
562
  /**
563
563
  Build a fragment from an array of nodes. Ensures that adjacent
@@ -780,7 +780,7 @@ var Slice = class _Slice {
780
780
  @internal
781
781
  */
782
782
  insertAt(pos, fragment) {
783
- let content = insertInto(this.content, pos + this.openStart, fragment);
783
+ let content = insertInto(this.content, pos + this.openStart, fragment, this.openStart + 1, this.openEnd + 1);
784
784
  return content && new _Slice(content, this.openStart, this.openEnd);
785
785
  }
786
786
  /**
@@ -851,14 +851,14 @@ function removeRange(content, from, to) {
851
851
  throw new RangeError("Removing non-flat range");
852
852
  return content.replaceChild(index, child.copy(removeRange(child.content, from - offset - 1, to - offset - 1)));
853
853
  }
854
- function insertInto(content, dist, insert, parent) {
854
+ function insertInto(content, dist, insert, openStart, openEnd, parent) {
855
855
  let { index, offset } = content.findIndex(dist), child = content.maybeChild(index);
856
856
  if (offset == dist || child.isText) {
857
- if (parent && !parent.canReplace(index, index, insert))
857
+ if (parent && openStart <= 0 && openEnd <= 0 && !parent.canReplace(index, index, insert))
858
858
  return null;
859
859
  return content.cut(0, dist).append(insert).append(content.cut(dist));
860
860
  }
861
- let inner = insertInto(child.content, dist - offset - 1, insert, child);
861
+ let inner = insertInto(child.content, dist - offset - 1, insert, index == 0 ? openStart - 1 : 0, index == content.childCount - 1 ? openEnd - 1 : 0, child);
862
862
  return inner && content.replaceChild(index, child.copy(inner));
863
863
  }
864
864
  function replace($from, $to, slice) {
@@ -1336,10 +1336,11 @@ var Node2 = class _Node {
1336
1336
  this.content.forEach(f);
1337
1337
  }
1338
1338
  /**
1339
- Invoke a callback for all descendant nodes recursively between
1339
+ Invoke a callback for all descendant nodes recursively overlapping
1340
1340
  the given two positions that are relative to start of this
1341
- node's content. The callback is invoked with the node, its
1342
- position relative to the original node (method receiver),
1341
+ node's content. This includes all ancestors of the nodes
1342
+ containing the two positions. The callback is invoked with the
1343
+ node, its position relative to the original node (method receiver),
1343
1344
  its parent node, and its child index. When the callback returns
1344
1345
  false for a given node, that node's children will not be
1345
1346
  recursed over. The last parameter can be used to specify a
@@ -2566,10 +2567,11 @@ function gatherMarks(schema2, marks) {
2566
2567
  return found2;
2567
2568
  }
2568
2569
 
2569
- // ../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/common/utils.mjs
2570
+ // ../../node_modules/.pnpm/markdown-it@14.2.0/node_modules/markdown-it/lib/common/utils.mjs
2570
2571
  var utils_exports = {};
2571
2572
  __export(utils_exports, {
2572
2573
  arrayReplaceAt: () => arrayReplaceAt,
2574
+ asciiTrim: () => asciiTrim,
2573
2575
  assign: () => assign,
2574
2576
  escapeHtml: () => escapeHtml,
2575
2577
  escapeRE: () => escapeRE,
@@ -2577,6 +2579,7 @@ __export(utils_exports, {
2577
2579
  has: () => has,
2578
2580
  isMdAsciiPunct: () => isMdAsciiPunct,
2579
2581
  isPunctChar: () => isPunctChar,
2582
+ isPunctCharCode: () => isPunctCharCode,
2580
2583
  isSpace: () => isSpace,
2581
2584
  isString: () => isString,
2582
2585
  isValidEntityCode: () => isValidEntityCode,
@@ -3404,6 +3407,9 @@ var xmlDecoder = getDecoder(decode_data_xml_default);
3404
3407
  function decodeHTML(str, mode = DecodingMode.Legacy) {
3405
3408
  return htmlDecoder(str, mode);
3406
3409
  }
3410
+ function decodeHTMLStrict(str) {
3411
+ return htmlDecoder(str, DecodingMode.Strict);
3412
+ }
3407
3413
 
3408
3414
  // ../../node_modules/.pnpm/entities@4.5.0/node_modules/entities/lib/esm/generated/encode-html.js
3409
3415
  function restoreDiff(arr) {
@@ -3472,7 +3478,7 @@ var EncodingMode;
3472
3478
  EncodingMode2[EncodingMode2["Text"] = 4] = "Text";
3473
3479
  })(EncodingMode || (EncodingMode = {}));
3474
3480
 
3475
- // ../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/common/utils.mjs
3481
+ // ../../node_modules/.pnpm/markdown-it@14.2.0/node_modules/markdown-it/lib/common/utils.mjs
3476
3482
  function _class(obj) {
3477
3483
  return Object.prototype.toString.call(obj);
3478
3484
  }
@@ -3629,6 +3635,9 @@ function isWhiteSpace(code2) {
3629
3635
  function isPunctChar(ch) {
3630
3636
  return regex_default4.test(ch) || regex_default5.test(ch);
3631
3637
  }
3638
+ function isPunctCharCode(code2) {
3639
+ return isPunctChar(fromCodePoint2(code2));
3640
+ }
3632
3641
  function isMdAsciiPunct(ch) {
3633
3642
  switch (ch) {
3634
3643
  case 33:
@@ -3675,9 +3684,27 @@ function normalizeReference(str) {
3675
3684
  }
3676
3685
  return str.toLowerCase().toUpperCase();
3677
3686
  }
3687
+ function isAsciiTrimmable(c) {
3688
+ return c === 32 || c === 9 || c === 10 || c === 13;
3689
+ }
3690
+ function asciiTrim(str) {
3691
+ let start = 0;
3692
+ for (; start < str.length; start++) {
3693
+ if (!isAsciiTrimmable(str.charCodeAt(start))) {
3694
+ break;
3695
+ }
3696
+ }
3697
+ let end = str.length - 1;
3698
+ for (; end >= start; end--) {
3699
+ if (!isAsciiTrimmable(str.charCodeAt(end))) {
3700
+ break;
3701
+ }
3702
+ }
3703
+ return str.slice(start, end + 1);
3704
+ }
3678
3705
  var lib = { mdurl: mdurl_exports, ucmicro: uc_exports };
3679
3706
 
3680
- // ../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/helpers/index.mjs
3707
+ // ../../node_modules/.pnpm/markdown-it@14.2.0/node_modules/markdown-it/lib/helpers/index.mjs
3681
3708
  var helpers_exports = {};
3682
3709
  __export(helpers_exports, {
3683
3710
  parseLinkDestination: () => parseLinkDestination,
@@ -3685,7 +3712,7 @@ __export(helpers_exports, {
3685
3712
  parseLinkTitle: () => parseLinkTitle
3686
3713
  });
3687
3714
 
3688
- // ../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/helpers/parse_link_label.mjs
3715
+ // ../../node_modules/.pnpm/markdown-it@14.2.0/node_modules/markdown-it/lib/helpers/parse_link_label.mjs
3689
3716
  function parseLinkLabel(state, start, disableNested) {
3690
3717
  let level, found2, marker, prevPos;
3691
3718
  const max = state.posMax;
@@ -3720,7 +3747,7 @@ function parseLinkLabel(state, start, disableNested) {
3720
3747
  return labelEnd;
3721
3748
  }
3722
3749
 
3723
- // ../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/helpers/parse_link_destination.mjs
3750
+ // ../../node_modules/.pnpm/markdown-it@14.2.0/node_modules/markdown-it/lib/helpers/parse_link_destination.mjs
3724
3751
  function parseLinkDestination(str, start, max) {
3725
3752
  let code2;
3726
3753
  let pos = start;
@@ -3795,7 +3822,7 @@ function parseLinkDestination(str, start, max) {
3795
3822
  return result;
3796
3823
  }
3797
3824
 
3798
- // ../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/helpers/parse_link_title.mjs
3825
+ // ../../node_modules/.pnpm/markdown-it@14.2.0/node_modules/markdown-it/lib/helpers/parse_link_title.mjs
3799
3826
  function parseLinkTitle(str, start, max, prev_state) {
3800
3827
  let code2;
3801
3828
  let pos = start;
@@ -3848,7 +3875,7 @@ function parseLinkTitle(str, start, max, prev_state) {
3848
3875
  return state;
3849
3876
  }
3850
3877
 
3851
- // ../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/renderer.mjs
3878
+ // ../../node_modules/.pnpm/markdown-it@14.2.0/node_modules/markdown-it/lib/renderer.mjs
3852
3879
  var default_rules = {};
3853
3880
  default_rules.code_inline = function(tokens, idx, options, env, slf) {
3854
3881
  const token = tokens[idx];
@@ -4013,7 +4040,7 @@ Renderer.prototype.render = function(tokens, options, env) {
4013
4040
  };
4014
4041
  var renderer_default = Renderer;
4015
4042
 
4016
- // ../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/ruler.mjs
4043
+ // ../../node_modules/.pnpm/markdown-it@14.2.0/node_modules/markdown-it/lib/ruler.mjs
4017
4044
  function Ruler() {
4018
4045
  this.__rules__ = [];
4019
4046
  this.__cache__ = null;
@@ -4156,7 +4183,7 @@ Ruler.prototype.getRules = function(chainName) {
4156
4183
  };
4157
4184
  var ruler_default = Ruler;
4158
4185
 
4159
- // ../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/token.mjs
4186
+ // ../../node_modules/.pnpm/markdown-it@14.2.0/node_modules/markdown-it/lib/token.mjs
4160
4187
  function Token(type, tag, nesting) {
4161
4188
  this.type = type;
4162
4189
  this.tag = tag;
@@ -4218,7 +4245,7 @@ Token.prototype.attrJoin = function attrJoin(name, value) {
4218
4245
  };
4219
4246
  var token_default = Token;
4220
4247
 
4221
- // ../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_core/state_core.mjs
4248
+ // ../../node_modules/.pnpm/markdown-it@14.2.0/node_modules/markdown-it/lib/rules_core/state_core.mjs
4222
4249
  function StateCore(src, md2, env) {
4223
4250
  this.src = src;
4224
4251
  this.env = env;
@@ -4229,7 +4256,7 @@ function StateCore(src, md2, env) {
4229
4256
  StateCore.prototype.Token = token_default;
4230
4257
  var state_core_default = StateCore;
4231
4258
 
4232
- // ../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_core/normalize.mjs
4259
+ // ../../node_modules/.pnpm/markdown-it@14.2.0/node_modules/markdown-it/lib/rules_core/normalize.mjs
4233
4260
  var NEWLINES_RE = /\r\n?|\n/g;
4234
4261
  var NULL_RE = /\0/g;
4235
4262
  function normalize(state) {
@@ -4239,7 +4266,7 @@ function normalize(state) {
4239
4266
  state.src = str;
4240
4267
  }
4241
4268
 
4242
- // ../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_core/block.mjs
4269
+ // ../../node_modules/.pnpm/markdown-it@14.2.0/node_modules/markdown-it/lib/rules_core/block.mjs
4243
4270
  function block(state) {
4244
4271
  let token;
4245
4272
  if (state.inlineMode) {
@@ -4253,7 +4280,7 @@ function block(state) {
4253
4280
  }
4254
4281
  }
4255
4282
 
4256
- // ../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_core/inline.mjs
4283
+ // ../../node_modules/.pnpm/markdown-it@14.2.0/node_modules/markdown-it/lib/rules_core/inline.mjs
4257
4284
  function inline(state) {
4258
4285
  const tokens = state.tokens;
4259
4286
  for (let i = 0, l = tokens.length; i < l; i++) {
@@ -4264,7 +4291,7 @@ function inline(state) {
4264
4291
  }
4265
4292
  }
4266
4293
 
4267
- // ../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_core/linkify.mjs
4294
+ // ../../node_modules/.pnpm/markdown-it@14.2.0/node_modules/markdown-it/lib/rules_core/linkify.mjs
4268
4295
  function isLinkOpen(str) {
4269
4296
  return /^<a[>\s]/i.test(str);
4270
4297
  }
@@ -4361,7 +4388,7 @@ function linkify(state) {
4361
4388
  }
4362
4389
  }
4363
4390
 
4364
- // ../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_core/replacements.mjs
4391
+ // ../../node_modules/.pnpm/markdown-it@14.2.0/node_modules/markdown-it/lib/rules_core/replacements.mjs
4365
4392
  var RARE_RE = /\+-|\.\.|\?\?\?\?|!!!!|,,|--/;
4366
4393
  var SCOPED_ABBR_TEST_RE = /\((c|tm|r)\)/i;
4367
4394
  var SCOPED_ABBR_RE = /\((c|tm|r)\)/ig;
@@ -4423,16 +4450,31 @@ function replace2(state) {
4423
4450
  }
4424
4451
  }
4425
4452
 
4426
- // ../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_core/smartquotes.mjs
4453
+ // ../../node_modules/.pnpm/markdown-it@14.2.0/node_modules/markdown-it/lib/rules_core/smartquotes.mjs
4427
4454
  var QUOTE_TEST_RE = /['"]/;
4428
4455
  var QUOTE_RE = /['"]/g;
4429
4456
  var APOSTROPHE = "\u2019";
4430
- function replaceAt(str, index, ch) {
4431
- return str.slice(0, index) + ch + str.slice(index + 1);
4457
+ function addReplacement(replacements, tokenIdx, pos, ch) {
4458
+ if (!replacements[tokenIdx]) {
4459
+ replacements[tokenIdx] = [];
4460
+ }
4461
+ replacements[tokenIdx].push({ pos, ch });
4462
+ }
4463
+ function applyReplacements(str, replacements) {
4464
+ let result = "";
4465
+ let lastPos = 0;
4466
+ replacements.sort((a, b) => a.pos - b.pos);
4467
+ for (let i = 0; i < replacements.length; i++) {
4468
+ const replacement = replacements[i];
4469
+ result += str.slice(lastPos, replacement.pos) + replacement.ch;
4470
+ lastPos = replacement.pos + 1;
4471
+ }
4472
+ return result + str.slice(lastPos);
4432
4473
  }
4433
4474
  function process_inlines(tokens, state) {
4434
4475
  let j;
4435
4476
  const stack = [];
4477
+ const replacements = {};
4436
4478
  for (let i = 0; i < tokens.length; i++) {
4437
4479
  const token = tokens[i];
4438
4480
  const thisLevel = tokens[i].level;
@@ -4445,9 +4487,9 @@ function process_inlines(tokens, state) {
4445
4487
  if (token.type !== "text") {
4446
4488
  continue;
4447
4489
  }
4448
- let text2 = token.content;
4490
+ const text2 = token.content;
4449
4491
  let pos = 0;
4450
- let max = text2.length;
4492
+ const max = text2.length;
4451
4493
  OUTER:
4452
4494
  while (pos < max) {
4453
4495
  QUOTE_RE.lastIndex = pos;
@@ -4481,8 +4523,8 @@ function process_inlines(tokens, state) {
4481
4523
  break;
4482
4524
  }
4483
4525
  }
4484
- const isLastPunctChar = isMdAsciiPunct(lastChar) || isPunctChar(String.fromCharCode(lastChar));
4485
- const isNextPunctChar = isMdAsciiPunct(nextChar) || isPunctChar(String.fromCharCode(nextChar));
4526
+ const isLastPunctChar = isMdAsciiPunct(lastChar) || isPunctCharCode(lastChar);
4527
+ const isNextPunctChar = isMdAsciiPunct(nextChar) || isPunctCharCode(nextChar);
4486
4528
  const isLastWhiteSpace = isWhiteSpace(lastChar);
4487
4529
  const isNextWhiteSpace = isWhiteSpace(nextChar);
4488
4530
  if (isNextWhiteSpace) {
@@ -4510,7 +4552,7 @@ function process_inlines(tokens, state) {
4510
4552
  }
4511
4553
  if (!canOpen && !canClose) {
4512
4554
  if (isSingle) {
4513
- token.content = replaceAt(token.content, t.index, APOSTROPHE);
4555
+ addReplacement(replacements, i, t.index, APOSTROPHE);
4514
4556
  }
4515
4557
  continue;
4516
4558
  }
@@ -4531,18 +4573,8 @@ function process_inlines(tokens, state) {
4531
4573
  openQuote = state.md.options.quotes[0];
4532
4574
  closeQuote = state.md.options.quotes[1];
4533
4575
  }
4534
- token.content = replaceAt(token.content, t.index, closeQuote);
4535
- tokens[item.token].content = replaceAt(
4536
- tokens[item.token].content,
4537
- item.pos,
4538
- openQuote
4539
- );
4540
- pos += closeQuote.length - 1;
4541
- if (item.token === i) {
4542
- pos += openQuote.length - 1;
4543
- }
4544
- text2 = token.content;
4545
- max = text2.length;
4576
+ addReplacement(replacements, i, t.index, closeQuote);
4577
+ addReplacement(replacements, item.token, item.pos, openQuote);
4546
4578
  stack.length = j;
4547
4579
  continue OUTER;
4548
4580
  }
@@ -4556,10 +4588,13 @@ function process_inlines(tokens, state) {
4556
4588
  level: thisLevel
4557
4589
  });
4558
4590
  } else if (canClose && isSingle) {
4559
- token.content = replaceAt(token.content, t.index, APOSTROPHE);
4591
+ addReplacement(replacements, i, t.index, APOSTROPHE);
4560
4592
  }
4561
4593
  }
4562
4594
  }
4595
+ Object.keys(replacements).forEach(function(tokenIdx) {
4596
+ tokens[tokenIdx].content = applyReplacements(tokens[tokenIdx].content, replacements[tokenIdx]);
4597
+ });
4563
4598
  }
4564
4599
  function smartquotes(state) {
4565
4600
  if (!state.md.options.typographer) {
@@ -4573,7 +4608,7 @@ function smartquotes(state) {
4573
4608
  }
4574
4609
  }
4575
4610
 
4576
- // ../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_core/text_join.mjs
4611
+ // ../../node_modules/.pnpm/markdown-it@14.2.0/node_modules/markdown-it/lib/rules_core/text_join.mjs
4577
4612
  function text_join(state) {
4578
4613
  let curr, last;
4579
4614
  const blockTokens = state.tokens;
@@ -4603,7 +4638,7 @@ function text_join(state) {
4603
4638
  }
4604
4639
  }
4605
4640
 
4606
- // ../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/parser_core.mjs
4641
+ // ../../node_modules/.pnpm/markdown-it@14.2.0/node_modules/markdown-it/lib/parser_core.mjs
4607
4642
  var _rules = [
4608
4643
  ["normalize", normalize],
4609
4644
  ["block", block],
@@ -4630,7 +4665,7 @@ Core.prototype.process = function(state) {
4630
4665
  Core.prototype.State = state_core_default;
4631
4666
  var parser_core_default = Core;
4632
4667
 
4633
- // ../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_block/state_block.mjs
4668
+ // ../../node_modules/.pnpm/markdown-it@14.2.0/node_modules/markdown-it/lib/rules_block/state_block.mjs
4634
4669
  function StateBlock(src, md2, env, tokens) {
4635
4670
  this.src = src;
4636
4671
  this.md = md2;
@@ -4787,7 +4822,7 @@ StateBlock.prototype.getLines = function getLines(begin, end, indent, keepLastLF
4787
4822
  StateBlock.prototype.Token = token_default;
4788
4823
  var state_block_default = StateBlock;
4789
4824
 
4790
- // ../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_block/table.mjs
4825
+ // ../../node_modules/.pnpm/markdown-it@14.2.0/node_modules/markdown-it/lib/rules_block/table.mjs
4791
4826
  var MAX_AUTOCOMPLETED_CELLS = 65536;
4792
4827
  function getLine(state, line) {
4793
4828
  const pos = state.bMarks[line] + state.tShift[line];
@@ -4977,7 +5012,7 @@ function table(state, startLine, endLine, silent) {
4977
5012
  return true;
4978
5013
  }
4979
5014
 
4980
- // ../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_block/code.mjs
5015
+ // ../../node_modules/.pnpm/markdown-it@14.2.0/node_modules/markdown-it/lib/rules_block/code.mjs
4981
5016
  function code(state, startLine, endLine) {
4982
5017
  if (state.sCount[startLine] - state.blkIndent < 4) {
4983
5018
  return false;
@@ -5003,7 +5038,7 @@ function code(state, startLine, endLine) {
5003
5038
  return true;
5004
5039
  }
5005
5040
 
5006
- // ../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_block/fence.mjs
5041
+ // ../../node_modules/.pnpm/markdown-it@14.2.0/node_modules/markdown-it/lib/rules_block/fence.mjs
5007
5042
  function fence(state, startLine, endLine, silent) {
5008
5043
  let pos = state.bMarks[startLine] + state.tShift[startLine];
5009
5044
  let max = state.eMarks[startLine];
@@ -5072,7 +5107,7 @@ function fence(state, startLine, endLine, silent) {
5072
5107
  return true;
5073
5108
  }
5074
5109
 
5075
- // ../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_block/blockquote.mjs
5110
+ // ../../node_modules/.pnpm/markdown-it@14.2.0/node_modules/markdown-it/lib/rules_block/blockquote.mjs
5076
5111
  function blockquote(state, startLine, endLine, silent) {
5077
5112
  let pos = state.bMarks[startLine] + state.tShift[startLine];
5078
5113
  let max = state.eMarks[startLine];
@@ -5197,7 +5232,7 @@ function blockquote(state, startLine, endLine, silent) {
5197
5232
  return true;
5198
5233
  }
5199
5234
 
5200
- // ../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_block/hr.mjs
5235
+ // ../../node_modules/.pnpm/markdown-it@14.2.0/node_modules/markdown-it/lib/rules_block/hr.mjs
5201
5236
  function hr(state, startLine, endLine, silent) {
5202
5237
  const max = state.eMarks[startLine];
5203
5238
  if (state.sCount[startLine] - state.blkIndent >= 4) {
@@ -5231,7 +5266,7 @@ function hr(state, startLine, endLine, silent) {
5231
5266
  return true;
5232
5267
  }
5233
5268
 
5234
- // ../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_block/list.mjs
5269
+ // ../../node_modules/.pnpm/markdown-it@14.2.0/node_modules/markdown-it/lib/rules_block/list.mjs
5235
5270
  function skipBulletListMarker(state, startLine) {
5236
5271
  const max = state.eMarks[startLine];
5237
5272
  let pos = state.bMarks[startLine] + state.tShift[startLine];
@@ -5455,7 +5490,7 @@ function list(state, startLine, endLine, silent) {
5455
5490
  return true;
5456
5491
  }
5457
5492
 
5458
- // ../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_block/reference.mjs
5493
+ // ../../node_modules/.pnpm/markdown-it@14.2.0/node_modules/markdown-it/lib/rules_block/reference.mjs
5459
5494
  function reference(state, startLine, _endLine, silent) {
5460
5495
  let pos = state.bMarks[startLine] + state.tShift[startLine];
5461
5496
  let max = state.eMarks[startLine];
@@ -5630,7 +5665,7 @@ function reference(state, startLine, _endLine, silent) {
5630
5665
  return true;
5631
5666
  }
5632
5667
 
5633
- // ../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/common/html_blocks.mjs
5668
+ // ../../node_modules/.pnpm/markdown-it@14.2.0/node_modules/markdown-it/lib/common/html_blocks.mjs
5634
5669
  var html_blocks_default = [
5635
5670
  "address",
5636
5671
  "article",
@@ -5696,7 +5731,7 @@ var html_blocks_default = [
5696
5731
  "ul"
5697
5732
  ];
5698
5733
 
5699
- // ../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/common/html_re.mjs
5734
+ // ../../node_modules/.pnpm/markdown-it@14.2.0/node_modules/markdown-it/lib/common/html_re.mjs
5700
5735
  var attr_name = "[a-zA-Z_:][a-zA-Z0-9:._-]*";
5701
5736
  var unquoted = "[^\"'=<>`\\x00-\\x20]+";
5702
5737
  var single_quoted = "'[^']*'";
@@ -5712,7 +5747,7 @@ var cdata = "<!\\[CDATA\\[[\\s\\S]*?\\]\\]>";
5712
5747
  var HTML_TAG_RE = new RegExp("^(?:" + open_tag + "|" + close_tag + "|" + comment + "|" + processing + "|" + declaration + "|" + cdata + ")");
5713
5748
  var HTML_OPEN_CLOSE_TAG_RE = new RegExp("^(?:" + open_tag + "|" + close_tag + ")");
5714
5749
 
5715
- // ../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_block/html_block.mjs
5750
+ // ../../node_modules/.pnpm/markdown-it@14.2.0/node_modules/markdown-it/lib/rules_block/html_block.mjs
5716
5751
  var HTML_SEQUENCES = [
5717
5752
  [/^<(script|pre|style|textarea)(?=(\s|>|$))/i, /<\/(script|pre|style|textarea)>/i, true],
5718
5753
  [/^<!--/, /-->/, true],
@@ -5748,10 +5783,13 @@ function html_block(state, startLine, endLine, silent) {
5748
5783
  return HTML_SEQUENCES[i][2];
5749
5784
  }
5750
5785
  let nextLine = startLine + 1;
5786
+ const endsOnBlankLine = HTML_SEQUENCES[i][1].test("");
5751
5787
  if (!HTML_SEQUENCES[i][1].test(lineText)) {
5752
5788
  for (; nextLine < endLine; nextLine++) {
5753
5789
  if (state.sCount[nextLine] < state.blkIndent) {
5754
- break;
5790
+ if (endsOnBlankLine || !state.isEmpty(nextLine)) {
5791
+ break;
5792
+ }
5755
5793
  }
5756
5794
  pos = state.bMarks[nextLine] + state.tShift[nextLine];
5757
5795
  max = state.eMarks[nextLine];
@@ -5771,7 +5809,7 @@ function html_block(state, startLine, endLine, silent) {
5771
5809
  return true;
5772
5810
  }
5773
5811
 
5774
- // ../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_block/heading.mjs
5812
+ // ../../node_modules/.pnpm/markdown-it@14.2.0/node_modules/markdown-it/lib/rules_block/heading.mjs
5775
5813
  function heading(state, startLine, endLine, silent) {
5776
5814
  let pos = state.bMarks[startLine] + state.tShift[startLine];
5777
5815
  let max = state.eMarks[startLine];
@@ -5804,7 +5842,7 @@ function heading(state, startLine, endLine, silent) {
5804
5842
  token_o.markup = "########".slice(0, level);
5805
5843
  token_o.map = [startLine, state.line];
5806
5844
  const token_i = state.push("inline", "", 0);
5807
- token_i.content = state.src.slice(pos, max).trim();
5845
+ token_i.content = asciiTrim(state.src.slice(pos, max));
5808
5846
  token_i.map = [startLine, state.line];
5809
5847
  token_i.children = [];
5810
5848
  const token_c = state.push("heading_close", "h" + String(level), -1);
@@ -5812,7 +5850,7 @@ function heading(state, startLine, endLine, silent) {
5812
5850
  return true;
5813
5851
  }
5814
5852
 
5815
- // ../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_block/lheading.mjs
5853
+ // ../../node_modules/.pnpm/markdown-it@14.2.0/node_modules/markdown-it/lib/rules_block/lheading.mjs
5816
5854
  function lheading(state, startLine, endLine) {
5817
5855
  const terminatorRules = state.md.block.ruler.getRules("paragraph");
5818
5856
  if (state.sCount[startLine] - state.blkIndent >= 4) {
@@ -5857,9 +5895,10 @@ function lheading(state, startLine, endLine) {
5857
5895
  }
5858
5896
  }
5859
5897
  if (!level) {
5898
+ state.parentType = oldParentType;
5860
5899
  return false;
5861
5900
  }
5862
- const content = state.getLines(startLine, nextLine, state.blkIndent, false).trim();
5901
+ const content = asciiTrim(state.getLines(startLine, nextLine, state.blkIndent, false));
5863
5902
  state.line = nextLine + 1;
5864
5903
  const token_o = state.push("heading_open", "h" + String(level), 1);
5865
5904
  token_o.markup = String.fromCharCode(marker);
@@ -5874,7 +5913,7 @@ function lheading(state, startLine, endLine) {
5874
5913
  return true;
5875
5914
  }
5876
5915
 
5877
- // ../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_block/paragraph.mjs
5916
+ // ../../node_modules/.pnpm/markdown-it@14.2.0/node_modules/markdown-it/lib/rules_block/paragraph.mjs
5878
5917
  function paragraph(state, startLine, endLine) {
5879
5918
  const terminatorRules = state.md.block.ruler.getRules("paragraph");
5880
5919
  const oldParentType = state.parentType;
@@ -5898,7 +5937,7 @@ function paragraph(state, startLine, endLine) {
5898
5937
  break;
5899
5938
  }
5900
5939
  }
5901
- const content = state.getLines(startLine, nextLine, state.blkIndent, false).trim();
5940
+ const content = asciiTrim(state.getLines(startLine, nextLine, state.blkIndent, false));
5902
5941
  state.line = nextLine;
5903
5942
  const token_o = state.push("paragraph_open", "p", 1);
5904
5943
  token_o.map = [startLine, state.line];
@@ -5911,7 +5950,7 @@ function paragraph(state, startLine, endLine) {
5911
5950
  return true;
5912
5951
  }
5913
5952
 
5914
- // ../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/parser_block.mjs
5953
+ // ../../node_modules/.pnpm/markdown-it@14.2.0/node_modules/markdown-it/lib/parser_block.mjs
5915
5954
  var _rules2 = [
5916
5955
  // First 2 params - rule name & source. Secondary array - list of rules,
5917
5956
  // which can be terminated by this one.
@@ -5985,7 +6024,7 @@ ParserBlock.prototype.parse = function(src, md2, env, outTokens) {
5985
6024
  ParserBlock.prototype.State = state_block_default;
5986
6025
  var parser_block_default = ParserBlock;
5987
6026
 
5988
- // ../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_inline/state_inline.mjs
6027
+ // ../../node_modules/.pnpm/markdown-it@14.2.0/node_modules/markdown-it/lib/rules_inline/state_inline.mjs
5989
6028
  function StateInline(src, md2, env, outTokens) {
5990
6029
  this.src = src;
5991
6030
  this.env = env;
@@ -6037,15 +6076,37 @@ StateInline.prototype.push = function(type, tag, nesting) {
6037
6076
  StateInline.prototype.scanDelims = function(start, canSplitWord) {
6038
6077
  const max = this.posMax;
6039
6078
  const marker = this.src.charCodeAt(start);
6040
- const lastChar = start > 0 ? this.src.charCodeAt(start - 1) : 32;
6079
+ let lastChar;
6080
+ if (start === 0) {
6081
+ lastChar = 32;
6082
+ } else if (start === 1) {
6083
+ lastChar = this.src.charCodeAt(0);
6084
+ if ((lastChar & 63488) === 55296) {
6085
+ lastChar = 65533;
6086
+ }
6087
+ } else {
6088
+ lastChar = this.src.charCodeAt(start - 1);
6089
+ if ((lastChar & 64512) === 56320) {
6090
+ const highSurr = this.src.charCodeAt(start - 2);
6091
+ lastChar = (highSurr & 64512) === 55296 ? 65536 + (highSurr - 55296 << 10) + (lastChar - 56320) : 65533;
6092
+ } else if ((lastChar & 64512) === 55296) {
6093
+ lastChar = 65533;
6094
+ }
6095
+ }
6041
6096
  let pos = start;
6042
6097
  while (pos < max && this.src.charCodeAt(pos) === marker) {
6043
6098
  pos++;
6044
6099
  }
6045
6100
  const count = pos - start;
6046
- const nextChar = pos < max ? this.src.charCodeAt(pos) : 32;
6047
- const isLastPunctChar = isMdAsciiPunct(lastChar) || isPunctChar(String.fromCharCode(lastChar));
6048
- const isNextPunctChar = isMdAsciiPunct(nextChar) || isPunctChar(String.fromCharCode(nextChar));
6101
+ let nextChar = pos < max ? this.src.charCodeAt(pos) : 32;
6102
+ if ((nextChar & 64512) === 55296) {
6103
+ const lowSurr = this.src.charCodeAt(pos + 1);
6104
+ nextChar = (lowSurr & 64512) === 56320 ? 65536 + (nextChar - 55296 << 10) + (lowSurr - 56320) : 65533;
6105
+ } else if ((nextChar & 64512) === 56320) {
6106
+ nextChar = 65533;
6107
+ }
6108
+ const isLastPunctChar = isMdAsciiPunct(lastChar) || isPunctCharCode(lastChar);
6109
+ const isNextPunctChar = isMdAsciiPunct(nextChar) || isPunctCharCode(nextChar);
6049
6110
  const isLastWhiteSpace = isWhiteSpace(lastChar);
6050
6111
  const isNextWhiteSpace = isWhiteSpace(nextChar);
6051
6112
  const left_flanking = !isNextWhiteSpace && (!isNextPunctChar || isLastWhiteSpace || isLastPunctChar);
@@ -6057,7 +6118,7 @@ StateInline.prototype.scanDelims = function(start, canSplitWord) {
6057
6118
  StateInline.prototype.Token = token_default;
6058
6119
  var state_inline_default = StateInline;
6059
6120
 
6060
- // ../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_inline/text.mjs
6121
+ // ../../node_modules/.pnpm/markdown-it@14.2.0/node_modules/markdown-it/lib/rules_inline/text.mjs
6061
6122
  function isTerminatorChar(ch) {
6062
6123
  switch (ch) {
6063
6124
  case 10:
@@ -6103,7 +6164,7 @@ function text(state, silent) {
6103
6164
  return true;
6104
6165
  }
6105
6166
 
6106
- // ../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_inline/linkify.mjs
6167
+ // ../../node_modules/.pnpm/markdown-it@14.2.0/node_modules/markdown-it/lib/rules_inline/linkify.mjs
6107
6168
  var SCHEME_RE = /(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i;
6108
6169
  function linkify2(state, silent) {
6109
6170
  if (!state.md.options.linkify) return false;
@@ -6146,7 +6207,7 @@ function linkify2(state, silent) {
6146
6207
  return true;
6147
6208
  }
6148
6209
 
6149
- // ../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_inline/newline.mjs
6210
+ // ../../node_modules/.pnpm/markdown-it@14.2.0/node_modules/markdown-it/lib/rules_inline/newline.mjs
6150
6211
  function newline(state, silent) {
6151
6212
  let pos = state.pos;
6152
6213
  if (state.src.charCodeAt(pos) !== 10) {
@@ -6177,7 +6238,7 @@ function newline(state, silent) {
6177
6238
  return true;
6178
6239
  }
6179
6240
 
6180
- // ../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_inline/escape.mjs
6241
+ // ../../node_modules/.pnpm/markdown-it@14.2.0/node_modules/markdown-it/lib/rules_inline/escape.mjs
6181
6242
  var ESCAPED = [];
6182
6243
  for (let i = 0; i < 256; i++) {
6183
6244
  ESCAPED.push(0);
@@ -6228,7 +6289,7 @@ function escape2(state, silent) {
6228
6289
  return true;
6229
6290
  }
6230
6291
 
6231
- // ../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_inline/backticks.mjs
6292
+ // ../../node_modules/.pnpm/markdown-it@14.2.0/node_modules/markdown-it/lib/rules_inline/backticks.mjs
6232
6293
  function backtick(state, silent) {
6233
6294
  let pos = state.pos;
6234
6295
  const ch = state.src.charCodeAt(pos);
@@ -6273,7 +6334,7 @@ function backtick(state, silent) {
6273
6334
  return true;
6274
6335
  }
6275
6336
 
6276
- // ../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_inline/strikethrough.mjs
6337
+ // ../../node_modules/.pnpm/markdown-it@14.2.0/node_modules/markdown-it/lib/rules_inline/strikethrough.mjs
6277
6338
  function strikethrough_tokenize(state, silent) {
6278
6339
  const start = state.pos;
6279
6340
  const marker = state.src.charCodeAt(start);
@@ -6369,7 +6430,7 @@ var strikethrough_default = {
6369
6430
  postProcess: strikethrough_postProcess
6370
6431
  };
6371
6432
 
6372
- // ../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_inline/emphasis.mjs
6433
+ // ../../node_modules/.pnpm/markdown-it@14.2.0/node_modules/markdown-it/lib/rules_inline/emphasis.mjs
6373
6434
  function emphasis_tokenize(state, silent) {
6374
6435
  const start = state.pos;
6375
6436
  const marker = state.src.charCodeAt(start);
@@ -6456,7 +6517,7 @@ var emphasis_default = {
6456
6517
  postProcess: emphasis_post_process
6457
6518
  };
6458
6519
 
6459
- // ../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_inline/link.mjs
6520
+ // ../../node_modules/.pnpm/markdown-it@14.2.0/node_modules/markdown-it/lib/rules_inline/link.mjs
6460
6521
  function link(state, silent) {
6461
6522
  let code2, label, res, ref;
6462
6523
  let href = "";
@@ -6564,7 +6625,7 @@ function link(state, silent) {
6564
6625
  return true;
6565
6626
  }
6566
6627
 
6567
- // ../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_inline/image.mjs
6628
+ // ../../node_modules/.pnpm/markdown-it@14.2.0/node_modules/markdown-it/lib/rules_inline/image.mjs
6568
6629
  function image(state, silent) {
6569
6630
  let code2, content, label, pos, ref, res, title, start;
6570
6631
  let href = "";
@@ -6677,7 +6738,7 @@ function image(state, silent) {
6677
6738
  return true;
6678
6739
  }
6679
6740
 
6680
- // ../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_inline/autolink.mjs
6741
+ // ../../node_modules/.pnpm/markdown-it@14.2.0/node_modules/markdown-it/lib/rules_inline/autolink.mjs
6681
6742
  var EMAIL_RE = /^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/;
6682
6743
  var AUTOLINK_RE = /^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;
6683
6744
  function autolink(state, silent) {
@@ -6735,7 +6796,7 @@ function autolink(state, silent) {
6735
6796
  return false;
6736
6797
  }
6737
6798
 
6738
- // ../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_inline/html_inline.mjs
6799
+ // ../../node_modules/.pnpm/markdown-it@14.2.0/node_modules/markdown-it/lib/rules_inline/html_inline.mjs
6739
6800
  function isLinkOpen2(str) {
6740
6801
  return /^<a[>\s]/i.test(str);
6741
6802
  }
@@ -6773,7 +6834,7 @@ function html_inline(state, silent) {
6773
6834
  return true;
6774
6835
  }
6775
6836
 
6776
- // ../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_inline/entity.mjs
6837
+ // ../../node_modules/.pnpm/markdown-it@14.2.0/node_modules/markdown-it/lib/rules_inline/entity.mjs
6777
6838
  var DIGITAL_RE = /^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i;
6778
6839
  var NAMED_RE = /^&([a-z][a-z0-9]{1,31});/i;
6779
6840
  function entity(state, silent) {
@@ -6798,7 +6859,7 @@ function entity(state, silent) {
6798
6859
  } else {
6799
6860
  const match2 = state.src.slice(pos).match(NAMED_RE);
6800
6861
  if (match2) {
6801
- const decoded = decodeHTML(match2[0]);
6862
+ const decoded = decodeHTMLStrict(match2[0]);
6802
6863
  if (decoded !== match2[0]) {
6803
6864
  if (!silent) {
6804
6865
  const token = state.push("text_special", "", 0);
@@ -6814,7 +6875,7 @@ function entity(state, silent) {
6814
6875
  return false;
6815
6876
  }
6816
6877
 
6817
- // ../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_inline/balance_pairs.mjs
6878
+ // ../../node_modules/.pnpm/markdown-it@14.2.0/node_modules/markdown-it/lib/rules_inline/balance_pairs.mjs
6818
6879
  function processDelimiters(delimiters) {
6819
6880
  const openersBottom = {};
6820
6881
  const max = delimiters.length;
@@ -6878,7 +6939,7 @@ function link_pairs(state) {
6878
6939
  }
6879
6940
  }
6880
6941
 
6881
- // ../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_inline/fragments_join.mjs
6942
+ // ../../node_modules/.pnpm/markdown-it@14.2.0/node_modules/markdown-it/lib/rules_inline/fragments_join.mjs
6882
6943
  function fragments_join(state) {
6883
6944
  let curr, last;
6884
6945
  let level = 0;
@@ -6902,7 +6963,7 @@ function fragments_join(state) {
6902
6963
  }
6903
6964
  }
6904
6965
 
6905
- // ../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/parser_inline.mjs
6966
+ // ../../node_modules/.pnpm/markdown-it@14.2.0/node_modules/markdown-it/lib/parser_inline.mjs
6906
6967
  var _rules3 = [
6907
6968
  ["text", text],
6908
6969
  ["linkify", linkify2],
@@ -7009,7 +7070,7 @@ ParserInline.prototype.parse = function(str, md2, env, outTokens) {
7009
7070
  ParserInline.prototype.State = state_inline_default;
7010
7071
  var parser_inline_default = ParserInline;
7011
7072
 
7012
- // ../../node_modules/.pnpm/linkify-it@5.0.0/node_modules/linkify-it/lib/re.mjs
7073
+ // ../../node_modules/.pnpm/linkify-it@5.0.1/node_modules/linkify-it/lib/re.mjs
7013
7074
  function re_default(opts) {
7014
7075
  const re = {};
7015
7076
  opts = opts || {};
@@ -7051,7 +7112,7 @@ function re_default(opts) {
7051
7112
  return re;
7052
7113
  }
7053
7114
 
7054
- // ../../node_modules/.pnpm/linkify-it@5.0.0/node_modules/linkify-it/index.mjs
7115
+ // ../../node_modules/.pnpm/linkify-it@5.0.1/node_modules/linkify-it/index.mjs
7055
7116
  function assign2(obj) {
7056
7117
  const sources = Array.prototype.slice.call(arguments, 1);
7057
7118
  sources.forEach(function(source) {
@@ -7151,10 +7212,6 @@ var defaultSchemas = {
7151
7212
  };
7152
7213
  var tlds_2ch_src_re = "a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]";
7153
7214
  var tlds_default = "biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|\u0440\u0444".split("|");
7154
- function resetScanCache(self) {
7155
- self.__index__ = -1;
7156
- self.__text_cache__ = "";
7157
- }
7158
7215
  function createValidator(re) {
7159
7216
  return function(text2, pos) {
7160
7217
  const tail = text2.slice(pos);
@@ -7182,8 +7239,11 @@ function compile(self) {
7182
7239
  return tpl.replace("%TLDS%", re.src_tlds);
7183
7240
  }
7184
7241
  re.email_fuzzy = RegExp(untpl(re.tpl_email_fuzzy), "i");
7242
+ re.email_fuzzy_global = RegExp(untpl(re.tpl_email_fuzzy), "ig");
7185
7243
  re.link_fuzzy = RegExp(untpl(re.tpl_link_fuzzy), "i");
7244
+ re.link_fuzzy_global = RegExp(untpl(re.tpl_link_fuzzy), "ig");
7186
7245
  re.link_no_ip_fuzzy = RegExp(untpl(re.tpl_link_no_ip_fuzzy), "i");
7246
+ re.link_no_ip_fuzzy_global = RegExp(untpl(re.tpl_link_no_ip_fuzzy), "ig");
7187
7247
  re.host_fuzzy_test = RegExp(untpl(re.tpl_host_fuzzy_test), "i");
7188
7248
  const aliases = [];
7189
7249
  self.__compiled__ = {};
@@ -7238,23 +7298,15 @@ function compile(self) {
7238
7298
  "(" + self.re.schema_test.source + ")|(" + self.re.host_fuzzy_test.source + ")|@",
7239
7299
  "i"
7240
7300
  );
7241
- resetScanCache(self);
7242
- }
7243
- function Match(self, shift) {
7244
- const start = self.__index__;
7245
- const end = self.__last_index__;
7246
- const text2 = self.__text_cache__.slice(start, end);
7247
- this.schema = self.__schema__.toLowerCase();
7248
- this.index = start + shift;
7249
- this.lastIndex = end + shift;
7250
- this.raw = text2;
7251
- this.text = text2;
7252
- this.url = text2;
7253
- }
7254
- function createMatch(self, shift) {
7255
- const match2 = new Match(self, shift);
7256
- self.__compiled__[match2.schema].normalize(match2, self);
7257
- return match2;
7301
+ }
7302
+ function Match(text2, schema2, index, lastIndex) {
7303
+ const raw = text2.slice(index, lastIndex);
7304
+ this.schema = schema2.toLowerCase();
7305
+ this.index = index;
7306
+ this.lastIndex = lastIndex;
7307
+ this.raw = raw;
7308
+ this.text = raw;
7309
+ this.url = raw;
7258
7310
  }
7259
7311
  function LinkifyIt(schemas, options) {
7260
7312
  if (!(this instanceof LinkifyIt)) {
@@ -7267,10 +7319,6 @@ function LinkifyIt(schemas, options) {
7267
7319
  }
7268
7320
  }
7269
7321
  this.__opts__ = assign2({}, defaultOptions, options);
7270
- this.__index__ = -1;
7271
- this.__last_index__ = -1;
7272
- this.__schema__ = "";
7273
- this.__text_cache__ = "";
7274
7322
  this.__schemas__ = assign2({}, defaultSchemas, schemas);
7275
7323
  this.__compiled__ = {};
7276
7324
  this.__tlds__ = tlds_default;
@@ -7288,55 +7336,34 @@ LinkifyIt.prototype.set = function set(options) {
7288
7336
  return this;
7289
7337
  };
7290
7338
  LinkifyIt.prototype.test = function test(text2) {
7291
- this.__text_cache__ = text2;
7292
- this.__index__ = -1;
7293
7339
  if (!text2.length) {
7294
7340
  return false;
7295
7341
  }
7296
- let m, ml, me, len, shift, next, re, tld_pos, at_pos;
7342
+ let m, re;
7297
7343
  if (this.re.schema_test.test(text2)) {
7298
7344
  re = this.re.schema_search;
7299
7345
  re.lastIndex = 0;
7300
7346
  while ((m = re.exec(text2)) !== null) {
7301
- len = this.testSchemaAt(text2, m[2], re.lastIndex);
7302
- if (len) {
7303
- this.__schema__ = m[2];
7304
- this.__index__ = m.index + m[1].length;
7305
- this.__last_index__ = m.index + m[0].length + len;
7306
- break;
7347
+ if (this.testSchemaAt(text2, m[2], re.lastIndex)) {
7348
+ return true;
7307
7349
  }
7308
7350
  }
7309
7351
  }
7310
7352
  if (this.__opts__.fuzzyLink && this.__compiled__["http:"]) {
7311
- tld_pos = text2.search(this.re.host_fuzzy_test);
7312
- if (tld_pos >= 0) {
7313
- if (this.__index__ < 0 || tld_pos < this.__index__) {
7314
- if ((ml = text2.match(this.__opts__.fuzzyIP ? this.re.link_fuzzy : this.re.link_no_ip_fuzzy)) !== null) {
7315
- shift = ml.index + ml[1].length;
7316
- if (this.__index__ < 0 || shift < this.__index__) {
7317
- this.__schema__ = "";
7318
- this.__index__ = shift;
7319
- this.__last_index__ = ml.index + ml[0].length;
7320
- }
7321
- }
7353
+ if (text2.search(this.re.host_fuzzy_test) >= 0) {
7354
+ if (text2.match(this.__opts__.fuzzyIP ? this.re.link_fuzzy : this.re.link_no_ip_fuzzy) !== null) {
7355
+ return true;
7322
7356
  }
7323
7357
  }
7324
7358
  }
7325
7359
  if (this.__opts__.fuzzyEmail && this.__compiled__["mailto:"]) {
7326
- at_pos = text2.indexOf("@");
7327
- if (at_pos >= 0) {
7328
- if ((me = text2.match(this.re.email_fuzzy)) !== null) {
7329
- shift = me.index + me[1].length;
7330
- next = me.index + me[0].length;
7331
- if (this.__index__ < 0 || shift < this.__index__ || shift === this.__index__ && next > this.__last_index__) {
7332
- this.__schema__ = "mailto:";
7333
- this.__index__ = shift;
7334
- this.__last_index__ = next;
7335
- }
7360
+ if (text2.indexOf("@") >= 0) {
7361
+ if (text2.match(this.re.email_fuzzy) !== null) {
7362
+ return true;
7336
7363
  }
7337
7364
  }
7338
7365
  }
7339
- return this.__index__ >= 0;
7366
+ return false;
7340
7367
  };
7341
7368
  LinkifyIt.prototype.pretest = function pretest(text2) {
7342
7369
  return this.re.pretest.test(text2);
@@ -7349,16 +7376,87 @@ LinkifyIt.prototype.testSchemaAt = function testSchemaAt(text2, schema2, pos) {
7349
7376
  };
7350
7377
  LinkifyIt.prototype.match = function match(text2) {
7351
7378
  const result = [];
7352
- let shift = 0;
7353
- if (this.__index__ >= 0 && this.__text_cache__ === text2) {
7354
- result.push(createMatch(this, shift));
7355
- shift = this.__last_index__;
7379
+ const type_schemed = [];
7380
+ const type_fuzzy_link = [];
7381
+ const type_fuzzy_email = [];
7382
+ let m, len, re;
7383
+ function choose(a, b) {
7384
+ if (!a) {
7385
+ return b;
7386
+ }
7387
+ if (!b) {
7388
+ return a;
7389
+ }
7390
+ if (a.index !== b.index) {
7391
+ return a.index < b.index ? a : b;
7392
+ }
7393
+ return a.lastIndex >= b.lastIndex ? a : b;
7394
+ }
7395
+ if (!text2.length) {
7396
+ return null;
7397
+ }
7398
+ if (this.re.schema_test.test(text2)) {
7399
+ re = this.re.schema_search;
7400
+ re.lastIndex = 0;
7401
+ while ((m = re.exec(text2)) !== null) {
7402
+ len = this.testSchemaAt(text2, m[2], re.lastIndex);
7403
+ if (len) {
7404
+ type_schemed.push({
7405
+ schema: m[2],
7406
+ index: m.index + m[1].length,
7407
+ lastIndex: m.index + m[0].length + len
7408
+ });
7409
+ }
7410
+ }
7411
+ }
7412
+ if (this.__opts__.fuzzyLink && this.__compiled__["http:"]) {
7413
+ re = this.__opts__.fuzzyIP ? this.re.link_fuzzy_global : this.re.link_no_ip_fuzzy_global;
7414
+ re.lastIndex = 0;
7415
+ while ((m = re.exec(text2)) !== null) {
7416
+ type_fuzzy_link.push({
7417
+ schema: "",
7418
+ index: m.index + m[1].length,
7419
+ lastIndex: m.index + m[0].length
7420
+ });
7421
+ }
7422
+ }
7423
+ if (this.__opts__.fuzzyEmail && this.__compiled__["mailto:"]) {
7424
+ re = this.re.email_fuzzy_global;
7425
+ re.lastIndex = 0;
7426
+ while ((m = re.exec(text2)) !== null) {
7427
+ type_fuzzy_email.push({
7428
+ schema: "mailto:",
7429
+ index: m.index + m[1].length,
7430
+ lastIndex: m.index + m[0].length
7431
+ });
7432
+ }
7356
7433
  }
7357
- let tail = shift ? text2.slice(shift) : text2;
7358
- while (this.test(tail)) {
7359
- result.push(createMatch(this, shift));
7360
- tail = tail.slice(this.__last_index__);
7361
- shift += this.__last_index__;
7434
+ const indexes = [0, 0, 0];
7435
+ let lastIndex = 0;
7436
+ for (; ; ) {
7437
+ const candidates = [
7438
+ type_schemed[indexes[0]],
7439
+ type_fuzzy_email[indexes[1]],
7440
+ type_fuzzy_link[indexes[2]]
7441
+ ];
7442
+ const candidate = choose(choose(candidates[0], candidates[1]), candidates[2]);
7443
+ if (!candidate) {
7444
+ break;
7445
+ }
7446
+ if (candidate === candidates[0]) {
7447
+ indexes[0]++;
7448
+ } else if (candidate === candidates[1]) {
7449
+ indexes[1]++;
7450
+ } else {
7451
+ indexes[2]++;
7452
+ }
7453
+ if (candidate.index < lastIndex) {
7454
+ continue;
7455
+ }
7456
+ const match2 = new Match(text2, candidate.schema, candidate.index, candidate.lastIndex);
7457
+ this.__compiled__[match2.schema].normalize(match2, this);
7458
+ result.push(match2);
7459
+ lastIndex = candidate.lastIndex;
7362
7460
  }
7363
7461
  if (result.length) {
7364
7462
  return result;
@@ -7366,17 +7464,14 @@ LinkifyIt.prototype.match = function match(text2) {
7366
7464
  return null;
7367
7465
  };
7368
7466
  LinkifyIt.prototype.matchAtStart = function matchAtStart(text2) {
7369
- this.__text_cache__ = text2;
7370
- this.__index__ = -1;
7371
7467
  if (!text2.length) return null;
7372
7468
  const m = this.re.schema_at_start.exec(text2);
7373
7469
  if (!m) return null;
7374
7470
  const len = this.testSchemaAt(text2, m[2], m[0].length);
7375
7471
  if (!len) return null;
7376
- this.__schema__ = m[2];
7377
- this.__index__ = m.index + m[1].length;
7378
- this.__last_index__ = m.index + m[0].length + len;
7379
- return createMatch(this, 0);
7472
+ const match2 = new Match(text2, m[2], m.index + m[1].length, m.index + m[0].length + len);
7473
+ this.__compiled__[match2.schema].normalize(match2, this);
7474
+ return match2;
7380
7475
  };
7381
7476
  LinkifyIt.prototype.tlds = function tlds(list2, keepOld) {
7382
7477
  list2 = Array.isArray(list2) ? list2 : [list2];
@@ -7638,7 +7733,7 @@ var punycode = {
7638
7733
  };
7639
7734
  var punycode_es6_default = punycode;
7640
7735
 
7641
- // ../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/presets/default.mjs
7736
+ // ../../node_modules/.pnpm/markdown-it@14.2.0/node_modules/markdown-it/lib/presets/default.mjs
7642
7737
  var default_default = {
7643
7738
  options: {
7644
7739
  // Enable HTML tags in source
@@ -7677,7 +7772,7 @@ var default_default = {
7677
7772
  }
7678
7773
  };
7679
7774
 
7680
- // ../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/presets/zero.mjs
7775
+ // ../../node_modules/.pnpm/markdown-it@14.2.0/node_modules/markdown-it/lib/presets/zero.mjs
7681
7776
  var zero_default = {
7682
7777
  options: {
7683
7778
  // Enable HTML tags in source
@@ -7735,7 +7830,7 @@ var zero_default = {
7735
7830
  }
7736
7831
  };
7737
7832
 
7738
- // ../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/presets/commonmark.mjs
7833
+ // ../../node_modules/.pnpm/markdown-it@14.2.0/node_modules/markdown-it/lib/presets/commonmark.mjs
7739
7834
  var commonmark_default = {
7740
7835
  options: {
7741
7836
  // Enable HTML tags in source
@@ -7812,7 +7907,7 @@ var commonmark_default = {
7812
7907
  }
7813
7908
  };
7814
7909
 
7815
- // ../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/index.mjs
7910
+ // ../../node_modules/.pnpm/markdown-it@14.2.0/node_modules/markdown-it/lib/index.mjs
7816
7911
  var config = {
7817
7912
  default: default_default,
7818
7913
  zero: zero_default,