@depup/markdown-it 14.3.0-depup.39 → 15.0.0-depup.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.
Files changed (72) hide show
  1. package/README.md +5 -9
  2. package/bin/markdown-it.mjs +2 -2
  3. package/changes.json +3 -19
  4. package/dist/browser/markdown-it.esm.min.mjs +2972 -0
  5. package/dist/browser/markdown-it.esm.min.mjs.map +1 -0
  6. package/dist/browser/markdown-it.umd.min.js +14 -0
  7. package/dist/browser/markdown-it.umd.min.js.map +1 -0
  8. package/dist/markdown-it.cjs.js +4412 -0
  9. package/dist/markdown-it.cjs.js.map +1 -0
  10. package/dist/markdown-it.d.cts +19 -0
  11. package/dist/markdown-it.d.mts +979 -0
  12. package/dist/{index.cjs.js → markdown-it.mjs} +1437 -1466
  13. package/dist/markdown-it.mjs.map +1 -0
  14. package/package.json +48 -46
  15. package/dist/index.cjs.js.map +0 -1
  16. package/dist/markdown-it.js +0 -3975
  17. package/dist/markdown-it.js.map +0 -1
  18. package/dist/markdown-it.min.js +0 -3
  19. package/dist/markdown-it.min.js.map +0 -1
  20. package/index.mjs +0 -1
  21. package/lib/common/html_blocks.mjs +0 -67
  22. package/lib/common/html_re.mjs +0 -25
  23. package/lib/common/utils.mjs +0 -324
  24. package/lib/helpers/index.mjs +0 -11
  25. package/lib/helpers/parse_link_destination.mjs +0 -77
  26. package/lib/helpers/parse_link_label.mjs +0 -49
  27. package/lib/helpers/parse_link_title.mjs +0 -66
  28. package/lib/index.mjs +0 -565
  29. package/lib/parser_block.mjs +0 -134
  30. package/lib/parser_core.mjs +0 -62
  31. package/lib/parser_inline.mjs +0 -197
  32. package/lib/presets/commonmark.mjs +0 -88
  33. package/lib/presets/default.mjs +0 -47
  34. package/lib/presets/zero.mjs +0 -70
  35. package/lib/renderer.mjs +0 -322
  36. package/lib/ruler.mjs +0 -340
  37. package/lib/rules_block/blockquote.mjs +0 -209
  38. package/lib/rules_block/code.mjs +0 -30
  39. package/lib/rules_block/fence.mjs +0 -94
  40. package/lib/rules_block/heading.mjs +0 -51
  41. package/lib/rules_block/hr.mjs +0 -40
  42. package/lib/rules_block/html_block.mjs +0 -80
  43. package/lib/rules_block/lheading.mjs +0 -85
  44. package/lib/rules_block/list.mjs +0 -331
  45. package/lib/rules_block/paragraph.mjs +0 -48
  46. package/lib/rules_block/reference.mjs +0 -212
  47. package/lib/rules_block/state_block.mjs +0 -220
  48. package/lib/rules_block/table.mjs +0 -228
  49. package/lib/rules_core/block.mjs +0 -13
  50. package/lib/rules_core/inline.mjs +0 -11
  51. package/lib/rules_core/linkify.mjs +0 -134
  52. package/lib/rules_core/normalize.mjs +0 -17
  53. package/lib/rules_core/replacements.mjs +0 -101
  54. package/lib/rules_core/smartquotes.mjs +0 -209
  55. package/lib/rules_core/state_core.mjs +0 -17
  56. package/lib/rules_core/text_join.mjs +0 -43
  57. package/lib/rules_inline/autolink.mjs +0 -72
  58. package/lib/rules_inline/backticks.mjs +0 -60
  59. package/lib/rules_inline/balance_pairs.mjs +0 -124
  60. package/lib/rules_inline/emphasis.mjs +0 -123
  61. package/lib/rules_inline/entity.mjs +0 -51
  62. package/lib/rules_inline/escape.mjs +0 -83
  63. package/lib/rules_inline/fragments_join.mjs +0 -38
  64. package/lib/rules_inline/html_inline.mjs +0 -50
  65. package/lib/rules_inline/image.mjs +0 -138
  66. package/lib/rules_inline/link.mjs +0 -139
  67. package/lib/rules_inline/linkify.mjs +0 -63
  68. package/lib/rules_inline/newline.mjs +0 -42
  69. package/lib/rules_inline/state_inline.mjs +0 -154
  70. package/lib/rules_inline/strikethrough.mjs +0 -127
  71. package/lib/rules_inline/text.mjs +0 -86
  72. package/lib/token.mjs +0 -191
@@ -0,0 +1,4412 @@
1
+ /*! markdown-it 15.0.0 https://github.com/markdown-it/markdown-it @license MIT */
2
+ //#region \0rolldown/runtime.js
3
+ var __create = Object.create;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getProtoOf = Object.getPrototypeOf;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __exportAll = (all, no_symbols) => {
10
+ let target = {};
11
+ for (var name in all) __defProp(target, name, {
12
+ get: all[name],
13
+ enumerable: true
14
+ });
15
+ if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
16
+ return target;
17
+ };
18
+ var __copyProps = (to, from, except, desc) => {
19
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
20
+ key = keys[i];
21
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
22
+ get: ((k) => from[k]).bind(null, key),
23
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
24
+ });
25
+ }
26
+ return to;
27
+ };
28
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
29
+ value: mod,
30
+ enumerable: true
31
+ }) : target, mod));
32
+ //#endregion
33
+ let mdurl = require("mdurl");
34
+ mdurl = __toESM(mdurl, 1);
35
+ let uc_micro = require("uc.micro");
36
+ uc_micro = __toESM(uc_micro, 1);
37
+ let linkify_it = require("linkify-it");
38
+ let punycode_js = require("punycode.js");
39
+ punycode_js = __toESM(punycode_js, 1);
40
+ //#region node_modules/entities/dist/decode-codepoint.js
41
+ var decodeMap = /* @__PURE__ */ new Map([
42
+ [0, 65533],
43
+ [128, 8364],
44
+ [130, 8218],
45
+ [131, 402],
46
+ [132, 8222],
47
+ [133, 8230],
48
+ [134, 8224],
49
+ [135, 8225],
50
+ [136, 710],
51
+ [137, 8240],
52
+ [138, 352],
53
+ [139, 8249],
54
+ [140, 338],
55
+ [142, 381],
56
+ [145, 8216],
57
+ [146, 8217],
58
+ [147, 8220],
59
+ [148, 8221],
60
+ [149, 8226],
61
+ [150, 8211],
62
+ [151, 8212],
63
+ [152, 732],
64
+ [153, 8482],
65
+ [154, 353],
66
+ [155, 8250],
67
+ [156, 339],
68
+ [158, 382],
69
+ [159, 376]
70
+ ]);
71
+ /**
72
+ * Replace the given code point with a replacement character if it is a
73
+ * surrogate or is outside the valid range. Otherwise return the code
74
+ * point unchanged.
75
+ * @param codePoint Unicode code point to convert.
76
+ */
77
+ function replaceCodePoint(codePoint) {
78
+ var _decodeMap$get;
79
+ if (codePoint >= 55296 && codePoint <= 57343 || codePoint > 1114111) return 65533;
80
+ return (_decodeMap$get = decodeMap.get(codePoint)) !== null && _decodeMap$get !== void 0 ? _decodeMap$get : codePoint;
81
+ }
82
+ //#endregion
83
+ //#region node_modules/entities/dist/internal/decode-shared.js
84
+ /**
85
+ * Shared base64 decode helper for generated decode data.
86
+ * Assumes global atob is available.
87
+ * @param input Input string to encode or decode.
88
+ */
89
+ function decodeBase64(input) {
90
+ const binary = atob(input);
91
+ const evenLength = binary.length & -2;
92
+ const out = new Uint16Array(evenLength / 2);
93
+ for (let index = 0, outIndex = 0; index < evenLength; index += 2) {
94
+ const lo = binary.charCodeAt(index);
95
+ const hi = binary.charCodeAt(index + 1);
96
+ out[outIndex++] = lo | hi << 8;
97
+ }
98
+ return out;
99
+ }
100
+ //#endregion
101
+ //#region node_modules/entities/dist/generated/decode-data-html.js
102
+ /** Packed HTML decode trie data. */
103
+ var htmlDecodeTree = /* #__PURE__ */ decodeBase64("QR08ALkAAgH6AYsDNQR2BO0EPgXZBQEGLAbdBxMISQrvCmQLfQurDKQNLw4fD4YPpA+6D/IPAAAAAAAAAAAAAAAAKhBMEY8TmxUWF2EYLBkxGuAa3RsJHDscWR8YIC8jSCSIJcMl6ie3Ku8rEC0CLjoupS7kLgAIRU1hYmNmZ2xtbm9wcnN0dVQAWgBeAGUAaQBzAHcAfgCBAIQAhwCSAJoAoACsALMAbABpAGcAO4DGAMZAUAA7gCYAJkB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DnAnIA8gCTB75jAAFBYWYuaS5yAPIA4AJyAPIAjAdhAPAAeh5pAHMAAKD7IoABZHB0APgReS6DLgABZmx9LoAuAOA12GnddQDzAP8RaQBtAOUABBIAAUFhiy6OLnIA8gDuAnIA8gCaBwABY3GVLgoScgAA4DXYzdwAAXB0nS6hLmwAdQDzACUScgDpACASAARhY2VmaW9zdbEuvC7ELsguzC7PLtQu2S5jAAABdXm2LrsudABlADuA/QD9QE9kAAFpecAuwy5yAGMAd2FLZG4AO4ClAKVAcgAA4DXYNt1jAHkAV2RwAGYAAOA12GrdYwByAADgNdjO3AABY23dLt8ueQBOZGwAO4D/AP9AAAVhY2RlZmhpb3N38y73Lv8uAi8MLxAvEy8YLx0vIi9jInV0ZQB6YQABYXn7Lv4u8iFvbn5hN2RvAHQAfGEAAWV0Bi8KL3QAcgDmAB8QYQC2Y3IAAOA12DfdYwB5ADZk5yJyYXJyAKDdIXAAZgAA4DXYa91jAHIAAOA12M/cAAFqbiYvKC8AoA0gagAAoAwg");
104
+ //#endregion
105
+ //#region node_modules/entities/dist/internal/bin-trie-flags.js
106
+ /**
107
+ * Bit flags & masks for the binary trie encoding used for entity decoding.
108
+ *
109
+ * Bit layout (16 bits total):
110
+ * 15..14 VALUE_LENGTH (+1 encoding; 0 => no value)
111
+ * 13 FLAG13. If valueLength>0: semicolon required flag (implicit ';').
112
+ * If valueLength==0: compact run flag.
113
+ * 12..7 BRANCH_LENGTH Branch length (0 => single branch in 6..0 if jumpOffset==char) OR run length (when compact run)
114
+ * 6..0 JUMP_TABLE Jump offset (jump table) OR single-branch char code OR first run char
115
+ */
116
+ var BinTrieFlags;
117
+ (function(BinTrieFlags) {
118
+ BinTrieFlags[BinTrieFlags["VALUE_LENGTH"] = 49152] = "VALUE_LENGTH";
119
+ BinTrieFlags[BinTrieFlags["FLAG13"] = 8192] = "FLAG13";
120
+ BinTrieFlags[BinTrieFlags["BRANCH_LENGTH"] = 8064] = "BRANCH_LENGTH";
121
+ BinTrieFlags[BinTrieFlags["JUMP_TABLE"] = 127] = "JUMP_TABLE";
122
+ })(BinTrieFlags || (BinTrieFlags = {}));
123
+ //#endregion
124
+ //#region \0@oxc-project+runtime@0.142.0/helpers/esm/typeof.js
125
+ function _typeof(o) {
126
+ "@babel/helpers - typeof";
127
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
128
+ return typeof o;
129
+ } : function(o) {
130
+ return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
131
+ }, _typeof(o);
132
+ }
133
+ //#endregion
134
+ //#region \0@oxc-project+runtime@0.142.0/helpers/esm/toPrimitive.js
135
+ function toPrimitive(t, r) {
136
+ if ("object" != _typeof(t) || !t) return t;
137
+ var e = t[Symbol.toPrimitive];
138
+ if (void 0 !== e) {
139
+ var i = e.call(t, r || "default");
140
+ if ("object" != _typeof(i)) return i;
141
+ throw new TypeError("@@toPrimitive must return a primitive value.");
142
+ }
143
+ return ("string" === r ? String : Number)(t);
144
+ }
145
+ //#endregion
146
+ //#region \0@oxc-project+runtime@0.142.0/helpers/esm/toPropertyKey.js
147
+ function toPropertyKey(t) {
148
+ var i = toPrimitive(t, "string");
149
+ return "symbol" == _typeof(i) ? i : i + "";
150
+ }
151
+ //#endregion
152
+ //#region \0@oxc-project+runtime@0.142.0/helpers/esm/defineProperty.js
153
+ function _defineProperty(e, r, t) {
154
+ return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
155
+ value: t,
156
+ enumerable: !0,
157
+ configurable: !0,
158
+ writable: !0
159
+ }) : e[r] = t, e;
160
+ }
161
+ //#endregion
162
+ //#region node_modules/entities/dist/decode.js
163
+ var CharCodes;
164
+ (function(CharCodes) {
165
+ CharCodes[CharCodes["NUM"] = 35] = "NUM";
166
+ CharCodes[CharCodes["SEMI"] = 59] = "SEMI";
167
+ CharCodes[CharCodes["EQUALS"] = 61] = "EQUALS";
168
+ CharCodes[CharCodes["ZERO"] = 48] = "ZERO";
169
+ CharCodes[CharCodes["NINE"] = 57] = "NINE";
170
+ CharCodes[CharCodes["LOWER_A"] = 97] = "LOWER_A";
171
+ CharCodes[CharCodes["LOWER_F"] = 102] = "LOWER_F";
172
+ CharCodes[CharCodes["LOWER_X"] = 120] = "LOWER_X";
173
+ CharCodes[CharCodes["LOWER_Z"] = 122] = "LOWER_Z";
174
+ CharCodes[CharCodes["UPPER_A"] = 65] = "UPPER_A";
175
+ CharCodes[CharCodes["UPPER_F"] = 70] = "UPPER_F";
176
+ CharCodes[CharCodes["UPPER_Z"] = 90] = "UPPER_Z";
177
+ })(CharCodes || (CharCodes = {}));
178
+ /** Bit that needs to be set to convert an upper case ASCII character to lower case */
179
+ var TO_LOWER_BIT = 32;
180
+ function isNumber(code) {
181
+ return code >= CharCodes.ZERO && code <= CharCodes.NINE;
182
+ }
183
+ function isHexadecimalCharacter(code) {
184
+ return code >= CharCodes.UPPER_A && code <= CharCodes.UPPER_F || code >= CharCodes.LOWER_A && code <= CharCodes.LOWER_F;
185
+ }
186
+ function isAsciiAlphaNumeric(code) {
187
+ return code >= CharCodes.UPPER_A && code <= CharCodes.UPPER_Z || code >= CharCodes.LOWER_A && code <= CharCodes.LOWER_Z || isNumber(code);
188
+ }
189
+ /**
190
+ * Checks if the given character is a valid end character for an entity in an attribute.
191
+ *
192
+ * Attribute values that aren't terminated properly aren't parsed, and shouldn't lead to a parser error.
193
+ * See the example in https://html.spec.whatwg.org/multipage/parsing.html#named-character-reference-state
194
+ * @param code Code point to decode.
195
+ */
196
+ function isEntityInAttributeInvalidEnd(code) {
197
+ return code === CharCodes.EQUALS || isAsciiAlphaNumeric(code);
198
+ }
199
+ var EntityDecoderState;
200
+ (function(EntityDecoderState) {
201
+ EntityDecoderState[EntityDecoderState["EntityStart"] = 0] = "EntityStart";
202
+ EntityDecoderState[EntityDecoderState["NumericStart"] = 1] = "NumericStart";
203
+ EntityDecoderState[EntityDecoderState["NumericDecimal"] = 2] = "NumericDecimal";
204
+ EntityDecoderState[EntityDecoderState["NumericHex"] = 3] = "NumericHex";
205
+ EntityDecoderState[EntityDecoderState["NamedEntity"] = 4] = "NamedEntity";
206
+ })(EntityDecoderState || (EntityDecoderState = {}));
207
+ /**
208
+ * Decoding mode for named entities.
209
+ */
210
+ var DecodingMode;
211
+ (function(DecodingMode) {
212
+ /** Entities in text nodes that can end with any character. */
213
+ DecodingMode[DecodingMode["Legacy"] = 0] = "Legacy";
214
+ /** Only allow entities terminated with a semicolon. */
215
+ DecodingMode[DecodingMode["Strict"] = 1] = "Strict";
216
+ /** Entities in attributes have limitations on ending characters. */
217
+ DecodingMode[DecodingMode["Attribute"] = 2] = "Attribute";
218
+ })(DecodingMode || (DecodingMode = {}));
219
+ /**
220
+ * Token decoder with support of writing partial entities.
221
+ */
222
+ var EntityDecoder = class {
223
+ constructor(decodeTree, emitCodePoint, errors) {
224
+ _defineProperty(this, "decodeTree", void 0);
225
+ _defineProperty(this, "emitCodePoint", void 0);
226
+ _defineProperty(this, "errors", void 0);
227
+ _defineProperty(
228
+ this,
229
+ /** The current state of the decoder. */
230
+ "state",
231
+ EntityDecoderState.EntityStart
232
+ );
233
+ _defineProperty(
234
+ this,
235
+ /** Characters that were consumed while parsing an entity. */
236
+ "consumed",
237
+ 1
238
+ );
239
+ _defineProperty(
240
+ this,
241
+ /**
242
+ * The result of the entity.
243
+ *
244
+ * Either the result index of a numeric entity, or the codepoint of a
245
+ * numeric entity.
246
+ */
247
+ "result",
248
+ 0
249
+ );
250
+ _defineProperty(
251
+ this,
252
+ /** The current index in the decode tree. */
253
+ "treeIndex",
254
+ 0
255
+ );
256
+ _defineProperty(
257
+ this,
258
+ /** The number of characters that were consumed in excess. */
259
+ "excess",
260
+ 1
261
+ );
262
+ _defineProperty(
263
+ this,
264
+ /** The mode in which the decoder is operating. */
265
+ "decodeMode",
266
+ DecodingMode.Strict
267
+ );
268
+ _defineProperty(
269
+ this,
270
+ /** The number of characters that have been consumed in the current run. */
271
+ "runConsumed",
272
+ 0
273
+ );
274
+ this.decodeTree = decodeTree;
275
+ this.emitCodePoint = emitCodePoint;
276
+ this.errors = errors;
277
+ }
278
+ /**
279
+ * Resets the instance to make it reusable.
280
+ * @param decodeMode Entity decoding mode to use.
281
+ */
282
+ startEntity(decodeMode) {
283
+ this.decodeMode = decodeMode;
284
+ this.state = EntityDecoderState.EntityStart;
285
+ this.result = 0;
286
+ this.treeIndex = 0;
287
+ this.excess = 1;
288
+ this.consumed = 1;
289
+ this.runConsumed = 0;
290
+ }
291
+ /**
292
+ * Write an entity to the decoder. This can be called multiple times with partial entities.
293
+ * If the entity is incomplete, the decoder will return -1.
294
+ *
295
+ * Mirrors the implementation of `getDecoder`, but with the ability to stop decoding if the
296
+ * entity is incomplete, and resume when the next string is written.
297
+ * @param input The string containing the entity (or a continuation of the entity).
298
+ * @param offset The offset at which the entity begins. Should be 0 if this is not the first call.
299
+ * @returns The number of characters that were consumed, or -1 if the entity is incomplete.
300
+ */
301
+ write(input, offset) {
302
+ switch (this.state) {
303
+ case EntityDecoderState.EntityStart:
304
+ if (input.charCodeAt(offset) === CharCodes.NUM) {
305
+ this.state = EntityDecoderState.NumericStart;
306
+ this.consumed += 1;
307
+ return this.stateNumericStart(input, offset + 1);
308
+ }
309
+ this.state = EntityDecoderState.NamedEntity;
310
+ return this.stateNamedEntity(input, offset);
311
+ case EntityDecoderState.NumericStart: return this.stateNumericStart(input, offset);
312
+ case EntityDecoderState.NumericDecimal: return this.stateNumericDecimal(input, offset);
313
+ case EntityDecoderState.NumericHex: return this.stateNumericHex(input, offset);
314
+ case EntityDecoderState.NamedEntity: return this.stateNamedEntity(input, offset);
315
+ }
316
+ }
317
+ /**
318
+ * Switches between the numeric decimal and hexadecimal states.
319
+ *
320
+ * Equivalent to the `Numeric character reference state` in the HTML spec.
321
+ * @param input The string containing the entity (or a continuation of the entity).
322
+ * @param offset The current offset.
323
+ * @returns The number of characters that were consumed, or -1 if the entity is incomplete.
324
+ */
325
+ stateNumericStart(input, offset) {
326
+ if (offset >= input.length) return -1;
327
+ if ((input.charCodeAt(offset) | TO_LOWER_BIT) === CharCodes.LOWER_X) {
328
+ this.state = EntityDecoderState.NumericHex;
329
+ this.consumed += 1;
330
+ return this.stateNumericHex(input, offset + 1);
331
+ }
332
+ this.state = EntityDecoderState.NumericDecimal;
333
+ return this.stateNumericDecimal(input, offset);
334
+ }
335
+ /**
336
+ * Parses a hexadecimal numeric entity.
337
+ *
338
+ * Equivalent to the `Hexademical character reference state` in the HTML spec.
339
+ * @param input The string containing the entity (or a continuation of the entity).
340
+ * @param offset The current offset.
341
+ * @returns The number of characters that were consumed, or -1 if the entity is incomplete.
342
+ */
343
+ stateNumericHex(input, offset) {
344
+ while (offset < input.length) {
345
+ const char = input.charCodeAt(offset);
346
+ if (isNumber(char) || isHexadecimalCharacter(char)) {
347
+ const digit = char <= CharCodes.NINE ? char - CharCodes.ZERO : (char | TO_LOWER_BIT) - CharCodes.LOWER_A + 10;
348
+ this.result = this.result * 16 + digit;
349
+ this.consumed++;
350
+ offset++;
351
+ } else return this.emitNumericEntity(char, 3);
352
+ }
353
+ return -1;
354
+ }
355
+ /**
356
+ * Parses a decimal numeric entity.
357
+ *
358
+ * Equivalent to the `Decimal character reference state` in the HTML spec.
359
+ * @param input The string containing the entity (or a continuation of the entity).
360
+ * @param offset The current offset.
361
+ * @returns The number of characters that were consumed, or -1 if the entity is incomplete.
362
+ */
363
+ stateNumericDecimal(input, offset) {
364
+ while (offset < input.length) {
365
+ const char = input.charCodeAt(offset);
366
+ if (isNumber(char)) {
367
+ this.result = this.result * 10 + (char - CharCodes.ZERO);
368
+ this.consumed++;
369
+ offset++;
370
+ } else return this.emitNumericEntity(char, 2);
371
+ }
372
+ return -1;
373
+ }
374
+ /**
375
+ * Validate and emit a numeric entity.
376
+ *
377
+ * Implements the logic from the `Hexademical character reference start
378
+ * state` and `Numeric character reference end state` in the HTML spec.
379
+ * @param lastCp The last code point of the entity. Used to see if the
380
+ * entity was terminated with a semicolon.
381
+ * @param expectedLength The minimum number of characters that should be
382
+ * consumed. Used to validate that at least one digit
383
+ * was consumed.
384
+ * @returns The number of characters that were consumed.
385
+ */
386
+ emitNumericEntity(lastCp, expectedLength) {
387
+ if (this.consumed <= expectedLength) {
388
+ var _this$errors;
389
+ (_this$errors = this.errors) === null || _this$errors === void 0 || _this$errors.absenceOfDigitsInNumericCharacterReference(this.consumed);
390
+ return 0;
391
+ }
392
+ if (lastCp === CharCodes.SEMI) this.consumed += 1;
393
+ else if (this.decodeMode === DecodingMode.Strict) return 0;
394
+ this.emitCodePoint(replaceCodePoint(this.result), this.consumed);
395
+ if (this.errors) {
396
+ if (lastCp !== CharCodes.SEMI) this.errors.missingSemicolonAfterCharacterReference();
397
+ this.errors.validateNumericCharacterReference(this.result);
398
+ }
399
+ return this.consumed;
400
+ }
401
+ /**
402
+ * Parses a named entity.
403
+ *
404
+ * Equivalent to the `Named character reference state` in the HTML spec.
405
+ * @param input The string containing the entity (or a continuation of the entity).
406
+ * @param offset The current offset.
407
+ * @returns The number of characters that were consumed, or -1 if the entity is incomplete.
408
+ */
409
+ stateNamedEntity(input, offset) {
410
+ const { decodeTree } = this;
411
+ let current = decodeTree[this.treeIndex];
412
+ let valueLength = (current & BinTrieFlags.VALUE_LENGTH) >> 14;
413
+ while (offset < input.length) {
414
+ if (valueLength === 0 && (current & BinTrieFlags.FLAG13) !== 0) {
415
+ const runLength = (current & BinTrieFlags.BRANCH_LENGTH) >> 7;
416
+ if (this.runConsumed === 0) {
417
+ const firstChar = current & BinTrieFlags.JUMP_TABLE;
418
+ if (input.charCodeAt(offset) !== firstChar) return this.result === 0 ? 0 : this.emitNotTerminatedNamedEntity();
419
+ offset++;
420
+ this.excess++;
421
+ this.runConsumed++;
422
+ }
423
+ while (this.runConsumed < runLength) {
424
+ if (offset >= input.length) return -1;
425
+ const charIndexInPacked = this.runConsumed - 1;
426
+ const packedWord = decodeTree[this.treeIndex + 1 + (charIndexInPacked >> 1)];
427
+ const expectedChar = charIndexInPacked % 2 === 0 ? packedWord & 255 : packedWord >> 8 & 255;
428
+ if (input.charCodeAt(offset) !== expectedChar) {
429
+ this.runConsumed = 0;
430
+ return this.result === 0 ? 0 : this.emitNotTerminatedNamedEntity();
431
+ }
432
+ offset++;
433
+ this.excess++;
434
+ this.runConsumed++;
435
+ }
436
+ this.runConsumed = 0;
437
+ this.treeIndex += 1 + (runLength >> 1);
438
+ current = decodeTree[this.treeIndex];
439
+ valueLength = (current & BinTrieFlags.VALUE_LENGTH) >> 14;
440
+ }
441
+ if (offset >= input.length) break;
442
+ const char = input.charCodeAt(offset);
443
+ if (char === CharCodes.SEMI && valueLength !== 0 && (current & BinTrieFlags.FLAG13) !== 0) return this.emitNamedEntityData(this.treeIndex, valueLength, this.consumed + this.excess);
444
+ this.treeIndex = determineBranch(decodeTree, current, this.treeIndex + Math.max(1, valueLength), char);
445
+ if (this.treeIndex < 0) return this.result === 0 || this.decodeMode === DecodingMode.Attribute && (valueLength === 0 || isEntityInAttributeInvalidEnd(char)) ? 0 : this.emitNotTerminatedNamedEntity();
446
+ current = decodeTree[this.treeIndex];
447
+ valueLength = (current & BinTrieFlags.VALUE_LENGTH) >> 14;
448
+ if (valueLength !== 0) {
449
+ if (char === CharCodes.SEMI) return this.emitNamedEntityData(this.treeIndex, valueLength, this.consumed + this.excess);
450
+ if (this.decodeMode !== DecodingMode.Strict && (current & BinTrieFlags.FLAG13) === 0) {
451
+ this.result = this.treeIndex;
452
+ this.consumed += this.excess;
453
+ this.excess = 0;
454
+ }
455
+ }
456
+ offset++;
457
+ this.excess++;
458
+ }
459
+ return -1;
460
+ }
461
+ /**
462
+ * Emit a named entity that was not terminated with a semicolon.
463
+ * @returns The number of characters consumed.
464
+ */
465
+ emitNotTerminatedNamedEntity() {
466
+ var _this$errors2;
467
+ const { result, decodeTree } = this;
468
+ const valueLength = (decodeTree[result] & BinTrieFlags.VALUE_LENGTH) >> 14;
469
+ this.emitNamedEntityData(result, valueLength, this.consumed);
470
+ (_this$errors2 = this.errors) === null || _this$errors2 === void 0 || _this$errors2.missingSemicolonAfterCharacterReference();
471
+ return this.consumed;
472
+ }
473
+ /**
474
+ * Emit a named entity.
475
+ * @param result The index of the entity in the decode tree.
476
+ * @param valueLength The number of bytes in the entity.
477
+ * @param consumed The number of characters consumed.
478
+ * @returns The number of characters consumed.
479
+ */
480
+ emitNamedEntityData(result, valueLength, consumed) {
481
+ const { decodeTree } = this;
482
+ this.emitCodePoint(valueLength === 1 ? decodeTree[result] & ~(BinTrieFlags.VALUE_LENGTH | BinTrieFlags.FLAG13) : decodeTree[result + 1], consumed);
483
+ if (valueLength === 3) this.emitCodePoint(decodeTree[result + 2], consumed);
484
+ return consumed;
485
+ }
486
+ /**
487
+ * Signal to the parser that the end of the input was reached.
488
+ *
489
+ * Remaining data will be emitted and relevant errors will be produced.
490
+ * @returns The number of characters consumed.
491
+ */
492
+ end() {
493
+ switch (this.state) {
494
+ case EntityDecoderState.NamedEntity: return this.result !== 0 && (this.decodeMode !== DecodingMode.Attribute || this.result === this.treeIndex) ? this.emitNotTerminatedNamedEntity() : 0;
495
+ case EntityDecoderState.NumericDecimal: return this.emitNumericEntity(0, 2);
496
+ case EntityDecoderState.NumericHex: return this.emitNumericEntity(0, 3);
497
+ case EntityDecoderState.NumericStart:
498
+ var _this$errors3;
499
+ (_this$errors3 = this.errors) === null || _this$errors3 === void 0 || _this$errors3.absenceOfDigitsInNumericCharacterReference(this.consumed);
500
+ return 0;
501
+ case EntityDecoderState.EntityStart: return 0;
502
+ }
503
+ }
504
+ };
505
+ /**
506
+ * Creates a function that decodes entities in a string.
507
+ * @param decodeTree The decode tree.
508
+ * @returns A function that decodes entities in a string.
509
+ */
510
+ function getDecoder(decodeTree) {
511
+ let returnValue = "";
512
+ const decoder = new EntityDecoder(decodeTree, (data) => returnValue += String.fromCodePoint(data));
513
+ return function decodeWithTrie(input, decodeMode) {
514
+ let lastIndex = 0;
515
+ let offset = 0;
516
+ while ((offset = input.indexOf("&", offset)) >= 0) {
517
+ returnValue += input.slice(lastIndex, offset);
518
+ decoder.startEntity(decodeMode);
519
+ const length = decoder.write(input, offset + 1);
520
+ if (length < 0) {
521
+ lastIndex = offset + decoder.end();
522
+ break;
523
+ }
524
+ lastIndex = offset + length;
525
+ offset = length === 0 ? lastIndex + 1 : lastIndex;
526
+ }
527
+ const result = returnValue + input.slice(lastIndex);
528
+ returnValue = "";
529
+ return result;
530
+ };
531
+ }
532
+ /**
533
+ * Determines the branch of the current node that is taken given the current
534
+ * character. This function is used to traverse the trie.
535
+ * @param decodeTree The trie.
536
+ * @param current The current node.
537
+ * @param nodeIndex Index immediately after the current node header.
538
+ * @param char The current character.
539
+ * @returns The index of the next node, or -1 if no branch is taken.
540
+ */
541
+ function determineBranch(decodeTree, current, nodeIndex, char) {
542
+ const branchCount = (current & BinTrieFlags.BRANCH_LENGTH) >> 7;
543
+ const jumpOffset = current & BinTrieFlags.JUMP_TABLE;
544
+ if (branchCount === 0) return jumpOffset !== 0 && char === jumpOffset ? nodeIndex : -1;
545
+ if (jumpOffset) {
546
+ const value = char - jumpOffset;
547
+ return value < 0 || value >= branchCount ? -1 : decodeTree[nodeIndex + value] - 1;
548
+ }
549
+ const packedKeySlots = branchCount + 1 >> 1;
550
+ let lo = 0;
551
+ let hi = branchCount - 1;
552
+ while (lo <= hi) {
553
+ const mid = lo + hi >>> 1;
554
+ const midKey = decodeTree[nodeIndex + (mid >> 1)] >> (mid & 1) * 8 & 255;
555
+ if (midKey < char) lo = mid + 1;
556
+ else if (midKey > char) hi = mid - 1;
557
+ else return decodeTree[nodeIndex + packedKeySlots + mid];
558
+ }
559
+ return -1;
560
+ }
561
+ var htmlDecoder = /* #__PURE__ */ getDecoder(htmlDecodeTree);
562
+ /**
563
+ * Decodes an HTML string, requiring all entities to be terminated by a semicolon.
564
+ * @param htmlString The string to decode.
565
+ * @returns The decoded string.
566
+ */
567
+ function decodeHTMLStrict(htmlString) {
568
+ return htmlDecoder(htmlString, DecodingMode.Strict);
569
+ }
570
+ //#endregion
571
+ //#region src/common/utils.ts
572
+ /**
573
+ * Common utility functions exposed through `md.utils` for use by plugins.
574
+ *
575
+ * @module md.utils
576
+ */
577
+ var utils_exports = /* @__PURE__ */ __exportAll({
578
+ arrayReplaceAt: () => arrayReplaceAt,
579
+ asciiTrim: () => asciiTrim,
580
+ callable: () => callable,
581
+ escapeHtml: () => escapeHtml,
582
+ escapeRE: () => escapeRE,
583
+ fromCodePoint: () => fromCodePoint,
584
+ isMdAsciiPunct: () => isMdAsciiPunct,
585
+ isPunctChar: () => isPunctChar,
586
+ isPunctCharCode: () => isPunctCharCode,
587
+ isSpace: () => isSpace,
588
+ isValidEntityCode: () => isValidEntityCode,
589
+ isWhiteSpace: () => isWhiteSpace,
590
+ lib: () => lib,
591
+ normalizeReference: () => normalizeReference,
592
+ unescapeAll: () => unescapeAll,
593
+ unescapeMd: () => unescapeMd
594
+ });
595
+ function callable(cls) {
596
+ const wrapper = function(...args) {
597
+ return Reflect.construct(cls, args, new.target && new.target !== wrapper ? new.target : cls);
598
+ };
599
+ Object.defineProperty(wrapper, "name", { value: cls.name });
600
+ Object.setPrototypeOf(wrapper, cls);
601
+ wrapper.prototype = cls.prototype;
602
+ return wrapper;
603
+ }
604
+ /**
605
+ * Returns a copy of a token array with the token at `pos` replaced by
606
+ * `newElements`. Used to transform token streams without modifying the
607
+ * original array.
608
+ */
609
+ function arrayReplaceAt(src, pos, newElements) {
610
+ return [].concat(src.slice(0, pos), newElements, src.slice(pos + 1));
611
+ }
612
+ /** Checks whether a code point can be decoded from a numeric HTML entity. */
613
+ function isValidEntityCode(c) {
614
+ if (c >= 55296 && c <= 57343) return false;
615
+ if (c >= 64976 && c <= 65007) return false;
616
+ if ((c & 65535) === 65535 || (c & 65535) === 65534) return false;
617
+ if (c >= 0 && c <= 8) return false;
618
+ if (c === 11) return false;
619
+ if (c >= 14 && c <= 31) return false;
620
+ if (c >= 127 && c <= 159) return false;
621
+ if (c > 1114111) return false;
622
+ return true;
623
+ }
624
+ /**
625
+ * Converts a Unicode code point to a string, like `String.fromCodePoint()`,
626
+ * but does not throw for invalid input.
627
+ */
628
+ function fromCodePoint(c) {
629
+ if (c > 65535) {
630
+ c -= 65536;
631
+ const surrogate1 = 55296 + (c >> 10);
632
+ const surrogate2 = 56320 + (c & 1023);
633
+ return String.fromCharCode(surrogate1, surrogate2);
634
+ }
635
+ return String.fromCharCode(c);
636
+ }
637
+ var UNESCAPE_MD_RE = /\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g;
638
+ var UNESCAPE_ALL_RE = new RegExp(`${UNESCAPE_MD_RE.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`, "gi");
639
+ var DIGITAL_ENTITY_TEST_RE = /^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;
640
+ function replaceEntityPattern(match, name) {
641
+ if (name.charCodeAt(0) === 35 && DIGITAL_ENTITY_TEST_RE.test(name)) {
642
+ const code = name[1].toLowerCase() === "x" ? parseInt(name.slice(2), 16) : parseInt(name.slice(1), 10);
643
+ if (isValidEntityCode(code)) return fromCodePoint(code);
644
+ return match;
645
+ }
646
+ const decoded = decodeHTMLStrict(match);
647
+ if (decoded !== match) return decoded;
648
+ return match;
649
+ }
650
+ /** Decodes Markdown backslash escapes. */
651
+ function unescapeMd(str) {
652
+ if (str.indexOf("\\") < 0) return str;
653
+ return str.replace(UNESCAPE_MD_RE, "$1");
654
+ }
655
+ /**
656
+ * Decodes Markdown backslash escapes and HTML character references in link
657
+ * destinations, link titles, and fenced code info strings.
658
+ */
659
+ function unescapeAll(str) {
660
+ if (str.indexOf("\\") < 0 && str.indexOf("&") < 0) return str;
661
+ return str.replace(UNESCAPE_ALL_RE, function(match, escaped, entity) {
662
+ if (escaped) return escaped;
663
+ return replaceEntityPattern(match, entity);
664
+ });
665
+ }
666
+ var HTML_ESCAPE_TEST_RE = /[&<>"]/;
667
+ var HTML_ESCAPE_REPLACE_RE = /[&<>"]/g;
668
+ var HTML_REPLACEMENTS = {
669
+ "&": "&amp;",
670
+ "<": "&lt;",
671
+ ">": "&gt;",
672
+ "\"": "&quot;"
673
+ };
674
+ function replaceUnsafeChar(ch) {
675
+ return HTML_REPLACEMENTS[ch];
676
+ }
677
+ /** Escapes HTML special characters in a string. */
678
+ function escapeHtml(str) {
679
+ if (HTML_ESCAPE_TEST_RE.test(str)) return str.replace(HTML_ESCAPE_REPLACE_RE, replaceUnsafeChar);
680
+ return str;
681
+ }
682
+ var REGEXP_ESCAPE_RE = /[.?*+^$[\]\\(){}|-]/g;
683
+ /** Escapes regular expression metacharacters in a string. */
684
+ function escapeRE(str) {
685
+ return str.replace(REGEXP_ESCAPE_RE, "\\$&");
686
+ }
687
+ /** Checks whether a character code is an ASCII space or tab. */
688
+ function isSpace(code) {
689
+ switch (code) {
690
+ case 9:
691
+ case 32: return true;
692
+ }
693
+ return false;
694
+ }
695
+ /**
696
+ * Checks whether a character code is whitespace recognized by Markdown.
697
+ *
698
+ * Matches the Unicode `Zs` category or `\t`, `\f`, `\v`, `\r`, `\n`.
699
+ */
700
+ function isWhiteSpace(code) {
701
+ if (code >= 8192 && code <= 8202) return true;
702
+ switch (code) {
703
+ case 9:
704
+ case 10:
705
+ case 11:
706
+ case 12:
707
+ case 13:
708
+ case 32:
709
+ case 160:
710
+ case 5760:
711
+ case 8239:
712
+ case 8287:
713
+ case 12288: return true;
714
+ }
715
+ return false;
716
+ }
717
+ /**
718
+ * Checks whether a character is Unicode punctuation or a symbol.
719
+ *
720
+ * Does not support astral characters.
721
+ */
722
+ function isPunctChar(ch) {
723
+ return uc_micro.P.test(ch) || uc_micro.S.test(ch);
724
+ }
725
+ /** Checks whether a Unicode code point is punctuation or a symbol. */
726
+ function isPunctCharCode(code) {
727
+ return isPunctChar(fromCodePoint(code));
728
+ }
729
+ /**
730
+ * Markdown ASCII punctuation characters.
731
+ *
732
+ * !, ", #, $, %, &, ', (, ), *, +, ,, -, ., /, :, ;, <, =, >, ?, @,
733
+ * [, \, ], ^, _, `, {, |, }, or ~
734
+ *
735
+ * http://spec.commonmark.org/0.15/#ascii-punctuation-character
736
+ *
737
+ * Don't confuse with Unicode punctuation. It lacks some characters in the
738
+ * ASCII range.
739
+ */
740
+ function isMdAsciiPunct(ch) {
741
+ switch (ch) {
742
+ case 33:
743
+ case 34:
744
+ case 35:
745
+ case 36:
746
+ case 37:
747
+ case 38:
748
+ case 39:
749
+ case 40:
750
+ case 41:
751
+ case 42:
752
+ case 43:
753
+ case 44:
754
+ case 45:
755
+ case 46:
756
+ case 47:
757
+ case 58:
758
+ case 59:
759
+ case 60:
760
+ case 61:
761
+ case 62:
762
+ case 63:
763
+ case 64:
764
+ case 91:
765
+ case 92:
766
+ case 93:
767
+ case 94:
768
+ case 95:
769
+ case 96:
770
+ case 123:
771
+ case 124:
772
+ case 125:
773
+ case 126: return true;
774
+ default: return false;
775
+ }
776
+ }
777
+ /** Normalizes `[reference labels]` for case-insensitive lookup. */
778
+ function normalizeReference(str) {
779
+ str = str.trim().replace(/\s+/g, " ");
780
+ return str.toLowerCase().toUpperCase();
781
+ }
782
+ function isAsciiTrimmable(c) {
783
+ return c === 32 || c === 9 || c === 10 || c === 13;
784
+ }
785
+ /**
786
+ * "Light" `.trim()` for blocks (headings, paragraphs), where Unicode spaces
787
+ * should be preserved.
788
+ */
789
+ function asciiTrim(str) {
790
+ let start = 0;
791
+ for (; start < str.length; start++) if (!isAsciiTrimmable(str.charCodeAt(start))) break;
792
+ let end = str.length - 1;
793
+ for (; end >= start; end--) if (!isAsciiTrimmable(str.charCodeAt(end))) break;
794
+ return str.slice(start, end + 1);
795
+ }
796
+ /**
797
+ * Libraries commonly used by markdown-it and its plugins, re-exported to
798
+ * reduce duplicate dependencies in browser bundles.
799
+ */
800
+ var lib = {
801
+ mdurl,
802
+ ucmicro: uc_micro
803
+ };
804
+ //#endregion
805
+ //#region src/helpers/parse_link_label.ts
806
+ /** Finds the end of a link or image label (`[label]`). */
807
+ function parseLinkLabel(state, start, disableNested) {
808
+ let level, found, marker, prevPos;
809
+ const max = state.posMax;
810
+ const oldPos = state.pos;
811
+ state.pos = start + 1;
812
+ level = 1;
813
+ while (state.pos < max) {
814
+ marker = state.src.charCodeAt(state.pos);
815
+ if (marker === 93) {
816
+ level--;
817
+ if (level === 0) {
818
+ found = true;
819
+ break;
820
+ }
821
+ }
822
+ prevPos = state.pos;
823
+ state.md.inline.skipToken(state);
824
+ if (marker === 91) {
825
+ if (prevPos === state.pos - 1) level++;
826
+ else if (disableNested) {
827
+ state.pos = oldPos;
828
+ return -1;
829
+ }
830
+ }
831
+ }
832
+ let labelEnd = -1;
833
+ if (found) labelEnd = state.pos;
834
+ state.pos = oldPos;
835
+ return labelEnd;
836
+ }
837
+ //#endregion
838
+ //#region src/helpers/parse_link_destination.ts
839
+ /** Parses the destination in `[label](destination "title")`. */
840
+ function parseLinkDestination(str, start, max) {
841
+ let code;
842
+ let pos = start;
843
+ const result = {
844
+ ok: false,
845
+ pos: 0,
846
+ str: ""
847
+ };
848
+ if (str.charCodeAt(pos) === 60) {
849
+ pos++;
850
+ while (pos < max) {
851
+ code = str.charCodeAt(pos);
852
+ if (code === 10) return result;
853
+ if (code === 60) return result;
854
+ if (code === 62) {
855
+ result.pos = pos + 1;
856
+ result.str = unescapeAll(str.slice(start + 1, pos));
857
+ result.ok = true;
858
+ return result;
859
+ }
860
+ if (code === 92 && pos + 1 < max) {
861
+ pos += 2;
862
+ continue;
863
+ }
864
+ pos++;
865
+ }
866
+ return result;
867
+ }
868
+ let level = 0;
869
+ while (pos < max) {
870
+ code = str.charCodeAt(pos);
871
+ if (code === 32) break;
872
+ if (code < 32 || code === 127) break;
873
+ if (code === 92 && pos + 1 < max) {
874
+ if (str.charCodeAt(pos + 1) === 32) {
875
+ pos++;
876
+ continue;
877
+ }
878
+ pos += 2;
879
+ continue;
880
+ }
881
+ if (code === 40) {
882
+ level++;
883
+ if (level > 32) return result;
884
+ }
885
+ if (code === 41) {
886
+ if (level === 0) break;
887
+ level--;
888
+ }
889
+ pos++;
890
+ }
891
+ if (start === pos) return result;
892
+ if (level !== 0) return result;
893
+ result.str = unescapeAll(str.slice(start, pos));
894
+ result.pos = pos;
895
+ result.ok = true;
896
+ return result;
897
+ }
898
+ //#endregion
899
+ //#region src/helpers/parse_link_title.ts
900
+ /**
901
+ * Parses the optional title in `[label](destination "title")` or
902
+ * `[label]: destination "title"`.
903
+ *
904
+ * `prev_state` continues a reference title on the next source line.
905
+ */
906
+ function parseLinkTitle(str, start, max, prev_state) {
907
+ let code;
908
+ let pos = start;
909
+ const state = {
910
+ ok: false,
911
+ can_continue: false,
912
+ pos: 0,
913
+ str: "",
914
+ marker: 0
915
+ };
916
+ if (prev_state) {
917
+ state.str = prev_state.str;
918
+ state.marker = prev_state.marker;
919
+ } else {
920
+ if (pos >= max) return state;
921
+ let marker = str.charCodeAt(pos);
922
+ if (marker !== 34 && marker !== 39 && marker !== 40) return state;
923
+ start++;
924
+ pos++;
925
+ if (marker === 40) marker = 41;
926
+ state.marker = marker;
927
+ }
928
+ while (pos < max) {
929
+ code = str.charCodeAt(pos);
930
+ if (code === state.marker) {
931
+ state.pos = pos + 1;
932
+ state.str += unescapeAll(str.slice(start, pos));
933
+ state.ok = true;
934
+ return state;
935
+ } else if (code === 40 && state.marker === 41) return state;
936
+ else if (code === 92 && pos + 1 < max) pos++;
937
+ pos++;
938
+ }
939
+ state.can_continue = true;
940
+ state.str += unescapeAll(str.slice(start, pos));
941
+ return state;
942
+ }
943
+ //#endregion
944
+ //#region src/helpers/index.ts
945
+ /**
946
+ * Functions used to parse links and images, split out of parser rules because
947
+ * of their size.
948
+ *
949
+ * @module md.helpers
950
+ */
951
+ var helpers_exports = /* @__PURE__ */ __exportAll({
952
+ parseLinkDestination: () => parseLinkDestination,
953
+ parseLinkLabel: () => parseLinkLabel,
954
+ parseLinkTitle: () => parseLinkTitle
955
+ });
956
+ //#endregion
957
+ //#region src/token.ts
958
+ /**
959
+ * Represents one item in the parsed token stream, storing parsed data and
960
+ * providing helpers for managing HTML attributes.
961
+ */
962
+ var Token = class {
963
+ constructor(type, tag, nesting) {
964
+ _defineProperty(
965
+ this,
966
+ /**
967
+ * Source map info. Format: `[ line_begin, line_end ]`
968
+ */
969
+ "map",
970
+ null
971
+ );
972
+ _defineProperty(
973
+ this,
974
+ /**
975
+ * nesting level, the same as `state.level`
976
+ */
977
+ "level",
978
+ 0
979
+ );
980
+ _defineProperty(
981
+ this,
982
+ /**
983
+ * An array of child nodes (inline and img tokens)
984
+ */
985
+ "children",
986
+ null
987
+ );
988
+ _defineProperty(
989
+ this,
990
+ /**
991
+ * In a case of self-closing tag (code, html, fence, etc.),
992
+ * it has contents of this tag.
993
+ */
994
+ "content",
995
+ ""
996
+ );
997
+ _defineProperty(
998
+ this,
999
+ /**
1000
+ * '*' or '_' for emphasis, fence string for fence, etc.
1001
+ */
1002
+ "markup",
1003
+ ""
1004
+ );
1005
+ _defineProperty(
1006
+ this,
1007
+ /**
1008
+ * Additional information:
1009
+ *
1010
+ * - Info string for "fence" tokens
1011
+ * - The value "auto" for autolink "link_open" and "link_close" tokens
1012
+ * - The string value of the item marker for ordered-list "list_item_open" tokens
1013
+ */
1014
+ "info",
1015
+ ""
1016
+ );
1017
+ _defineProperty(
1018
+ this,
1019
+ /**
1020
+ * True for block-level tokens, false for inline tokens.
1021
+ * Used in renderer to calculate line breaks
1022
+ */
1023
+ "block",
1024
+ false
1025
+ );
1026
+ _defineProperty(
1027
+ this,
1028
+ /**
1029
+ * If it's true, ignore this element when rendering. Used for tight lists
1030
+ * to hide paragraphs.
1031
+ */
1032
+ "hidden",
1033
+ false
1034
+ );
1035
+ this.type = type;
1036
+ this.tag = tag;
1037
+ this.attrs = null;
1038
+ this.nesting = nesting;
1039
+ this.meta = null;
1040
+ }
1041
+ /**
1042
+ * Search attribute index by name.
1043
+ */
1044
+ attrIndex(name) {
1045
+ if (!this.attrs) return -1;
1046
+ const attrs = this.attrs;
1047
+ for (let i = 0, len = attrs.length; i < len; i++) if (attrs[i][0] === name) return i;
1048
+ return -1;
1049
+ }
1050
+ /**
1051
+ * Add `[ name, value ]` attribute to list. Init attrs if necessary
1052
+ */
1053
+ attrPush(attrData) {
1054
+ if (this.attrs) this.attrs.push(attrData);
1055
+ else this.attrs = [attrData];
1056
+ }
1057
+ /**
1058
+ * Set `name` attribute to `value`. Override old value if exists.
1059
+ */
1060
+ attrSet(name, value) {
1061
+ const idx = this.attrIndex(name);
1062
+ const attrData = [name, value];
1063
+ if (idx < 0) this.attrPush(attrData);
1064
+ else this.attrs[idx] = attrData;
1065
+ }
1066
+ /**
1067
+ * Get the value of attribute `name`, or null if it does not exist.
1068
+ */
1069
+ attrGet(name) {
1070
+ const idx = this.attrIndex(name);
1071
+ let value = null;
1072
+ if (idx >= 0) value = this.attrs[idx][1];
1073
+ return value;
1074
+ }
1075
+ /**
1076
+ * Join value to existing attribute via space. Or create new attribute if not
1077
+ * exists. Useful to operate with token classes.
1078
+ */
1079
+ attrJoin(name, value) {
1080
+ const idx = this.attrIndex(name);
1081
+ if (idx < 0) this.attrPush([name, value]);
1082
+ else this.attrs[idx][1] = `${this.attrs[idx][1]} ${value}`;
1083
+ }
1084
+ };
1085
+ //#endregion
1086
+ //#region src/ruler.ts
1087
+ /**
1088
+ * Helper class, used by {@link MarkdownIt.core}, {@link MarkdownIt.block} and
1089
+ * {@link MarkdownIt.inline} to manage sequences of functions (rules):
1090
+ *
1091
+ * - keep rules in defined order
1092
+ * - assign the name to each rule
1093
+ * - enable/disable rules
1094
+ * - add/replace rules
1095
+ * - allow assign rules to additional named chains (in the same)
1096
+ * - cacheing lists of active rules
1097
+ *
1098
+ * You will not need use this class directly until write plugins. For simple
1099
+ * rules control use {@link MarkdownIt.disable}, {@link MarkdownIt.enable} and
1100
+ * {@link MarkdownIt.use}.
1101
+ */
1102
+ var Ruler = class {
1103
+ constructor() {
1104
+ _defineProperty(this, "__rules__", []);
1105
+ _defineProperty(this, "__cache__", null);
1106
+ }
1107
+ __find__(name) {
1108
+ for (let i = 0; i < this.__rules__.length; i++) if (this.__rules__[i].name === name) return i;
1109
+ return -1;
1110
+ }
1111
+ __compile__() {
1112
+ const chains = /* @__PURE__ */ new Set();
1113
+ this.__rules__.forEach((rule) => {
1114
+ if (!rule.enabled) return;
1115
+ rule.alt.forEach((altName) => {
1116
+ if (altName) chains.add(altName);
1117
+ });
1118
+ });
1119
+ this.__cache__ = Object.create(null);
1120
+ this.__cache__[""] = [];
1121
+ this.__rules__.forEach((rule) => {
1122
+ if (rule.enabled) this.__cache__[""].push(rule.fn);
1123
+ });
1124
+ chains.forEach((chain) => {
1125
+ this.__cache__[chain] = [];
1126
+ this.__rules__.forEach((rule) => {
1127
+ if (rule.enabled && rule.alt.indexOf(chain) >= 0) this.__cache__[chain].push(rule.fn);
1128
+ });
1129
+ });
1130
+ }
1131
+ /**
1132
+ * Replace rule by name with new function & options. Throws error if name not
1133
+ * found.
1134
+ *
1135
+ * @param name Rule name to replace.
1136
+ * @param fn New rule function.
1137
+ * @param options Rule options. `alt` is an array with names of "alternate"
1138
+ * chains.
1139
+ *
1140
+ * @example Replace existing typographer replacement rule with new one
1141
+ * ```javascript
1142
+ * import MarkdownIt from 'markdown-it'
1143
+ * const md = new MarkdownIt()
1144
+ *
1145
+ * md.core.ruler.at('replacements', function replace(state) {
1146
+ * //...
1147
+ * });
1148
+ * ```
1149
+ */
1150
+ at(name, fn, options = {}) {
1151
+ const index = this.__find__(name);
1152
+ if (index === -1) throw new Error(`Parser rule not found: ${name}`);
1153
+ this.__rules__[index].fn = fn;
1154
+ this.__rules__[index].alt = options.alt || [];
1155
+ this.__cache__ = null;
1156
+ }
1157
+ /**
1158
+ * Add new rule to chain before one with given name. See also
1159
+ * {@link Ruler.after}, {@link Ruler.push}.
1160
+ *
1161
+ * @param beforeName New rule will be added before this one.
1162
+ * @param ruleName Name of added rule.
1163
+ * @param fn Rule function.
1164
+ * @param options Rule options. `alt` is an array with names of "alternate"
1165
+ * chains.
1166
+ *
1167
+ * @example
1168
+ * ```javascript
1169
+ * import MarkdownIt from 'markdown-it'
1170
+ * const md = new MarkdownIt()
1171
+ *
1172
+ * md.block.ruler.before('paragraph', 'my_rule', function replace(state) {
1173
+ * //...
1174
+ * });
1175
+ * ```
1176
+ */
1177
+ before(beforeName, ruleName, fn, options = {}) {
1178
+ const index = this.__find__(beforeName);
1179
+ if (index === -1) throw new Error(`Parser rule not found: ${beforeName}`);
1180
+ this.__rules__.splice(index, 0, {
1181
+ name: ruleName,
1182
+ enabled: true,
1183
+ fn,
1184
+ alt: options.alt || []
1185
+ });
1186
+ this.__cache__ = null;
1187
+ }
1188
+ /**
1189
+ * Add new rule to chain after one with given name. See also
1190
+ * {@link Ruler.before}, {@link Ruler.push}.
1191
+ *
1192
+ * @param afterName New rule will be added after this one.
1193
+ * @param ruleName Name of added rule.
1194
+ * @param fn Rule function.
1195
+ * @param options Rule options. `alt` is an array with names of "alternate"
1196
+ * chains.
1197
+ *
1198
+ * @example
1199
+ * ```javascript
1200
+ * import MarkdownIt from 'markdown-it'
1201
+ * const md = new MarkdownIt()
1202
+ *
1203
+ * md.inline.ruler.after('text', 'my_rule', function replace(state) {
1204
+ * //...
1205
+ * });
1206
+ * ```
1207
+ */
1208
+ after(afterName, ruleName, fn, options = {}) {
1209
+ const index = this.__find__(afterName);
1210
+ if (index === -1) throw new Error(`Parser rule not found: ${afterName}`);
1211
+ this.__rules__.splice(index + 1, 0, {
1212
+ name: ruleName,
1213
+ enabled: true,
1214
+ fn,
1215
+ alt: options.alt || []
1216
+ });
1217
+ this.__cache__ = null;
1218
+ }
1219
+ /**
1220
+ * Push new rule to the end of chain. See also
1221
+ * {@link Ruler.before}, {@link Ruler.after}.
1222
+ *
1223
+ * @param ruleName Name of added rule.
1224
+ * @param fn Rule function.
1225
+ * @param options Rule options. `alt` is an array with names of "alternate"
1226
+ * chains.
1227
+ *
1228
+ * @example
1229
+ * ```javascript
1230
+ * import MarkdownIt from 'markdown-it'
1231
+ * const md = new MarkdownIt()
1232
+ *
1233
+ * md.core.ruler.push('my_rule', function replace(state) {
1234
+ * //...
1235
+ * });
1236
+ * ```
1237
+ */
1238
+ push(ruleName, fn, options = {}) {
1239
+ this.__rules__.push({
1240
+ name: ruleName,
1241
+ enabled: true,
1242
+ fn,
1243
+ alt: options.alt || []
1244
+ });
1245
+ this.__cache__ = null;
1246
+ }
1247
+ /**
1248
+ * Enable rules with given names. If any rule name not found - throw Error.
1249
+ * Errors can be disabled by second param.
1250
+ *
1251
+ * See also {@link Ruler.disable}, {@link Ruler.enableOnly}.
1252
+ *
1253
+ * @param list List of rule names to enable.
1254
+ * @param ignoreInvalid Set `true` to ignore errors when rule not found.
1255
+ * @returns List of found rule names (if no exception happened).
1256
+ */
1257
+ enable(list, ignoreInvalid = false) {
1258
+ if (!Array.isArray(list)) list = [list];
1259
+ const result = [];
1260
+ list.forEach((name) => {
1261
+ const idx = this.__find__(name);
1262
+ if (idx < 0) {
1263
+ if (ignoreInvalid) return;
1264
+ throw new Error(`Rules manager: invalid rule name ${name}`);
1265
+ }
1266
+ this.__rules__[idx].enabled = true;
1267
+ result.push(name);
1268
+ });
1269
+ this.__cache__ = null;
1270
+ return result;
1271
+ }
1272
+ /**
1273
+ * Enable rules with given names, and disable everything else. If any rule name
1274
+ * not found - throw Error. Errors can be disabled by second param.
1275
+ *
1276
+ * See also {@link Ruler.disable}, {@link Ruler.enable}.
1277
+ *
1278
+ * @param list List of rule names to enable (whitelist).
1279
+ * @param ignoreInvalid Set `true` to ignore errors when rule not found.
1280
+ */
1281
+ enableOnly(list, ignoreInvalid = false) {
1282
+ if (!Array.isArray(list)) list = [list];
1283
+ this.__rules__.forEach((rule) => {
1284
+ rule.enabled = false;
1285
+ });
1286
+ this.enable(list, ignoreInvalid);
1287
+ }
1288
+ /**
1289
+ * Disable rules with given names. If any rule name not found - throw Error.
1290
+ * Errors can be disabled by second param.
1291
+ *
1292
+ * See also {@link Ruler.enable}, {@link Ruler.enableOnly}.
1293
+ *
1294
+ * @param list List of rule names to disable.
1295
+ * @param ignoreInvalid Set `true` to ignore errors when rule not found.
1296
+ * @returns List of found rule names (if no exception happened).
1297
+ */
1298
+ disable(list, ignoreInvalid = false) {
1299
+ if (!Array.isArray(list)) list = [list];
1300
+ const result = [];
1301
+ list.forEach((name) => {
1302
+ const idx = this.__find__(name);
1303
+ if (idx < 0) {
1304
+ if (ignoreInvalid) return;
1305
+ throw new Error(`Rules manager: invalid rule name ${name}`);
1306
+ }
1307
+ this.__rules__[idx].enabled = false;
1308
+ result.push(name);
1309
+ });
1310
+ this.__cache__ = null;
1311
+ return result;
1312
+ }
1313
+ /**
1314
+ * Return array of active functions (rules) for given chain name. It analyzes
1315
+ * rules configuration, compiles caches if not exists and returns result.
1316
+ *
1317
+ * Default chain name is `''` (empty string). It can't be skipped. That's
1318
+ * done intentionally, to keep signature monomorphic for high speed.
1319
+ */
1320
+ getRules(chainName) {
1321
+ if (!this.__cache__) this.__compile__();
1322
+ return this.__cache__[chainName] || [];
1323
+ }
1324
+ };
1325
+ //#endregion
1326
+ //#region src/renderer.ts
1327
+ var default_rules = {};
1328
+ default_rules.code_inline = function(tokens, idx, options, env, slf) {
1329
+ const token = tokens[idx];
1330
+ return `<code${slf.renderAttrs(token)}>${escapeHtml(token.content)}</code>`;
1331
+ };
1332
+ default_rules.code_block = function(tokens, idx, options, env, slf) {
1333
+ const token = tokens[idx];
1334
+ return `<pre${slf.renderAttrs(token)}><code>${escapeHtml(tokens[idx].content)}</code></pre>\n`;
1335
+ };
1336
+ default_rules.fence = function(tokens, idx, options, env, slf) {
1337
+ const token = tokens[idx];
1338
+ const info = token.info ? unescapeAll(token.info).trim() : "";
1339
+ let langName = "";
1340
+ let langAttrs = "";
1341
+ if (info) {
1342
+ const arr = info.split(/(\s+)/g);
1343
+ langName = arr[0];
1344
+ langAttrs = arr.slice(2).join("");
1345
+ }
1346
+ let highlighted;
1347
+ if (options.highlight) highlighted = options.highlight(token.content, langName, langAttrs) || escapeHtml(token.content);
1348
+ else highlighted = escapeHtml(token.content);
1349
+ if (highlighted.indexOf("<pre") === 0) return highlighted + "\n";
1350
+ if (info) {
1351
+ const i = token.attrIndex("class");
1352
+ const tmpAttrs = token.attrs ? token.attrs.slice() : [];
1353
+ if (i < 0) tmpAttrs.push(["class", `${options.langPrefix}${langName}`]);
1354
+ else {
1355
+ tmpAttrs[i] = [tmpAttrs[i][0], tmpAttrs[i][1]];
1356
+ tmpAttrs[i][1] += ` ${options.langPrefix}${langName}`;
1357
+ }
1358
+ const tmpToken = { attrs: tmpAttrs };
1359
+ return `<pre><code${slf.renderAttrs(tmpToken)}>${highlighted}</code></pre>\n`;
1360
+ }
1361
+ return `<pre><code${slf.renderAttrs(token)}>${highlighted}</code></pre>\n`;
1362
+ };
1363
+ default_rules.image = function(tokens, idx, options, env, slf) {
1364
+ const token = tokens[idx];
1365
+ token.attrs[token.attrIndex("alt")][1] = slf.renderInlineAsText(token.children, options, env);
1366
+ return slf.renderToken(tokens, idx, options);
1367
+ };
1368
+ default_rules.hardbreak = function(tokens, idx, options) {
1369
+ return options.xhtmlOut ? "<br />\n" : "<br>\n";
1370
+ };
1371
+ default_rules.softbreak = function(tokens, idx, options) {
1372
+ return options.breaks ? options.xhtmlOut ? "<br />\n" : "<br>\n" : "\n";
1373
+ };
1374
+ default_rules.text = function(tokens, idx) {
1375
+ return escapeHtml(tokens[idx].content);
1376
+ };
1377
+ default_rules.html_block = function(tokens, idx) {
1378
+ return tokens[idx].content;
1379
+ };
1380
+ default_rules.html_inline = function(tokens, idx) {
1381
+ return tokens[idx].content;
1382
+ };
1383
+ /**
1384
+ * Generates HTML from parsed token stream. Each instance has independent
1385
+ * copy of rules. Those can be rewritten with ease. Also, you can add new
1386
+ * rules if you create plugin and adds new token types.
1387
+ *
1388
+ * Creates new renderer instance and fills {@link Renderer.rules} with defaults.
1389
+ */
1390
+ var Renderer = class {
1391
+ constructor() {
1392
+ _defineProperty(
1393
+ this,
1394
+ /**
1395
+ * Contains render rules for tokens. Can be updated and extended.
1396
+ *
1397
+ * See [source code](https://github.com/markdown-it/markdown-it/blob/master/src/renderer.ts)
1398
+ * for more details and examples.
1399
+ *
1400
+ * @example Custom render rules
1401
+ * ```javascript
1402
+ * import MarkdownIt from 'markdown-it'
1403
+ * const md = new MarkdownIt()
1404
+ *
1405
+ * md.renderer.rules.strong_open = function () { return '<b>'; };
1406
+ * md.renderer.rules.strong_close = function () { return '</b>'; };
1407
+ *
1408
+ * const result = md.renderInline(...);
1409
+ * ```
1410
+ *
1411
+ * @example Each rule is called as independent static function with fixed signature
1412
+ * ```javascript
1413
+ * function my_token_render(tokens, idx, options, env, renderer) {
1414
+ * // ...
1415
+ * return renderedHTML;
1416
+ * }
1417
+ * ```
1418
+ */
1419
+ "rules",
1420
+ Object.assign({}, default_rules)
1421
+ );
1422
+ }
1423
+ /**
1424
+ * Render token attributes to string.
1425
+ */
1426
+ renderAttrs(token) {
1427
+ let i, l, result;
1428
+ if (!token.attrs) return "";
1429
+ result = "";
1430
+ for (i = 0, l = token.attrs.length; i < l; i++) result += ` ${escapeHtml(token.attrs[i][0])}="${escapeHtml(String(token.attrs[i][1]))}"`;
1431
+ return result;
1432
+ }
1433
+ /**
1434
+ * Default token renderer. Can be overriden by custom function
1435
+ * in {@link Renderer.rules}.
1436
+ *
1437
+ * @param tokens List of tokens.
1438
+ * @param idx Token index to render.
1439
+ * @param options Params of parser instance.
1440
+ */
1441
+ renderToken(tokens, idx, options) {
1442
+ const token = tokens[idx];
1443
+ let result = "";
1444
+ if (token.hidden) return "";
1445
+ let prev = idx - 1;
1446
+ while (prev >= 0 && tokens[prev].hidden && tokens[prev].nesting === 0) prev--;
1447
+ if (token.block && token.nesting !== -1 && prev >= 0 && tokens[prev].hidden && tokens[prev].nesting === -1) result += "\n";
1448
+ result += (token.nesting === -1 ? "</" : "<") + token.tag;
1449
+ result += this.renderAttrs(token);
1450
+ if (token.nesting === 0 && options.xhtmlOut) result += " /";
1451
+ let needLf = false;
1452
+ if (token.block) {
1453
+ needLf = true;
1454
+ if (token.nesting === 1) {
1455
+ let next = idx + 1;
1456
+ while (next < tokens.length && tokens[next].hidden && tokens[next].nesting === 0) next++;
1457
+ if (next < tokens.length) {
1458
+ const nextToken = tokens[next];
1459
+ if (nextToken.type === "inline" || nextToken.hidden) needLf = false;
1460
+ else if (nextToken.nesting === -1 && nextToken.tag === token.tag) needLf = false;
1461
+ }
1462
+ }
1463
+ }
1464
+ result += needLf ? ">\n" : ">";
1465
+ return result;
1466
+ }
1467
+ /**
1468
+ * The same as {@link Renderer.render}, but for single token of `inline` type.
1469
+ *
1470
+ * @param tokens List on block tokens to render.
1471
+ * @param options Params of parser instance.
1472
+ * @param env Additional data from parsed input (references, for example).
1473
+ */
1474
+ renderInline(tokens, options, env) {
1475
+ let result = "";
1476
+ const rules = this.rules;
1477
+ for (let i = 0, len = tokens.length; i < len; i++) {
1478
+ const type = tokens[i].type;
1479
+ if (typeof rules[type] !== "undefined") result += rules[type](tokens, i, options, env, this);
1480
+ else result += this.renderToken(tokens, i, options);
1481
+ }
1482
+ return result;
1483
+ }
1484
+ /**
1485
+ * Special kludge for image `alt` attributes to conform CommonMark spec.
1486
+ * Don't try to use it! Spec requires to show `alt` content with stripped markup,
1487
+ * instead of simple escaping.
1488
+ *
1489
+ * @param tokens List on block tokens to render.
1490
+ * @param options Params of parser instance.
1491
+ * @param env Additional data from parsed input (references, for example).
1492
+ */
1493
+ renderInlineAsText(tokens, options, env) {
1494
+ let result = "";
1495
+ for (let i = 0, len = tokens.length; i < len; i++) switch (tokens[i].type) {
1496
+ case "text":
1497
+ case "code_inline":
1498
+ result += tokens[i].content;
1499
+ break;
1500
+ case "image":
1501
+ result += this.renderInlineAsText(tokens[i].children, options, env);
1502
+ break;
1503
+ case "html_inline":
1504
+ case "html_block":
1505
+ result += tokens[i].content;
1506
+ break;
1507
+ case "softbreak":
1508
+ case "hardbreak": result += "\n";
1509
+ }
1510
+ return result;
1511
+ }
1512
+ /**
1513
+ * Takes token stream and generates HTML. Probably, you will never need to call
1514
+ * this method directly.
1515
+ *
1516
+ * @param tokens List on block tokens to render.
1517
+ * @param options Params of parser instance.
1518
+ * @param env Additional data from parsed input (references, for example).
1519
+ */
1520
+ render(tokens, options, env) {
1521
+ let result = "";
1522
+ const rules = this.rules;
1523
+ for (let i = 0, len = tokens.length; i < len; i++) {
1524
+ const type = tokens[i].type;
1525
+ if (type === "inline") result += this.renderInline(tokens[i].children, options, env);
1526
+ else if (typeof rules[type] !== "undefined") result += rules[type](tokens, i, options, env, this);
1527
+ else result += this.renderToken(tokens, i, options);
1528
+ }
1529
+ return result;
1530
+ }
1531
+ };
1532
+ //#endregion
1533
+ //#region src/rules_core/state_core.ts
1534
+ /** Mutable state passed through the core rules chain. */
1535
+ var StateCore = class {
1536
+ constructor(src, md, env) {
1537
+ _defineProperty(this, "tokens", []);
1538
+ _defineProperty(this, "inlineMode", false);
1539
+ _defineProperty(this, "Token", Token);
1540
+ this.src = src;
1541
+ this.env = env;
1542
+ this.md = md;
1543
+ }
1544
+ };
1545
+ //#endregion
1546
+ //#region src/rules_core/normalize.ts
1547
+ var NEWLINES_RE = /\r\n?|\n/g;
1548
+ var NULL_RE = /\0/g;
1549
+ function normalize(state) {
1550
+ let str;
1551
+ str = state.src.replace(NEWLINES_RE, "\n");
1552
+ str = str.replace(NULL_RE, "�");
1553
+ state.src = str;
1554
+ }
1555
+ //#endregion
1556
+ //#region src/rules_core/block.ts
1557
+ function block(state) {
1558
+ let token;
1559
+ if (state.inlineMode) {
1560
+ token = new state.Token("inline", "", 0);
1561
+ token.content = state.src;
1562
+ token.map = [0, 1];
1563
+ token.children = [];
1564
+ state.tokens.push(token);
1565
+ } else state.md.block.parse(state.src, state.md, state.env, state.tokens);
1566
+ }
1567
+ //#endregion
1568
+ //#region src/rules_core/strip_references.ts
1569
+ function strip_references(state) {
1570
+ const tokens = state.tokens;
1571
+ let last = 0;
1572
+ for (let curr = 0; curr < tokens.length; curr++) {
1573
+ if (tokens[curr].type === "reference_definition") continue;
1574
+ if (curr !== last) tokens[last] = tokens[curr];
1575
+ last++;
1576
+ }
1577
+ if (tokens.length !== last) tokens.length = last;
1578
+ }
1579
+ //#endregion
1580
+ //#region src/rules_core/inline.ts
1581
+ function inline(state) {
1582
+ const tokens = state.tokens;
1583
+ for (let i = 0, l = tokens.length; i < l; i++) {
1584
+ const tok = tokens[i];
1585
+ if (tok.type === "inline") state.md.inline.parse(tok.content, state.md, state.env, tok.children);
1586
+ }
1587
+ }
1588
+ //#endregion
1589
+ //#region src/rules_core/linkify.ts
1590
+ function isLinkOpen$1(str) {
1591
+ return /^<a[>\s]/i.test(str);
1592
+ }
1593
+ function isLinkClose$1(str) {
1594
+ return /^<\/a\s*>/i.test(str);
1595
+ }
1596
+ function linkify$1(state) {
1597
+ const blockTokens = state.tokens;
1598
+ if (!state.md.options.linkify) return;
1599
+ for (let j = 0, l = blockTokens.length; j < l; j++) {
1600
+ if (blockTokens[j].type !== "inline" || !state.md.linkify.test(blockTokens[j].content)) continue;
1601
+ let tokens = blockTokens[j].children;
1602
+ let htmlLinkLevel = 0;
1603
+ for (let i = tokens.length - 1; i >= 0; i--) {
1604
+ const currentToken = tokens[i];
1605
+ if (currentToken.type === "link_close") {
1606
+ i--;
1607
+ while (tokens[i].level !== currentToken.level && tokens[i].type !== "link_open") i--;
1608
+ continue;
1609
+ }
1610
+ if (currentToken.type === "html_inline") {
1611
+ if (isLinkOpen$1(currentToken.content) && htmlLinkLevel > 0) htmlLinkLevel--;
1612
+ if (isLinkClose$1(currentToken.content)) htmlLinkLevel++;
1613
+ }
1614
+ if (htmlLinkLevel > 0) continue;
1615
+ if (currentToken.type === "text" && state.md.linkify.test(currentToken.content)) {
1616
+ const text = currentToken.content;
1617
+ let links = state.md.linkify.match(text);
1618
+ const nodes = [];
1619
+ let level = currentToken.level;
1620
+ let lastPos = 0;
1621
+ if (links.length > 0 && links[0].index === 0 && i > 0 && tokens[i - 1].type === "text_special") links = links.slice(1);
1622
+ for (let ln = 0; ln < links.length; ln++) {
1623
+ const url = links[ln].url;
1624
+ const fullUrl = state.md.normalizeLink(url);
1625
+ if (!state.md.validateLink(fullUrl)) continue;
1626
+ let urlText = links[ln].text;
1627
+ if (!links[ln].schema) urlText = state.md.normalizeLinkText(`http://${urlText}`).replace(/^http:\/\//, "");
1628
+ else if (links[ln].schema === "mailto:" && !/^mailto:/i.test(urlText)) urlText = state.md.normalizeLinkText(`mailto:${urlText}`).replace(/^mailto:/, "");
1629
+ else urlText = state.md.normalizeLinkText(urlText);
1630
+ const pos = links[ln].index;
1631
+ if (pos > lastPos) {
1632
+ const token = new state.Token("text", "", 0);
1633
+ token.content = text.slice(lastPos, pos);
1634
+ token.level = level;
1635
+ nodes.push(token);
1636
+ }
1637
+ const token_o = new state.Token("link_open", "a", 1);
1638
+ token_o.attrs = [["href", fullUrl]];
1639
+ token_o.level = level++;
1640
+ token_o.markup = "linkify";
1641
+ token_o.info = "auto";
1642
+ nodes.push(token_o);
1643
+ const token_t = new state.Token("text", "", 0);
1644
+ token_t.content = urlText;
1645
+ token_t.level = level;
1646
+ nodes.push(token_t);
1647
+ const token_c = new state.Token("link_close", "a", -1);
1648
+ token_c.level = --level;
1649
+ token_c.markup = "linkify";
1650
+ token_c.info = "auto";
1651
+ nodes.push(token_c);
1652
+ lastPos = links[ln].lastIndex;
1653
+ }
1654
+ if (lastPos < text.length) {
1655
+ const token = new state.Token("text", "", 0);
1656
+ token.content = text.slice(lastPos);
1657
+ token.level = level;
1658
+ nodes.push(token);
1659
+ }
1660
+ blockTokens[j].children = tokens = arrayReplaceAt(tokens, i, nodes);
1661
+ }
1662
+ }
1663
+ }
1664
+ }
1665
+ //#endregion
1666
+ //#region src/rules_core/replacements.ts
1667
+ var RARE_RE = /\+-|\.\.|\?\?\?\?|!!!!|,,|--/;
1668
+ var SCOPED_ABBR_TEST_RE = /\((c|tm|r)\)/i;
1669
+ var SCOPED_ABBR_RE = /\((c|tm|r)\)/gi;
1670
+ var SCOPED_ABBR = {
1671
+ c: "©",
1672
+ r: "®",
1673
+ tm: "™"
1674
+ };
1675
+ function replaceFn(match, name) {
1676
+ return SCOPED_ABBR[name.toLowerCase()];
1677
+ }
1678
+ function replace_scoped(inlineTokens) {
1679
+ let inside_autolink = 0;
1680
+ for (let i = inlineTokens.length - 1; i >= 0; i--) {
1681
+ const token = inlineTokens[i];
1682
+ if (token.type === "text" && !inside_autolink) token.content = token.content.replace(SCOPED_ABBR_RE, replaceFn);
1683
+ if (token.type === "link_open" && token.info === "auto") inside_autolink--;
1684
+ if (token.type === "link_close" && token.info === "auto") inside_autolink++;
1685
+ }
1686
+ }
1687
+ function replace_rare(inlineTokens) {
1688
+ let inside_autolink = 0;
1689
+ for (let i = inlineTokens.length - 1; i >= 0; i--) {
1690
+ const token = inlineTokens[i];
1691
+ if (token.type === "text" && !inside_autolink) {
1692
+ if (RARE_RE.test(token.content)) token.content = token.content.replace(/\+-/g, "±").replace(/\.{2,}/g, "…").replace(/([?!])…/g, "$1..").replace(/([?!]){4,}/g, "$1$1$1").replace(/,{2,}/g, ",").replace(/(^|[^-])---(?=[^-]|$)/gm, "$1—").replace(/(^|\s)--(?=\s|$)/gm, "$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/gm, "$1–");
1693
+ }
1694
+ if (token.type === "link_open" && token.info === "auto") inside_autolink--;
1695
+ if (token.type === "link_close" && token.info === "auto") inside_autolink++;
1696
+ }
1697
+ }
1698
+ function replace(state) {
1699
+ let blkIdx;
1700
+ if (!state.md.options.typographer) return;
1701
+ for (blkIdx = state.tokens.length - 1; blkIdx >= 0; blkIdx--) {
1702
+ if (state.tokens[blkIdx].type !== "inline") continue;
1703
+ if (SCOPED_ABBR_TEST_RE.test(state.tokens[blkIdx].content)) replace_scoped(state.tokens[blkIdx].children);
1704
+ if (RARE_RE.test(state.tokens[blkIdx].content)) replace_rare(state.tokens[blkIdx].children);
1705
+ }
1706
+ }
1707
+ //#endregion
1708
+ //#region src/rules_core/smartquotes.ts
1709
+ var QUOTE_TEST_RE = /['"]/;
1710
+ var QUOTE_RE = /['"]/g;
1711
+ var APOSTROPHE = "’";
1712
+ function addReplacement(replacements, tokenIdx, pos, ch) {
1713
+ if (!replacements[tokenIdx]) replacements[tokenIdx] = [];
1714
+ replacements[tokenIdx].push({
1715
+ pos,
1716
+ ch
1717
+ });
1718
+ }
1719
+ function applyReplacements(str, replacements) {
1720
+ let result = "";
1721
+ let lastPos = 0;
1722
+ replacements.sort((a, b) => a.pos - b.pos);
1723
+ for (let i = 0; i < replacements.length; i++) {
1724
+ const replacement = replacements[i];
1725
+ result += str.slice(lastPos, replacement.pos) + replacement.ch;
1726
+ lastPos = replacement.pos + 1;
1727
+ }
1728
+ return result + str.slice(lastPos);
1729
+ }
1730
+ function process_inlines(tokens, state) {
1731
+ let j;
1732
+ const stack = [];
1733
+ const replacements = {};
1734
+ for (let i = 0; i < tokens.length; i++) {
1735
+ const token = tokens[i];
1736
+ const thisLevel = tokens[i].level;
1737
+ for (j = stack.length - 1; j >= 0; j--) if (stack[j].level <= thisLevel) break;
1738
+ stack.length = j + 1;
1739
+ if (token.type !== "text") continue;
1740
+ const text = token.content;
1741
+ let pos = 0;
1742
+ const max = text.length;
1743
+ OUTER: while (pos < max) {
1744
+ QUOTE_RE.lastIndex = pos;
1745
+ const t = QUOTE_RE.exec(text);
1746
+ if (!t) break;
1747
+ let canOpen = true;
1748
+ let canClose = true;
1749
+ pos = t.index + 1;
1750
+ const isSingle = t[0] === "'";
1751
+ let lastChar = 32;
1752
+ if (t.index - 1 >= 0) lastChar = text.charCodeAt(t.index - 1);
1753
+ else for (j = i - 1; j >= 0; j--) {
1754
+ if (tokens[j].type === "softbreak" || tokens[j].type === "hardbreak") break;
1755
+ if (!tokens[j].content) continue;
1756
+ lastChar = tokens[j].content.charCodeAt(tokens[j].content.length - 1);
1757
+ break;
1758
+ }
1759
+ let nextChar = 32;
1760
+ if (pos < max) nextChar = text.charCodeAt(pos);
1761
+ else for (j = i + 1; j < tokens.length; j++) {
1762
+ if (tokens[j].type === "softbreak" || tokens[j].type === "hardbreak") break;
1763
+ if (!tokens[j].content) continue;
1764
+ nextChar = tokens[j].content.charCodeAt(0);
1765
+ break;
1766
+ }
1767
+ const isLastPunctChar = isMdAsciiPunct(lastChar) || isPunctCharCode(lastChar);
1768
+ const isNextPunctChar = isMdAsciiPunct(nextChar) || isPunctCharCode(nextChar);
1769
+ const isLastWhiteSpace = isWhiteSpace(lastChar);
1770
+ const isNextWhiteSpace = isWhiteSpace(nextChar);
1771
+ if (isNextWhiteSpace) canOpen = false;
1772
+ else if (isNextPunctChar) {
1773
+ if (!(isLastWhiteSpace || isLastPunctChar)) canOpen = false;
1774
+ }
1775
+ if (isLastWhiteSpace) canClose = false;
1776
+ else if (isLastPunctChar) {
1777
+ if (!(isNextWhiteSpace || isNextPunctChar)) canClose = false;
1778
+ }
1779
+ if (nextChar === 34 && t[0] === "\"") {
1780
+ if (lastChar >= 48 && lastChar <= 57) canClose = canOpen = false;
1781
+ }
1782
+ if (canOpen && canClose) {
1783
+ canOpen = isLastPunctChar;
1784
+ canClose = isNextPunctChar;
1785
+ }
1786
+ if (!canOpen && !canClose) {
1787
+ if (isSingle) addReplacement(replacements, i, t.index, APOSTROPHE);
1788
+ continue;
1789
+ }
1790
+ if (canClose) for (j = stack.length - 1; j >= 0; j--) {
1791
+ let item = stack[j];
1792
+ if (stack[j].level < thisLevel) break;
1793
+ if (item.single === isSingle && stack[j].level === thisLevel) {
1794
+ item = stack[j];
1795
+ let openQuote;
1796
+ let closeQuote;
1797
+ if (isSingle) {
1798
+ openQuote = state.md.options.quotes[2];
1799
+ closeQuote = state.md.options.quotes[3];
1800
+ } else {
1801
+ openQuote = state.md.options.quotes[0];
1802
+ closeQuote = state.md.options.quotes[1];
1803
+ }
1804
+ addReplacement(replacements, i, t.index, closeQuote);
1805
+ addReplacement(replacements, item.token, item.pos, openQuote);
1806
+ stack.length = j;
1807
+ continue OUTER;
1808
+ }
1809
+ }
1810
+ if (canOpen) stack.push({
1811
+ token: i,
1812
+ pos: t.index,
1813
+ single: isSingle,
1814
+ level: thisLevel
1815
+ });
1816
+ else if (canClose && isSingle) addReplacement(replacements, i, t.index, APOSTROPHE);
1817
+ }
1818
+ }
1819
+ Object.keys(replacements).forEach(function(tokenIdx) {
1820
+ const idx = Number(tokenIdx);
1821
+ tokens[idx].content = applyReplacements(tokens[idx].content, replacements[tokenIdx]);
1822
+ });
1823
+ }
1824
+ function smartquotes(state) {
1825
+ if (!state.md.options.typographer) return;
1826
+ for (let blkIdx = state.tokens.length - 1; blkIdx >= 0; blkIdx--) {
1827
+ if (state.tokens[blkIdx].type !== "inline" || !QUOTE_TEST_RE.test(state.tokens[blkIdx].content)) continue;
1828
+ process_inlines(state.tokens[blkIdx].children, state);
1829
+ }
1830
+ }
1831
+ //#endregion
1832
+ //#region src/rules_core/text_join.ts
1833
+ function join_alt(tokens) {
1834
+ let curr, last;
1835
+ const max = tokens.length;
1836
+ for (curr = 0; curr < max; curr++) if (tokens[curr].type === "text_special") tokens[curr].type = "text";
1837
+ for (curr = last = 0; curr < max; curr++) if (tokens[curr].type === "text" && curr + 1 < max && tokens[curr + 1].type === "text") tokens[curr + 1].content = tokens[curr].content + tokens[curr + 1].content;
1838
+ else {
1839
+ if (curr !== last) tokens[last] = tokens[curr];
1840
+ last++;
1841
+ }
1842
+ if (curr !== last) tokens.length = last;
1843
+ }
1844
+ function text_join(state) {
1845
+ let curr, last;
1846
+ const blockTokens = state.tokens;
1847
+ const l = blockTokens.length;
1848
+ for (let j = 0; j < l; j++) {
1849
+ if (blockTokens[j].type !== "inline") continue;
1850
+ const tokens = blockTokens[j].children;
1851
+ const max = tokens.length;
1852
+ for (curr = 0; curr < max; curr++) {
1853
+ if (tokens[curr].type === "text_special") tokens[curr].type = "text";
1854
+ if (tokens[curr].children) join_alt(tokens[curr].children);
1855
+ }
1856
+ for (curr = last = 0; curr < max; curr++) if (tokens[curr].type === "text" && curr + 1 < max && tokens[curr + 1].type === "text") tokens[curr + 1].content = tokens[curr].content + tokens[curr + 1].content;
1857
+ else {
1858
+ if (curr !== last) tokens[last] = tokens[curr];
1859
+ last++;
1860
+ }
1861
+ if (curr !== last) tokens.length = last;
1862
+ }
1863
+ }
1864
+ //#endregion
1865
+ //#region src/parser_core.ts
1866
+ var _rules$2 = [
1867
+ ["normalize", normalize],
1868
+ ["block", block],
1869
+ ["strip_references", strip_references],
1870
+ ["inline", inline],
1871
+ ["linkify", linkify$1],
1872
+ ["replacements", replace],
1873
+ ["smartquotes", smartquotes],
1874
+ ["text_join", text_join]
1875
+ ];
1876
+ /**
1877
+ * Top-level rules executor. Glues block/inline parsers and does intermediate
1878
+ * transformations.
1879
+ */
1880
+ var ParserCore = class {
1881
+ constructor() {
1882
+ _defineProperty(
1883
+ this,
1884
+ /**
1885
+ * {@link Ruler} instance. Keep configuration of core rules.
1886
+ */
1887
+ "ruler",
1888
+ new Ruler()
1889
+ );
1890
+ _defineProperty(this, "State", StateCore);
1891
+ for (let i = 0; i < _rules$2.length; i++) this.ruler.push(_rules$2[i][0], _rules$2[i][1]);
1892
+ }
1893
+ /**
1894
+ * Executes core chain rules.
1895
+ */
1896
+ process(state) {
1897
+ const rules = this.ruler.getRules("");
1898
+ for (let i = 0, l = rules.length; i < l; i++) rules[i](state);
1899
+ }
1900
+ };
1901
+ //#endregion
1902
+ //#region src/rules_block/state_block.ts
1903
+ /** Mutable state passed to block rules while tokenizing a source document. */
1904
+ var StateBlock = class {
1905
+ constructor(src, md, env, tokens) {
1906
+ _defineProperty(this, "bMarks", []);
1907
+ _defineProperty(this, "eMarks", []);
1908
+ _defineProperty(this, "tShift", []);
1909
+ _defineProperty(this, "sCount", []);
1910
+ _defineProperty(this, "bsCount", []);
1911
+ _defineProperty(this, "blkIndent", 0);
1912
+ _defineProperty(this, "line", 0);
1913
+ _defineProperty(this, "lineMax", 0);
1914
+ _defineProperty(this, "tight", false);
1915
+ _defineProperty(this, "listIndent", -1);
1916
+ _defineProperty(this, "parentType", "root");
1917
+ _defineProperty(this, "level", 0);
1918
+ _defineProperty(this, "Token", Token);
1919
+ this.src = src;
1920
+ this.md = md;
1921
+ this.env = env;
1922
+ this.tokens = tokens;
1923
+ const s = this.src;
1924
+ for (let start = 0, pos = 0, indent = 0, offset = 0, len = s.length, indent_found = false; pos < len; pos++) {
1925
+ const ch = s.charCodeAt(pos);
1926
+ if (!indent_found) if (isSpace(ch)) {
1927
+ indent++;
1928
+ if (ch === 9) offset += 4 - offset % 4;
1929
+ else offset++;
1930
+ continue;
1931
+ } else indent_found = true;
1932
+ if (ch === 10 || pos === len - 1) {
1933
+ if (ch !== 10) pos++;
1934
+ this.bMarks.push(start);
1935
+ this.eMarks.push(pos);
1936
+ this.tShift.push(indent);
1937
+ this.sCount.push(offset);
1938
+ this.bsCount.push(0);
1939
+ indent_found = false;
1940
+ indent = 0;
1941
+ offset = 0;
1942
+ start = pos + 1;
1943
+ }
1944
+ }
1945
+ this.bMarks.push(s.length);
1946
+ this.eMarks.push(s.length);
1947
+ this.tShift.push(0);
1948
+ this.sCount.push(0);
1949
+ this.bsCount.push(0);
1950
+ this.lineMax = this.bMarks.length - 1;
1951
+ }
1952
+ push(type, tag, nesting) {
1953
+ const token = new Token(type, tag, nesting);
1954
+ token.block = true;
1955
+ if (nesting < 0) this.level--;
1956
+ token.level = this.level;
1957
+ if (nesting > 0) this.level++;
1958
+ this.tokens.push(token);
1959
+ return token;
1960
+ }
1961
+ isEmpty(line) {
1962
+ return this.bMarks[line] + this.tShift[line] >= this.eMarks[line];
1963
+ }
1964
+ skipEmptyLines(from) {
1965
+ for (let max = this.lineMax; from < max; from++) if (this.bMarks[from] + this.tShift[from] < this.eMarks[from]) break;
1966
+ return from;
1967
+ }
1968
+ skipSpaces(pos) {
1969
+ for (let max = this.src.length; pos < max; pos++) if (!isSpace(this.src.charCodeAt(pos))) break;
1970
+ return pos;
1971
+ }
1972
+ skipSpacesBack(pos, min) {
1973
+ if (pos <= min) return pos;
1974
+ while (pos > min) if (!isSpace(this.src.charCodeAt(--pos))) return pos + 1;
1975
+ return pos;
1976
+ }
1977
+ skipChars(pos, code) {
1978
+ for (let max = this.src.length; pos < max; pos++) if (this.src.charCodeAt(pos) !== code) break;
1979
+ return pos;
1980
+ }
1981
+ skipCharsBack(pos, code, min) {
1982
+ if (pos <= min) return pos;
1983
+ while (pos > min) if (code !== this.src.charCodeAt(--pos)) return pos + 1;
1984
+ return pos;
1985
+ }
1986
+ getLines(begin, end, indent, keepLastLF) {
1987
+ if (begin >= end) return "";
1988
+ const queue = new Array(end - begin);
1989
+ for (let i = 0, line = begin; line < end; line++, i++) {
1990
+ let lineIndent = 0;
1991
+ const lineStart = this.bMarks[line];
1992
+ let first = lineStart;
1993
+ let last;
1994
+ if (line + 1 < end || keepLastLF) last = this.eMarks[line] + 1;
1995
+ else last = this.eMarks[line];
1996
+ while (first < last && lineIndent < indent) {
1997
+ const ch = this.src.charCodeAt(first);
1998
+ if (isSpace(ch)) if (ch === 9) lineIndent += 4 - (lineIndent + this.bsCount[line]) % 4;
1999
+ else lineIndent++;
2000
+ else if (first - lineStart < this.tShift[line]) lineIndent++;
2001
+ else break;
2002
+ first++;
2003
+ }
2004
+ if (lineIndent > indent) queue[i] = new Array(lineIndent - indent + 1).join(" ") + this.src.slice(first, last);
2005
+ else queue[i] = this.src.slice(first, last);
2006
+ }
2007
+ return queue.join("");
2008
+ }
2009
+ };
2010
+ //#endregion
2011
+ //#region src/rules_block/table.ts
2012
+ var MAX_AUTOCOMPLETED_CELLS = 65536;
2013
+ function getLine(state, line) {
2014
+ const pos = state.bMarks[line] + state.tShift[line];
2015
+ const max = state.eMarks[line];
2016
+ return state.src.slice(pos, max);
2017
+ }
2018
+ function escapedSplit(str) {
2019
+ const result = [];
2020
+ const max = str.length;
2021
+ let pos = 0;
2022
+ let ch = str.charCodeAt(pos);
2023
+ let isEscaped = false;
2024
+ let lastPos = 0;
2025
+ let current = "";
2026
+ while (pos < max) {
2027
+ if (ch === 124) if (!isEscaped) {
2028
+ result.push(current + str.substring(lastPos, pos));
2029
+ current = "";
2030
+ lastPos = pos + 1;
2031
+ } else {
2032
+ current += str.substring(lastPos, pos - 1);
2033
+ lastPos = pos;
2034
+ }
2035
+ isEscaped = ch === 92;
2036
+ pos++;
2037
+ ch = str.charCodeAt(pos);
2038
+ }
2039
+ result.push(current + str.substring(lastPos));
2040
+ return result;
2041
+ }
2042
+ function table(state, startLine, endLine, silent) {
2043
+ if (startLine + 2 > endLine) return false;
2044
+ let nextLine = startLine + 1;
2045
+ if (state.sCount[nextLine] < state.blkIndent) return false;
2046
+ if (state.sCount[nextLine] - state.blkIndent >= 4) return false;
2047
+ let pos = state.bMarks[nextLine] + state.tShift[nextLine];
2048
+ if (pos >= state.eMarks[nextLine]) return false;
2049
+ const firstCh = state.src.charCodeAt(pos++);
2050
+ if (firstCh !== 124 && firstCh !== 45 && firstCh !== 58) return false;
2051
+ if (pos >= state.eMarks[nextLine]) return false;
2052
+ const secondCh = state.src.charCodeAt(pos++);
2053
+ if (secondCh !== 124 && secondCh !== 45 && secondCh !== 58 && !isSpace(secondCh)) return false;
2054
+ if (firstCh === 45 && isSpace(secondCh)) return false;
2055
+ while (pos < state.eMarks[nextLine]) {
2056
+ const ch = state.src.charCodeAt(pos);
2057
+ if (ch !== 124 && ch !== 45 && ch !== 58 && !isSpace(ch)) return false;
2058
+ pos++;
2059
+ }
2060
+ let lineText = getLine(state, startLine + 1);
2061
+ let columns = lineText.split("|");
2062
+ const aligns = [];
2063
+ for (let i = 0; i < columns.length; i++) {
2064
+ const t = columns[i].trim();
2065
+ if (!t) if (i === 0 || i === columns.length - 1) continue;
2066
+ else return false;
2067
+ if (!/^:?-+:?$/.test(t)) return false;
2068
+ if (t.charCodeAt(t.length - 1) === 58) aligns.push(t.charCodeAt(0) === 58 ? "center" : "right");
2069
+ else if (t.charCodeAt(0) === 58) aligns.push("left");
2070
+ else aligns.push("");
2071
+ }
2072
+ lineText = getLine(state, startLine).trim();
2073
+ if (lineText.indexOf("|") === -1) return false;
2074
+ if (state.sCount[startLine] - state.blkIndent >= 4) return false;
2075
+ columns = escapedSplit(lineText);
2076
+ if (columns.length && columns[0] === "") columns.shift();
2077
+ if (columns.length && columns[columns.length - 1] === "") columns.pop();
2078
+ const columnCount = columns.length;
2079
+ if (columnCount === 0 || columnCount !== aligns.length) return false;
2080
+ if (silent) return true;
2081
+ const oldParentType = state.parentType;
2082
+ state.parentType = "table";
2083
+ const terminatorRules = state.md.block.ruler.getRules("blockquote");
2084
+ const token_to = state.push("table_open", "table", 1);
2085
+ const tableLines = [startLine, 0];
2086
+ token_to.map = tableLines;
2087
+ const token_tho = state.push("thead_open", "thead", 1);
2088
+ token_tho.map = [startLine, startLine + 1];
2089
+ const token_htro = state.push("tr_open", "tr", 1);
2090
+ token_htro.map = [startLine, startLine + 1];
2091
+ for (let i = 0; i < columns.length; i++) {
2092
+ const token_ho = state.push("th_open", "th", 1);
2093
+ if (aligns[i]) token_ho.attrs = [["style", `text-align:${aligns[i]}`]];
2094
+ const token_il = state.push("inline", "", 0);
2095
+ token_il.content = columns[i].trim();
2096
+ token_il.children = [];
2097
+ state.push("th_close", "th", -1);
2098
+ }
2099
+ state.push("tr_close", "tr", -1);
2100
+ state.push("thead_close", "thead", -1);
2101
+ let tbodyLines;
2102
+ let autocompletedCells = 0;
2103
+ for (nextLine = startLine + 2; nextLine < endLine; nextLine++) {
2104
+ if (state.sCount[nextLine] < state.blkIndent) break;
2105
+ let terminate = false;
2106
+ for (let i = 0, l = terminatorRules.length; i < l; i++) if (terminatorRules[i](state, nextLine, endLine, true)) {
2107
+ terminate = true;
2108
+ break;
2109
+ }
2110
+ if (terminate) break;
2111
+ lineText = getLine(state, nextLine).trim();
2112
+ if (!lineText) break;
2113
+ if (state.sCount[nextLine] - state.blkIndent >= 4) break;
2114
+ columns = escapedSplit(lineText);
2115
+ if (columns.length && columns[0] === "") columns.shift();
2116
+ if (columns.length && columns[columns.length - 1] === "") columns.pop();
2117
+ autocompletedCells += columnCount - columns.length;
2118
+ if (autocompletedCells > MAX_AUTOCOMPLETED_CELLS) break;
2119
+ if (nextLine === startLine + 2) {
2120
+ const token_tbo = state.push("tbody_open", "tbody", 1);
2121
+ token_tbo.map = tbodyLines = [startLine + 2, 0];
2122
+ }
2123
+ const token_tro = state.push("tr_open", "tr", 1);
2124
+ token_tro.map = [nextLine, nextLine + 1];
2125
+ for (let i = 0; i < columnCount; i++) {
2126
+ const token_tdo = state.push("td_open", "td", 1);
2127
+ if (aligns[i]) token_tdo.attrs = [["style", `text-align:${aligns[i]}`]];
2128
+ const token_il = state.push("inline", "", 0);
2129
+ token_il.content = columns[i] ? columns[i].trim() : "";
2130
+ token_il.children = [];
2131
+ state.push("td_close", "td", -1);
2132
+ }
2133
+ state.push("tr_close", "tr", -1);
2134
+ }
2135
+ if (tbodyLines) {
2136
+ state.push("tbody_close", "tbody", -1);
2137
+ tbodyLines[1] = nextLine;
2138
+ }
2139
+ state.push("table_close", "table", -1);
2140
+ tableLines[1] = nextLine;
2141
+ state.parentType = oldParentType;
2142
+ state.line = nextLine;
2143
+ return true;
2144
+ }
2145
+ //#endregion
2146
+ //#region src/rules_block/code.ts
2147
+ function code(state, startLine, endLine) {
2148
+ if (state.sCount[startLine] - state.blkIndent < 4) return false;
2149
+ let nextLine = startLine + 1;
2150
+ let last = nextLine;
2151
+ while (nextLine < endLine) {
2152
+ if (state.isEmpty(nextLine)) {
2153
+ nextLine++;
2154
+ continue;
2155
+ }
2156
+ if (state.sCount[nextLine] - state.blkIndent >= 4) {
2157
+ nextLine++;
2158
+ last = nextLine;
2159
+ continue;
2160
+ }
2161
+ break;
2162
+ }
2163
+ state.line = last;
2164
+ const token = state.push("code_block", "code", 0);
2165
+ token.content = state.getLines(startLine, last, 4 + state.blkIndent, false) + "\n";
2166
+ token.map = [startLine, state.line];
2167
+ return true;
2168
+ }
2169
+ //#endregion
2170
+ //#region src/rules_block/fence.ts
2171
+ function fence(state, startLine, endLine, silent) {
2172
+ let pos = state.bMarks[startLine] + state.tShift[startLine];
2173
+ let max = state.eMarks[startLine];
2174
+ if (state.sCount[startLine] - state.blkIndent >= 4) return false;
2175
+ if (pos + 3 > max) return false;
2176
+ const marker = state.src.charCodeAt(pos);
2177
+ if (marker !== 126 && marker !== 96) return false;
2178
+ let mem = pos;
2179
+ pos = state.skipChars(pos, marker);
2180
+ let len = pos - mem;
2181
+ if (len < 3) return false;
2182
+ const markup = state.src.slice(mem, pos);
2183
+ const params = state.src.slice(pos, max);
2184
+ if (marker === 96) {
2185
+ if (params.indexOf(String.fromCharCode(marker)) >= 0) return false;
2186
+ }
2187
+ if (silent) return true;
2188
+ let nextLine = startLine;
2189
+ let haveEndMarker = false;
2190
+ for (;;) {
2191
+ nextLine++;
2192
+ if (nextLine >= endLine) break;
2193
+ pos = mem = state.bMarks[nextLine] + state.tShift[nextLine];
2194
+ max = state.eMarks[nextLine];
2195
+ if (pos < max && state.sCount[nextLine] < state.blkIndent) break;
2196
+ if (state.src.charCodeAt(pos) !== marker) continue;
2197
+ if (state.sCount[nextLine] - state.blkIndent >= 4) continue;
2198
+ pos = state.skipChars(pos, marker);
2199
+ if (pos - mem < len) continue;
2200
+ pos = state.skipSpaces(pos);
2201
+ if (pos < max) continue;
2202
+ haveEndMarker = true;
2203
+ break;
2204
+ }
2205
+ len = state.sCount[startLine];
2206
+ state.line = nextLine + (haveEndMarker ? 1 : 0);
2207
+ const token = state.push("fence", "code", 0);
2208
+ token.info = params;
2209
+ token.content = state.getLines(startLine + 1, nextLine, len, true);
2210
+ token.markup = markup;
2211
+ token.map = [startLine, state.line];
2212
+ return true;
2213
+ }
2214
+ //#endregion
2215
+ //#region src/rules_block/blockquote.ts
2216
+ function blockquote(state, startLine, endLine, silent) {
2217
+ let pos = state.bMarks[startLine] + state.tShift[startLine];
2218
+ let max = state.eMarks[startLine];
2219
+ const oldLineMax = state.lineMax;
2220
+ if (state.sCount[startLine] - state.blkIndent >= 4) return false;
2221
+ if (state.src.charCodeAt(pos) !== 62) return false;
2222
+ if (silent) return true;
2223
+ const oldBMarks = [];
2224
+ const oldBSCount = [];
2225
+ const oldSCount = [];
2226
+ const oldTShift = [];
2227
+ const terminatorRules = state.md.block.ruler.getRules("blockquote");
2228
+ const oldParentType = state.parentType;
2229
+ state.parentType = "blockquote";
2230
+ let lastLineEmpty = false;
2231
+ let nextLine;
2232
+ for (nextLine = startLine; nextLine < endLine; nextLine++) {
2233
+ const isOutdented = state.sCount[nextLine] < state.blkIndent;
2234
+ pos = state.bMarks[nextLine] + state.tShift[nextLine];
2235
+ max = state.eMarks[nextLine];
2236
+ if (pos >= max) break;
2237
+ if (state.src.charCodeAt(pos++) === 62 && !isOutdented) {
2238
+ let initial = state.sCount[nextLine] + 1;
2239
+ let spaceAfterMarker;
2240
+ let adjustTab;
2241
+ if (state.src.charCodeAt(pos) === 32) {
2242
+ pos++;
2243
+ initial++;
2244
+ adjustTab = false;
2245
+ spaceAfterMarker = true;
2246
+ } else if (state.src.charCodeAt(pos) === 9) {
2247
+ spaceAfterMarker = true;
2248
+ if ((state.bsCount[nextLine] + initial) % 4 === 3) {
2249
+ pos++;
2250
+ initial++;
2251
+ adjustTab = false;
2252
+ } else adjustTab = true;
2253
+ } else spaceAfterMarker = false;
2254
+ let offset = initial;
2255
+ oldBMarks.push(state.bMarks[nextLine]);
2256
+ state.bMarks[nextLine] = pos;
2257
+ while (pos < max) {
2258
+ const ch = state.src.charCodeAt(pos);
2259
+ if (isSpace(ch)) if (ch === 9) offset += 4 - (offset + state.bsCount[nextLine] + (adjustTab ? 1 : 0)) % 4;
2260
+ else offset++;
2261
+ else break;
2262
+ pos++;
2263
+ }
2264
+ lastLineEmpty = pos >= max;
2265
+ oldBSCount.push(state.bsCount[nextLine]);
2266
+ state.bsCount[nextLine] = state.sCount[nextLine] + 1 + (spaceAfterMarker ? 1 : 0);
2267
+ oldSCount.push(state.sCount[nextLine]);
2268
+ state.sCount[nextLine] = offset - initial;
2269
+ oldTShift.push(state.tShift[nextLine]);
2270
+ state.tShift[nextLine] = pos - state.bMarks[nextLine];
2271
+ continue;
2272
+ }
2273
+ if (lastLineEmpty) break;
2274
+ let terminate = false;
2275
+ for (let i = 0, l = terminatorRules.length; i < l; i++) if (terminatorRules[i](state, nextLine, endLine, true)) {
2276
+ terminate = true;
2277
+ break;
2278
+ }
2279
+ if (terminate) {
2280
+ state.lineMax = nextLine;
2281
+ if (state.blkIndent !== 0) {
2282
+ oldBMarks.push(state.bMarks[nextLine]);
2283
+ oldBSCount.push(state.bsCount[nextLine]);
2284
+ oldTShift.push(state.tShift[nextLine]);
2285
+ oldSCount.push(state.sCount[nextLine]);
2286
+ state.sCount[nextLine] -= state.blkIndent;
2287
+ }
2288
+ break;
2289
+ }
2290
+ oldBMarks.push(state.bMarks[nextLine]);
2291
+ oldBSCount.push(state.bsCount[nextLine]);
2292
+ oldTShift.push(state.tShift[nextLine]);
2293
+ oldSCount.push(state.sCount[nextLine]);
2294
+ state.sCount[nextLine] = -1;
2295
+ }
2296
+ const oldIndent = state.blkIndent;
2297
+ state.blkIndent = 0;
2298
+ const token_o = state.push("blockquote_open", "blockquote", 1);
2299
+ token_o.markup = ">";
2300
+ const lines = [startLine, 0];
2301
+ token_o.map = lines;
2302
+ state.md.block.tokenize(state, startLine, nextLine);
2303
+ const token_c = state.push("blockquote_close", "blockquote", -1);
2304
+ token_c.markup = ">";
2305
+ state.lineMax = oldLineMax;
2306
+ state.parentType = oldParentType;
2307
+ lines[1] = state.line;
2308
+ for (let i = 0; i < oldTShift.length; i++) {
2309
+ state.bMarks[i + startLine] = oldBMarks[i];
2310
+ state.tShift[i + startLine] = oldTShift[i];
2311
+ state.sCount[i + startLine] = oldSCount[i];
2312
+ state.bsCount[i + startLine] = oldBSCount[i];
2313
+ }
2314
+ state.blkIndent = oldIndent;
2315
+ return true;
2316
+ }
2317
+ //#endregion
2318
+ //#region src/rules_block/hr.ts
2319
+ function hr(state, startLine, endLine, silent) {
2320
+ const max = state.eMarks[startLine];
2321
+ if (state.sCount[startLine] - state.blkIndent >= 4) return false;
2322
+ let pos = state.bMarks[startLine] + state.tShift[startLine];
2323
+ const marker = state.src.charCodeAt(pos++);
2324
+ if (marker !== 42 && marker !== 45 && marker !== 95) return false;
2325
+ let cnt = 1;
2326
+ while (pos < max) {
2327
+ const ch = state.src.charCodeAt(pos++);
2328
+ if (ch !== marker && !isSpace(ch)) return false;
2329
+ if (ch === marker) cnt++;
2330
+ }
2331
+ if (cnt < 3) return false;
2332
+ if (silent) return true;
2333
+ state.line = startLine + 1;
2334
+ const token = state.push("hr", "hr", 0);
2335
+ token.map = [startLine, state.line];
2336
+ token.markup = Array(cnt + 1).join(String.fromCharCode(marker));
2337
+ return true;
2338
+ }
2339
+ //#endregion
2340
+ //#region src/rules_block/list.ts
2341
+ function skipBulletListMarker(state, startLine) {
2342
+ const max = state.eMarks[startLine];
2343
+ let pos = state.bMarks[startLine] + state.tShift[startLine];
2344
+ const marker = state.src.charCodeAt(pos++);
2345
+ if (marker !== 42 && marker !== 45 && marker !== 43) return -1;
2346
+ if (pos < max) {
2347
+ if (!isSpace(state.src.charCodeAt(pos))) return -1;
2348
+ }
2349
+ return pos;
2350
+ }
2351
+ function skipOrderedListMarker(state, startLine) {
2352
+ const start = state.bMarks[startLine] + state.tShift[startLine];
2353
+ const max = state.eMarks[startLine];
2354
+ let pos = start;
2355
+ if (pos + 1 >= max) return -1;
2356
+ let ch = state.src.charCodeAt(pos++);
2357
+ if (ch < 48 || ch > 57) return -1;
2358
+ for (;;) {
2359
+ if (pos >= max) return -1;
2360
+ ch = state.src.charCodeAt(pos++);
2361
+ if (ch >= 48 && ch <= 57) {
2362
+ if (pos - start >= 10) return -1;
2363
+ continue;
2364
+ }
2365
+ if (ch === 41 || ch === 46) break;
2366
+ return -1;
2367
+ }
2368
+ if (pos < max) {
2369
+ ch = state.src.charCodeAt(pos);
2370
+ if (!isSpace(ch)) return -1;
2371
+ }
2372
+ return pos;
2373
+ }
2374
+ function markTightParagraphs(state, idx) {
2375
+ const level = state.level + 2;
2376
+ for (let i = idx + 2, l = state.tokens.length - 2; i < l; i++) if (state.tokens[i].level === level && state.tokens[i].type === "paragraph_open") {
2377
+ state.tokens[i + 2].hidden = true;
2378
+ state.tokens[i].hidden = true;
2379
+ i += 2;
2380
+ }
2381
+ }
2382
+ function list(state, startLine, endLine, silent) {
2383
+ let max, pos, start, token;
2384
+ let nextLine = startLine;
2385
+ let tight = true;
2386
+ if (state.sCount[nextLine] - state.blkIndent >= 4) return false;
2387
+ if (state.listIndent >= 0 && state.sCount[nextLine] - state.listIndent >= 4 && state.sCount[nextLine] < state.blkIndent) return false;
2388
+ let isTerminatingParagraph = false;
2389
+ if (silent && state.parentType === "paragraph") {
2390
+ if (state.sCount[nextLine] >= state.blkIndent) isTerminatingParagraph = true;
2391
+ }
2392
+ let isOrdered;
2393
+ let markerValue;
2394
+ let posAfterMarker;
2395
+ if ((posAfterMarker = skipOrderedListMarker(state, nextLine)) >= 0) {
2396
+ isOrdered = true;
2397
+ start = state.bMarks[nextLine] + state.tShift[nextLine];
2398
+ markerValue = Number(state.src.slice(start, posAfterMarker - 1));
2399
+ if (isTerminatingParagraph && markerValue !== 1) return false;
2400
+ } else if ((posAfterMarker = skipBulletListMarker(state, nextLine)) >= 0) isOrdered = false;
2401
+ else return false;
2402
+ if (isTerminatingParagraph) {
2403
+ if (state.skipSpaces(posAfterMarker) >= state.eMarks[nextLine]) return false;
2404
+ }
2405
+ if (silent) return true;
2406
+ const markerCharCode = state.src.charCodeAt(posAfterMarker - 1);
2407
+ const listTokIdx = state.tokens.length;
2408
+ if (isOrdered) {
2409
+ token = state.push("ordered_list_open", "ol", 1);
2410
+ if (markerValue !== 1) token.attrs = [["start", markerValue]];
2411
+ } else token = state.push("bullet_list_open", "ul", 1);
2412
+ const listLines = [nextLine, 0];
2413
+ token.map = listLines;
2414
+ token.markup = String.fromCharCode(markerCharCode);
2415
+ let prevEmptyEnd = false;
2416
+ const terminatorRules = state.md.block.ruler.getRules("list");
2417
+ const oldParentType = state.parentType;
2418
+ state.parentType = "list";
2419
+ while (nextLine < endLine) {
2420
+ pos = posAfterMarker;
2421
+ max = state.eMarks[nextLine];
2422
+ const initial = state.sCount[nextLine] + posAfterMarker - (state.bMarks[nextLine] + state.tShift[nextLine]);
2423
+ let offset = initial;
2424
+ while (pos < max) {
2425
+ const ch = state.src.charCodeAt(pos);
2426
+ if (ch === 9) offset += 4 - (offset + state.bsCount[nextLine]) % 4;
2427
+ else if (ch === 32) offset++;
2428
+ else break;
2429
+ pos++;
2430
+ }
2431
+ const contentStart = pos;
2432
+ let indentAfterMarker;
2433
+ if (contentStart >= max) indentAfterMarker = 1;
2434
+ else indentAfterMarker = offset - initial;
2435
+ if (indentAfterMarker > 4) indentAfterMarker = 1;
2436
+ const indent = initial + indentAfterMarker;
2437
+ token = state.push("list_item_open", "li", 1);
2438
+ token.markup = String.fromCharCode(markerCharCode);
2439
+ const itemLines = [nextLine, 0];
2440
+ token.map = itemLines;
2441
+ if (isOrdered) token.info = state.src.slice(start, posAfterMarker - 1);
2442
+ const oldTight = state.tight;
2443
+ const oldTShift = state.tShift[nextLine];
2444
+ const oldSCount = state.sCount[nextLine];
2445
+ const oldListIndent = state.listIndent;
2446
+ state.listIndent = state.blkIndent;
2447
+ state.blkIndent = indent;
2448
+ state.tight = true;
2449
+ state.tShift[nextLine] = contentStart - state.bMarks[nextLine];
2450
+ state.sCount[nextLine] = offset;
2451
+ if (contentStart >= max && state.isEmpty(nextLine + 1)) state.line = Math.min(state.line + 2, endLine);
2452
+ else state.md.block.tokenize(state, nextLine, endLine);
2453
+ if (!state.tight || prevEmptyEnd) tight = false;
2454
+ prevEmptyEnd = state.line - nextLine > 1 && state.isEmpty(state.line - 1);
2455
+ state.blkIndent = state.listIndent;
2456
+ state.listIndent = oldListIndent;
2457
+ state.tShift[nextLine] = oldTShift;
2458
+ state.sCount[nextLine] = oldSCount;
2459
+ state.tight = oldTight;
2460
+ token = state.push("list_item_close", "li", -1);
2461
+ token.markup = String.fromCharCode(markerCharCode);
2462
+ nextLine = state.line;
2463
+ itemLines[1] = nextLine;
2464
+ if (nextLine >= endLine) break;
2465
+ if (state.sCount[nextLine] < state.blkIndent) break;
2466
+ if (state.sCount[nextLine] - state.blkIndent >= 4) break;
2467
+ let terminate = false;
2468
+ for (let i = 0, l = terminatorRules.length; i < l; i++) if (terminatorRules[i](state, nextLine, endLine, true)) {
2469
+ terminate = true;
2470
+ break;
2471
+ }
2472
+ if (terminate) break;
2473
+ if (isOrdered) {
2474
+ posAfterMarker = skipOrderedListMarker(state, nextLine);
2475
+ if (posAfterMarker < 0) break;
2476
+ start = state.bMarks[nextLine] + state.tShift[nextLine];
2477
+ } else {
2478
+ posAfterMarker = skipBulletListMarker(state, nextLine);
2479
+ if (posAfterMarker < 0) break;
2480
+ }
2481
+ if (markerCharCode !== state.src.charCodeAt(posAfterMarker - 1)) break;
2482
+ }
2483
+ if (isOrdered) token = state.push("ordered_list_close", "ol", -1);
2484
+ else token = state.push("bullet_list_close", "ul", -1);
2485
+ token.markup = String.fromCharCode(markerCharCode);
2486
+ listLines[1] = nextLine;
2487
+ state.line = nextLine;
2488
+ state.parentType = oldParentType;
2489
+ if (tight) markTightParagraphs(state, listTokIdx);
2490
+ return true;
2491
+ }
2492
+ //#endregion
2493
+ //#region src/rules_block/reference.ts
2494
+ function reference(state, startLine, _endLine, silent) {
2495
+ let pos = state.bMarks[startLine] + state.tShift[startLine];
2496
+ let max = state.eMarks[startLine];
2497
+ let nextLine = startLine + 1;
2498
+ if (state.sCount[startLine] - state.blkIndent >= 4) return false;
2499
+ if (state.src.charCodeAt(pos) !== 91) return false;
2500
+ function getNextLine(nextLine) {
2501
+ const endLine = state.lineMax;
2502
+ if (nextLine >= endLine || state.isEmpty(nextLine)) return null;
2503
+ let isContinuation = false;
2504
+ if (state.sCount[nextLine] - state.blkIndent > 3) isContinuation = true;
2505
+ if (state.sCount[nextLine] < 0) isContinuation = true;
2506
+ if (!isContinuation) {
2507
+ const terminatorRules = state.md.block.ruler.getRules("reference");
2508
+ const oldParentType = state.parentType;
2509
+ state.parentType = "reference";
2510
+ let terminate = false;
2511
+ for (let i = 0, l = terminatorRules.length; i < l; i++) if (terminatorRules[i](state, nextLine, endLine, true)) {
2512
+ terminate = true;
2513
+ break;
2514
+ }
2515
+ state.parentType = oldParentType;
2516
+ if (terminate) return null;
2517
+ }
2518
+ const pos = state.bMarks[nextLine] + state.tShift[nextLine];
2519
+ const max = state.eMarks[nextLine];
2520
+ return state.src.slice(pos, max + 1);
2521
+ }
2522
+ let str = state.src.slice(pos, max + 1);
2523
+ max = str.length;
2524
+ let labelEnd = -1;
2525
+ for (pos = 1; pos < max; pos++) {
2526
+ const ch = str.charCodeAt(pos);
2527
+ if (ch === 91) return false;
2528
+ else if (ch === 93) {
2529
+ labelEnd = pos;
2530
+ break;
2531
+ } else if (ch === 10) {
2532
+ const lineContent = getNextLine(nextLine);
2533
+ if (lineContent !== null) {
2534
+ str += lineContent;
2535
+ max = str.length;
2536
+ nextLine++;
2537
+ }
2538
+ } else if (ch === 92) {
2539
+ pos++;
2540
+ if (pos < max && str.charCodeAt(pos) === 10) {
2541
+ const lineContent = getNextLine(nextLine);
2542
+ if (lineContent !== null) {
2543
+ str += lineContent;
2544
+ max = str.length;
2545
+ nextLine++;
2546
+ }
2547
+ }
2548
+ }
2549
+ }
2550
+ if (labelEnd < 0 || str.charCodeAt(labelEnd + 1) !== 58) return false;
2551
+ for (pos = labelEnd + 2; pos < max; pos++) {
2552
+ const ch = str.charCodeAt(pos);
2553
+ if (ch === 10) {
2554
+ const lineContent = getNextLine(nextLine);
2555
+ if (lineContent !== null) {
2556
+ str += lineContent;
2557
+ max = str.length;
2558
+ nextLine++;
2559
+ }
2560
+ } else if (isSpace(ch)) {} else break;
2561
+ }
2562
+ const destRes = state.md.helpers.parseLinkDestination(str, pos, max);
2563
+ if (!destRes.ok) return false;
2564
+ const href = state.md.normalizeLink(destRes.str);
2565
+ if (!state.md.validateLink(href)) return false;
2566
+ pos = destRes.pos;
2567
+ const destEndPos = pos;
2568
+ const destEndLineNo = nextLine;
2569
+ const start = pos;
2570
+ for (; pos < max; pos++) {
2571
+ const ch = str.charCodeAt(pos);
2572
+ if (ch === 10) {
2573
+ const lineContent = getNextLine(nextLine);
2574
+ if (lineContent !== null) {
2575
+ str += lineContent;
2576
+ max = str.length;
2577
+ nextLine++;
2578
+ }
2579
+ } else if (isSpace(ch)) {} else break;
2580
+ }
2581
+ let titleRes = state.md.helpers.parseLinkTitle(str, pos, max);
2582
+ while (titleRes.can_continue) {
2583
+ const lineContent = getNextLine(nextLine);
2584
+ if (lineContent === null) break;
2585
+ str += lineContent;
2586
+ pos = max;
2587
+ max = str.length;
2588
+ nextLine++;
2589
+ titleRes = state.md.helpers.parseLinkTitle(str, pos, max, titleRes);
2590
+ }
2591
+ let title;
2592
+ if (pos < max && start !== pos && titleRes.ok) {
2593
+ title = titleRes.str;
2594
+ pos = titleRes.pos;
2595
+ } else {
2596
+ title = "";
2597
+ pos = destEndPos;
2598
+ nextLine = destEndLineNo;
2599
+ }
2600
+ while (pos < max) {
2601
+ if (!isSpace(str.charCodeAt(pos))) break;
2602
+ pos++;
2603
+ }
2604
+ if (pos < max && str.charCodeAt(pos) !== 10) {
2605
+ if (title) {
2606
+ title = "";
2607
+ pos = destEndPos;
2608
+ nextLine = destEndLineNo;
2609
+ while (pos < max) {
2610
+ if (!isSpace(str.charCodeAt(pos))) break;
2611
+ pos++;
2612
+ }
2613
+ }
2614
+ }
2615
+ if (pos < max && str.charCodeAt(pos) !== 10) return false;
2616
+ const label = normalizeReference(str.slice(1, labelEnd));
2617
+ if (!label) return false;
2618
+ /* istanbul ignore if */
2619
+ if (silent) return true;
2620
+ if (typeof state.env.references === "undefined") state.env.references = {};
2621
+ if (typeof state.env.references[label] === "undefined") state.env.references[label] = {
2622
+ title,
2623
+ href
2624
+ };
2625
+ const token = state.push("reference_definition", "", 0);
2626
+ token.map = [startLine, nextLine];
2627
+ token.hidden = true;
2628
+ const meta = Object.create(null);
2629
+ meta.label = label;
2630
+ token.meta = meta;
2631
+ state.line = nextLine;
2632
+ return true;
2633
+ }
2634
+ //#endregion
2635
+ //#region src/common/html_blocks.ts
2636
+ var html_blocks_default = [
2637
+ "address",
2638
+ "article",
2639
+ "aside",
2640
+ "base",
2641
+ "basefont",
2642
+ "blockquote",
2643
+ "body",
2644
+ "caption",
2645
+ "center",
2646
+ "col",
2647
+ "colgroup",
2648
+ "dd",
2649
+ "details",
2650
+ "dialog",
2651
+ "dir",
2652
+ "div",
2653
+ "dl",
2654
+ "dt",
2655
+ "fieldset",
2656
+ "figcaption",
2657
+ "figure",
2658
+ "footer",
2659
+ "form",
2660
+ "frame",
2661
+ "frameset",
2662
+ "h1",
2663
+ "h2",
2664
+ "h3",
2665
+ "h4",
2666
+ "h5",
2667
+ "h6",
2668
+ "head",
2669
+ "header",
2670
+ "hr",
2671
+ "html",
2672
+ "iframe",
2673
+ "legend",
2674
+ "li",
2675
+ "link",
2676
+ "main",
2677
+ "menu",
2678
+ "menuitem",
2679
+ "nav",
2680
+ "noframes",
2681
+ "ol",
2682
+ "optgroup",
2683
+ "option",
2684
+ "p",
2685
+ "param",
2686
+ "search",
2687
+ "section",
2688
+ "summary",
2689
+ "table",
2690
+ "tbody",
2691
+ "td",
2692
+ "tfoot",
2693
+ "th",
2694
+ "thead",
2695
+ "title",
2696
+ "tr",
2697
+ "track",
2698
+ "ul"
2699
+ ];
2700
+ //#endregion
2701
+ //#region src/common/html_re.ts
2702
+ var open_tag = `<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^"'=<>\`\\x00-\\x20]+|'[^']*'|"[^"]*"))?)*\\s*\\/?>`;
2703
+ var close_tag = "<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>";
2704
+ var HTML_TAG_RE = new RegExp(`^(?:${open_tag}|${close_tag}|<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->|<[?][\\s\\S]*?[?]>|<![A-Za-z][^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)`);
2705
+ var HTML_OPEN_CLOSE_TAG_RE = new RegExp(`^(?:${open_tag}|${close_tag})`);
2706
+ //#endregion
2707
+ //#region src/rules_block/html_block.ts
2708
+ var HTML_SEQUENCES = [
2709
+ [
2710
+ /^<(script|pre|style|textarea)(?=(\s|>|$))/i,
2711
+ /<\/(script|pre|style|textarea)>/i,
2712
+ true
2713
+ ],
2714
+ [
2715
+ /^<!--/,
2716
+ /-->/,
2717
+ true
2718
+ ],
2719
+ [
2720
+ /^<\?/,
2721
+ /\?>/,
2722
+ true
2723
+ ],
2724
+ [
2725
+ /^<![A-Za-z]/,
2726
+ />/,
2727
+ true
2728
+ ],
2729
+ [
2730
+ /^<!\[CDATA\[/,
2731
+ /\]\]>/,
2732
+ true
2733
+ ],
2734
+ [
2735
+ new RegExp(`^</?(${html_blocks_default.join("|")})(?=(\\s|/?>|$))`, "i"),
2736
+ /^$/,
2737
+ true
2738
+ ],
2739
+ [
2740
+ new RegExp(`${HTML_OPEN_CLOSE_TAG_RE.source}\\s*$`),
2741
+ /^$/,
2742
+ false
2743
+ ]
2744
+ ];
2745
+ function html_block(state, startLine, endLine, silent) {
2746
+ let pos = state.bMarks[startLine] + state.tShift[startLine];
2747
+ let max = state.eMarks[startLine];
2748
+ if (state.sCount[startLine] - state.blkIndent >= 4) return false;
2749
+ if (!state.md.options.html) return false;
2750
+ if (state.src.charCodeAt(pos) !== 60) return false;
2751
+ let lineText = state.src.slice(pos, max);
2752
+ let i = 0;
2753
+ for (; i < HTML_SEQUENCES.length; i++) if (HTML_SEQUENCES[i][0].test(lineText)) break;
2754
+ if (i === HTML_SEQUENCES.length) return false;
2755
+ if (silent) return HTML_SEQUENCES[i][2];
2756
+ let nextLine = startLine + 1;
2757
+ const endsOnBlankLine = HTML_SEQUENCES[i][1].test("");
2758
+ if (!HTML_SEQUENCES[i][1].test(lineText)) for (; nextLine < endLine; nextLine++) {
2759
+ if (state.sCount[nextLine] < state.blkIndent) {
2760
+ if (endsOnBlankLine || !state.isEmpty(nextLine)) break;
2761
+ }
2762
+ pos = state.bMarks[nextLine] + state.tShift[nextLine];
2763
+ max = state.eMarks[nextLine];
2764
+ lineText = state.src.slice(pos, max);
2765
+ if (HTML_SEQUENCES[i][1].test(lineText)) {
2766
+ if (lineText.length !== 0) nextLine++;
2767
+ break;
2768
+ }
2769
+ }
2770
+ state.line = nextLine;
2771
+ const token = state.push("html_block", "", 0);
2772
+ token.map = [startLine, nextLine];
2773
+ token.content = state.getLines(startLine, nextLine, state.blkIndent, true);
2774
+ return true;
2775
+ }
2776
+ //#endregion
2777
+ //#region src/rules_block/heading.ts
2778
+ function heading(state, startLine, endLine, silent) {
2779
+ let pos = state.bMarks[startLine] + state.tShift[startLine];
2780
+ let max = state.eMarks[startLine];
2781
+ if (state.sCount[startLine] - state.blkIndent >= 4) return false;
2782
+ let ch = state.src.charCodeAt(pos);
2783
+ if (ch !== 35 || pos >= max) return false;
2784
+ let level = 1;
2785
+ ch = state.src.charCodeAt(++pos);
2786
+ while (ch === 35 && pos < max && level <= 6) {
2787
+ level++;
2788
+ ch = state.src.charCodeAt(++pos);
2789
+ }
2790
+ if (level > 6 || pos < max && !isSpace(ch)) return false;
2791
+ if (silent) return true;
2792
+ max = state.skipSpacesBack(max, pos);
2793
+ const tmp = state.skipCharsBack(max, 35, pos);
2794
+ if (tmp > pos && isSpace(state.src.charCodeAt(tmp - 1))) max = tmp;
2795
+ state.line = startLine + 1;
2796
+ const token_o = state.push("heading_open", `h${level}`, 1);
2797
+ token_o.markup = "########".slice(0, level);
2798
+ token_o.map = [startLine, state.line];
2799
+ const token_i = state.push("inline", "", 0);
2800
+ token_i.content = asciiTrim(state.src.slice(pos, max));
2801
+ token_i.map = [startLine, state.line];
2802
+ token_i.children = [];
2803
+ const token_c = state.push("heading_close", `h${level}`, -1);
2804
+ token_c.markup = "########".slice(0, level);
2805
+ return true;
2806
+ }
2807
+ //#endregion
2808
+ //#region src/rules_block/lheading.ts
2809
+ function lheading(state, startLine, endLine) {
2810
+ const terminatorRules = state.md.block.ruler.getRules("paragraph");
2811
+ if (state.sCount[startLine] - state.blkIndent >= 4) return false;
2812
+ const oldParentType = state.parentType;
2813
+ state.parentType = "paragraph";
2814
+ let level = 0;
2815
+ let marker;
2816
+ let nextLine = startLine + 1;
2817
+ for (; nextLine < endLine && !state.isEmpty(nextLine); nextLine++) {
2818
+ if (state.sCount[nextLine] - state.blkIndent > 3) continue;
2819
+ if (state.sCount[nextLine] >= state.blkIndent) {
2820
+ let pos = state.bMarks[nextLine] + state.tShift[nextLine];
2821
+ const max = state.eMarks[nextLine];
2822
+ if (pos < max) {
2823
+ marker = state.src.charCodeAt(pos);
2824
+ if (marker === 45 || marker === 61) {
2825
+ pos = state.skipChars(pos, marker);
2826
+ pos = state.skipSpaces(pos);
2827
+ if (pos >= max) {
2828
+ level = marker === 61 ? 1 : 2;
2829
+ break;
2830
+ }
2831
+ }
2832
+ }
2833
+ }
2834
+ if (state.sCount[nextLine] < 0) continue;
2835
+ let terminate = false;
2836
+ for (let i = 0, l = terminatorRules.length; i < l; i++) if (terminatorRules[i](state, nextLine, endLine, true)) {
2837
+ terminate = true;
2838
+ break;
2839
+ }
2840
+ if (terminate) break;
2841
+ }
2842
+ if (!level) {
2843
+ state.parentType = oldParentType;
2844
+ return false;
2845
+ }
2846
+ const content = asciiTrim(state.getLines(startLine, nextLine, state.blkIndent, false));
2847
+ state.line = nextLine + 1;
2848
+ const token_o = state.push("heading_open", `h${level}`, 1);
2849
+ token_o.markup = String.fromCharCode(marker);
2850
+ token_o.map = [startLine, state.line];
2851
+ const token_i = state.push("inline", "", 0);
2852
+ token_i.content = content;
2853
+ token_i.map = [startLine, state.line - 1];
2854
+ token_i.children = [];
2855
+ const token_c = state.push("heading_close", `h${level}`, -1);
2856
+ token_c.markup = String.fromCharCode(marker);
2857
+ state.parentType = oldParentType;
2858
+ return true;
2859
+ }
2860
+ //#endregion
2861
+ //#region src/rules_block/paragraph.ts
2862
+ function paragraph(state, startLine, endLine) {
2863
+ const terminatorRules = state.md.block.ruler.getRules("paragraph");
2864
+ const oldParentType = state.parentType;
2865
+ let nextLine = startLine + 1;
2866
+ state.parentType = "paragraph";
2867
+ for (; nextLine < endLine && !state.isEmpty(nextLine); nextLine++) {
2868
+ if (state.sCount[nextLine] - state.blkIndent > 3) continue;
2869
+ if (state.sCount[nextLine] < 0) continue;
2870
+ let terminate = false;
2871
+ for (let i = 0, l = terminatorRules.length; i < l; i++) if (terminatorRules[i](state, nextLine, endLine, true)) {
2872
+ terminate = true;
2873
+ break;
2874
+ }
2875
+ if (terminate) break;
2876
+ }
2877
+ const content = asciiTrim(state.getLines(startLine, nextLine, state.blkIndent, false));
2878
+ state.line = nextLine;
2879
+ const token_o = state.push("paragraph_open", "p", 1);
2880
+ token_o.map = [startLine, state.line];
2881
+ const token_i = state.push("inline", "", 0);
2882
+ token_i.content = content;
2883
+ token_i.map = [startLine, state.line];
2884
+ token_i.children = [];
2885
+ state.push("paragraph_close", "p", -1);
2886
+ state.parentType = oldParentType;
2887
+ return true;
2888
+ }
2889
+ //#endregion
2890
+ //#region src/parser_block.ts
2891
+ var _rules$1 = [
2892
+ [
2893
+ "table",
2894
+ table,
2895
+ ["paragraph", "reference"]
2896
+ ],
2897
+ ["code", code],
2898
+ [
2899
+ "fence",
2900
+ fence,
2901
+ [
2902
+ "paragraph",
2903
+ "reference",
2904
+ "blockquote",
2905
+ "list"
2906
+ ]
2907
+ ],
2908
+ [
2909
+ "blockquote",
2910
+ blockquote,
2911
+ [
2912
+ "paragraph",
2913
+ "reference",
2914
+ "blockquote",
2915
+ "list"
2916
+ ]
2917
+ ],
2918
+ [
2919
+ "hr",
2920
+ hr,
2921
+ [
2922
+ "paragraph",
2923
+ "reference",
2924
+ "blockquote",
2925
+ "list"
2926
+ ]
2927
+ ],
2928
+ [
2929
+ "list",
2930
+ list,
2931
+ [
2932
+ "paragraph",
2933
+ "reference",
2934
+ "blockquote"
2935
+ ]
2936
+ ],
2937
+ ["reference", reference],
2938
+ [
2939
+ "html_block",
2940
+ html_block,
2941
+ [
2942
+ "paragraph",
2943
+ "reference",
2944
+ "blockquote"
2945
+ ]
2946
+ ],
2947
+ [
2948
+ "heading",
2949
+ heading,
2950
+ [
2951
+ "paragraph",
2952
+ "reference",
2953
+ "blockquote"
2954
+ ]
2955
+ ],
2956
+ ["lheading", lheading],
2957
+ ["paragraph", paragraph]
2958
+ ];
2959
+ /**
2960
+ * Block-level tokenizer.
2961
+ */
2962
+ var ParserBlock = class {
2963
+ constructor() {
2964
+ _defineProperty(
2965
+ this,
2966
+ /**
2967
+ * {@link Ruler} instance. Keep configuration of block rules.
2968
+ */
2969
+ "ruler",
2970
+ new Ruler()
2971
+ );
2972
+ _defineProperty(this, "State", StateBlock);
2973
+ for (let i = 0; i < _rules$1.length; i++) this.ruler.push(_rules$1[i][0], _rules$1[i][1], { alt: (_rules$1[i][2] || []).slice() });
2974
+ }
2975
+ tokenize(state, startLine, endLine) {
2976
+ const rules = this.ruler.getRules("");
2977
+ const len = rules.length;
2978
+ const maxNesting = state.md.options.maxNesting;
2979
+ let line = startLine;
2980
+ let hasEmptyLines = false;
2981
+ while (line < endLine) {
2982
+ state.line = line = state.skipEmptyLines(line);
2983
+ if (line >= endLine) break;
2984
+ if (state.sCount[line] < state.blkIndent) break;
2985
+ if (state.level >= maxNesting) {
2986
+ state.line = endLine;
2987
+ break;
2988
+ }
2989
+ const prevLine = state.line;
2990
+ let ok = false;
2991
+ for (let i = 0; i < len; i++) {
2992
+ ok = rules[i](state, line, endLine, false);
2993
+ if (ok) {
2994
+ if (prevLine >= state.line) throw new Error("block rule didn't increment state.line");
2995
+ break;
2996
+ }
2997
+ }
2998
+ if (!ok) throw new Error("none of the block rules matched");
2999
+ state.tight = !hasEmptyLines;
3000
+ if (state.isEmpty(state.line - 1)) hasEmptyLines = true;
3001
+ line = state.line;
3002
+ if (line < endLine && state.isEmpty(line)) {
3003
+ hasEmptyLines = true;
3004
+ line++;
3005
+ state.line = line;
3006
+ }
3007
+ }
3008
+ }
3009
+ /**
3010
+ * Process input string and push block tokens into `outTokens`
3011
+ */
3012
+ parse(src, md, env, outTokens) {
3013
+ if (!src) return;
3014
+ const state = new this.State(src, md, env, outTokens);
3015
+ this.tokenize(state, state.line, state.lineMax);
3016
+ }
3017
+ };
3018
+ //#endregion
3019
+ //#region src/rules_inline/state_inline.ts
3020
+ /** Mutable state passed to inline rules while tokenizing inline content. */
3021
+ var StateInline = class {
3022
+ constructor(src, md, env, outTokens) {
3023
+ _defineProperty(this, "pos", 0);
3024
+ _defineProperty(this, "level", 0);
3025
+ _defineProperty(this, "pending", "");
3026
+ _defineProperty(this, "pendingLevel", 0);
3027
+ _defineProperty(this, "cache", {});
3028
+ _defineProperty(this, "backticks", {});
3029
+ _defineProperty(this, "backticksScanned", false);
3030
+ _defineProperty(this, "linkLevel", 0);
3031
+ _defineProperty(this, "delimiters", []);
3032
+ _defineProperty(this, "_prev_delimiters", []);
3033
+ _defineProperty(this, "Token", Token);
3034
+ this.src = src;
3035
+ this.env = env;
3036
+ this.md = md;
3037
+ this.tokens = outTokens;
3038
+ this.tokens_meta = Array(outTokens.length);
3039
+ this.posMax = this.src.length;
3040
+ }
3041
+ pushPending() {
3042
+ const token = new Token("text", "", 0);
3043
+ token.content = this.pending;
3044
+ token.level = this.pendingLevel;
3045
+ this.tokens.push(token);
3046
+ this.pending = "";
3047
+ return token;
3048
+ }
3049
+ push(type, tag, nesting) {
3050
+ if (this.pending) this.pushPending();
3051
+ const token = new Token(type, tag, nesting);
3052
+ let token_meta = void 0;
3053
+ if (nesting < 0) {
3054
+ this.level--;
3055
+ this.delimiters = this._prev_delimiters.pop();
3056
+ }
3057
+ token.level = this.level;
3058
+ if (nesting > 0) {
3059
+ this.level++;
3060
+ this._prev_delimiters.push(this.delimiters);
3061
+ this.delimiters = [];
3062
+ token_meta = { delimiters: this.delimiters };
3063
+ }
3064
+ this.pendingLevel = this.level;
3065
+ this.tokens.push(token);
3066
+ this.tokens_meta.push(token_meta);
3067
+ return token;
3068
+ }
3069
+ scanDelims(start, canSplitWord) {
3070
+ const max = this.posMax;
3071
+ const marker = this.src.charCodeAt(start);
3072
+ let lastChar;
3073
+ if (start === 0) lastChar = 32;
3074
+ else if (start === 1) {
3075
+ lastChar = this.src.charCodeAt(0);
3076
+ if ((lastChar & 63488) === 55296) lastChar = 65533;
3077
+ } else {
3078
+ lastChar = this.src.charCodeAt(start - 1);
3079
+ if ((lastChar & 64512) === 56320) {
3080
+ const highSurr = this.src.charCodeAt(start - 2);
3081
+ lastChar = (highSurr & 64512) === 55296 ? 65536 + (highSurr - 55296 << 10) + (lastChar - 56320) : 65533;
3082
+ } else if ((lastChar & 64512) === 55296) lastChar = 65533;
3083
+ }
3084
+ let pos = start;
3085
+ while (pos < max && this.src.charCodeAt(pos) === marker) pos++;
3086
+ const count = pos - start;
3087
+ let nextChar = pos < max ? this.src.charCodeAt(pos) : 32;
3088
+ if ((nextChar & 64512) === 55296) {
3089
+ const lowSurr = this.src.charCodeAt(pos + 1);
3090
+ nextChar = (lowSurr & 64512) === 56320 ? 65536 + (nextChar - 55296 << 10) + (lowSurr - 56320) : 65533;
3091
+ } else if ((nextChar & 64512) === 56320) nextChar = 65533;
3092
+ const isLastPunctChar = isMdAsciiPunct(lastChar) || isPunctCharCode(lastChar);
3093
+ const isNextPunctChar = isMdAsciiPunct(nextChar) || isPunctCharCode(nextChar);
3094
+ const isLastWhiteSpace = isWhiteSpace(lastChar);
3095
+ const isNextWhiteSpace = isWhiteSpace(nextChar);
3096
+ const left_flanking = !isNextWhiteSpace && (!isNextPunctChar || isLastWhiteSpace || isLastPunctChar);
3097
+ const right_flanking = !isLastWhiteSpace && (!isLastPunctChar || isNextWhiteSpace || isNextPunctChar);
3098
+ return {
3099
+ can_open: left_flanking && (canSplitWord || !right_flanking || isLastPunctChar),
3100
+ can_close: right_flanking && (canSplitWord || !left_flanking || isNextPunctChar),
3101
+ length: count
3102
+ };
3103
+ }
3104
+ };
3105
+ //#endregion
3106
+ //#region src/rules_inline/text.ts
3107
+ function isTerminatorChar(ch) {
3108
+ switch (ch) {
3109
+ case 10:
3110
+ case 33:
3111
+ case 35:
3112
+ case 36:
3113
+ case 37:
3114
+ case 38:
3115
+ case 42:
3116
+ case 43:
3117
+ case 45:
3118
+ case 58:
3119
+ case 60:
3120
+ case 61:
3121
+ case 62:
3122
+ case 64:
3123
+ case 91:
3124
+ case 92:
3125
+ case 93:
3126
+ case 94:
3127
+ case 95:
3128
+ case 96:
3129
+ case 123:
3130
+ case 125:
3131
+ case 126: return true;
3132
+ default: return false;
3133
+ }
3134
+ }
3135
+ function text(state, silent) {
3136
+ let pos = state.pos;
3137
+ while (pos < state.posMax && !isTerminatorChar(state.src.charCodeAt(pos))) pos++;
3138
+ if (pos === state.pos) return false;
3139
+ if (!silent) state.pending += state.src.slice(state.pos, pos);
3140
+ state.pos = pos;
3141
+ return true;
3142
+ }
3143
+ //#endregion
3144
+ //#region src/rules_inline/linkify.ts
3145
+ var SCHEME_RE = /(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i;
3146
+ function linkify(state, silent) {
3147
+ if (!state.md.options.linkify) return false;
3148
+ if (state.linkLevel > 0) return false;
3149
+ const pos = state.pos;
3150
+ const max = state.posMax;
3151
+ if (pos + 3 > max) return false;
3152
+ if (state.src.charCodeAt(pos) !== 58) return false;
3153
+ if (state.src.charCodeAt(pos + 1) !== 47) return false;
3154
+ if (state.src.charCodeAt(pos + 2) !== 47) return false;
3155
+ const match = state.pending.match(SCHEME_RE);
3156
+ if (!match) return false;
3157
+ const proto = match[1];
3158
+ const link = state.md.linkify.matchAtStart(state.src.slice(pos - proto.length));
3159
+ if (!link) return false;
3160
+ let url = link.url;
3161
+ if (url.length <= proto.length) return false;
3162
+ let urlEnd = url.length;
3163
+ while (urlEnd > 0 && url.charCodeAt(urlEnd - 1) === 42) urlEnd--;
3164
+ if (urlEnd !== url.length) url = url.slice(0, urlEnd);
3165
+ const fullUrl = state.md.normalizeLink(url);
3166
+ if (!state.md.validateLink(fullUrl)) return false;
3167
+ if (!silent) {
3168
+ state.pending = state.pending.slice(0, -proto.length);
3169
+ const token_o = state.push("link_open", "a", 1);
3170
+ token_o.attrs = [["href", fullUrl]];
3171
+ token_o.markup = "linkify";
3172
+ token_o.info = "auto";
3173
+ const token_t = state.push("text", "", 0);
3174
+ token_t.content = state.md.normalizeLinkText(url);
3175
+ const token_c = state.push("link_close", "a", -1);
3176
+ token_c.markup = "linkify";
3177
+ token_c.info = "auto";
3178
+ }
3179
+ state.pos += url.length - proto.length;
3180
+ return true;
3181
+ }
3182
+ //#endregion
3183
+ //#region src/rules_inline/newline.ts
3184
+ function newline(state, silent) {
3185
+ let pos = state.pos;
3186
+ if (state.src.charCodeAt(pos) !== 10) return false;
3187
+ const pmax = state.pending.length - 1;
3188
+ const max = state.posMax;
3189
+ if (!silent) if (pmax >= 0 && state.pending.charCodeAt(pmax) === 32) if (pmax >= 1 && state.pending.charCodeAt(pmax - 1) === 32) {
3190
+ let ws = pmax - 1;
3191
+ while (ws >= 1 && state.pending.charCodeAt(ws - 1) === 32) ws--;
3192
+ state.pending = state.pending.slice(0, ws);
3193
+ state.push("hardbreak", "br", 0);
3194
+ } else {
3195
+ state.pending = state.pending.slice(0, -1);
3196
+ state.push("softbreak", "br", 0);
3197
+ }
3198
+ else state.push("softbreak", "br", 0);
3199
+ pos++;
3200
+ while (pos < max && isSpace(state.src.charCodeAt(pos))) pos++;
3201
+ state.pos = pos;
3202
+ return true;
3203
+ }
3204
+ //#endregion
3205
+ //#region src/rules_inline/escape.ts
3206
+ var ESCAPED = [];
3207
+ for (let i = 0; i < 256; i++) ESCAPED.push(0);
3208
+ "\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(ch) {
3209
+ ESCAPED[ch.charCodeAt(0)] = 1;
3210
+ });
3211
+ function escape(state, silent) {
3212
+ let pos = state.pos;
3213
+ const max = state.posMax;
3214
+ if (state.src.charCodeAt(pos) !== 92) return false;
3215
+ pos++;
3216
+ if (pos >= max) return false;
3217
+ let ch1 = state.src.charCodeAt(pos);
3218
+ if (ch1 === 10) {
3219
+ if (!silent) state.push("hardbreak", "br", 0);
3220
+ pos++;
3221
+ while (pos < max) {
3222
+ ch1 = state.src.charCodeAt(pos);
3223
+ if (!isSpace(ch1)) break;
3224
+ pos++;
3225
+ }
3226
+ state.pos = pos;
3227
+ return true;
3228
+ }
3229
+ if (ch1 === 32) {
3230
+ if (!silent) {
3231
+ const token = state.push("text_special", "", 0);
3232
+ token.content = "\\";
3233
+ token.markup = "\\";
3234
+ token.info = "escape";
3235
+ }
3236
+ state.pos = pos;
3237
+ return true;
3238
+ }
3239
+ let escapedStr = state.src[pos];
3240
+ if (ch1 >= 55296 && ch1 <= 56319 && pos + 1 < max) {
3241
+ const ch2 = state.src.charCodeAt(pos + 1);
3242
+ if (ch2 >= 56320 && ch2 <= 57343) {
3243
+ escapedStr += state.src[pos + 1];
3244
+ pos++;
3245
+ }
3246
+ }
3247
+ const origStr = "\\" + escapedStr;
3248
+ if (!silent) {
3249
+ const token = state.push("text_special", "", 0);
3250
+ if (ch1 < 256 && ESCAPED[ch1] !== 0) token.content = escapedStr;
3251
+ else token.content = origStr;
3252
+ token.markup = origStr;
3253
+ token.info = "escape";
3254
+ }
3255
+ state.pos = pos + 1;
3256
+ return true;
3257
+ }
3258
+ //#endregion
3259
+ //#region src/rules_inline/backticks.ts
3260
+ function backtick(state, silent) {
3261
+ let pos = state.pos;
3262
+ if (state.src.charCodeAt(pos) !== 96) return false;
3263
+ const start = pos;
3264
+ pos++;
3265
+ const max = state.posMax;
3266
+ while (pos < max && state.src.charCodeAt(pos) === 96) pos++;
3267
+ const marker = state.src.slice(start, pos);
3268
+ const openerLength = marker.length;
3269
+ if (state.backticksScanned && (state.backticks[openerLength] || 0) <= start) {
3270
+ if (!silent) state.pending += marker;
3271
+ state.pos += openerLength;
3272
+ return true;
3273
+ }
3274
+ let matchEnd = pos;
3275
+ let matchStart;
3276
+ while ((matchStart = state.src.indexOf("`", matchEnd)) !== -1) {
3277
+ matchEnd = matchStart + 1;
3278
+ while (matchEnd < max && state.src.charCodeAt(matchEnd) === 96) matchEnd++;
3279
+ const closerLength = matchEnd - matchStart;
3280
+ if (closerLength === openerLength) {
3281
+ if (!silent) {
3282
+ const token = state.push("code_inline", "code", 0);
3283
+ token.markup = marker;
3284
+ token.content = state.src.slice(pos, matchStart).replace(/\n/g, " ").replace(/^ (.+) $/, "$1");
3285
+ }
3286
+ state.pos = matchEnd;
3287
+ return true;
3288
+ }
3289
+ state.backticks[closerLength] = matchStart;
3290
+ }
3291
+ state.backticksScanned = true;
3292
+ if (!silent) state.pending += marker;
3293
+ state.pos += openerLength;
3294
+ return true;
3295
+ }
3296
+ //#endregion
3297
+ //#region src/rules_inline/strikethrough.ts
3298
+ function strikethrough_tokenize(state, silent) {
3299
+ const start = state.pos;
3300
+ const marker = state.src.charCodeAt(start);
3301
+ if (silent) return false;
3302
+ if (marker !== 126) return false;
3303
+ const scanned = state.scanDelims(state.pos, true);
3304
+ let len = scanned.length;
3305
+ const ch = String.fromCharCode(marker);
3306
+ if (len < 2) return false;
3307
+ let token;
3308
+ if (len % 2) {
3309
+ token = state.push("text", "", 0);
3310
+ token.content = ch;
3311
+ len--;
3312
+ }
3313
+ for (let i = 0; i < len; i += 2) {
3314
+ token = state.push("text", "", 0);
3315
+ token.content = ch + ch;
3316
+ state.delimiters.push({
3317
+ marker,
3318
+ length: 0,
3319
+ token: state.tokens.length - 1,
3320
+ end: -1,
3321
+ open: scanned.can_open,
3322
+ close: scanned.can_close
3323
+ });
3324
+ }
3325
+ state.pos += scanned.length;
3326
+ return true;
3327
+ }
3328
+ function postProcess$1(state, delimiters) {
3329
+ let token;
3330
+ const loneMarkers = [];
3331
+ const max = delimiters.length;
3332
+ for (let i = 0; i < max; i++) {
3333
+ const startDelim = delimiters[i];
3334
+ if (startDelim.marker !== 126) continue;
3335
+ if (startDelim.end === -1) continue;
3336
+ const endDelim = delimiters[startDelim.end];
3337
+ token = state.tokens[startDelim.token];
3338
+ token.type = "s_open";
3339
+ token.tag = "s";
3340
+ token.nesting = 1;
3341
+ token.markup = "~~";
3342
+ token.content = "";
3343
+ token = state.tokens[endDelim.token];
3344
+ token.type = "s_close";
3345
+ token.tag = "s";
3346
+ token.nesting = -1;
3347
+ token.markup = "~~";
3348
+ token.content = "";
3349
+ if (state.tokens[endDelim.token - 1].type === "text" && state.tokens[endDelim.token - 1].content === "~") loneMarkers.push(endDelim.token - 1);
3350
+ }
3351
+ while (loneMarkers.length) {
3352
+ const i = loneMarkers.pop();
3353
+ let j = i + 1;
3354
+ while (j < state.tokens.length && state.tokens[j].type === "s_close") j++;
3355
+ j--;
3356
+ if (i !== j) {
3357
+ token = state.tokens[j];
3358
+ state.tokens[j] = state.tokens[i];
3359
+ state.tokens[i] = token;
3360
+ }
3361
+ }
3362
+ }
3363
+ function strikethrough_postProcess(state) {
3364
+ const tokens_meta = state.tokens_meta;
3365
+ const max = state.tokens_meta.length;
3366
+ postProcess$1(state, state.delimiters);
3367
+ for (let curr = 0; curr < max; curr++) {
3368
+ var _tokens_meta$curr;
3369
+ const delimiters = (_tokens_meta$curr = tokens_meta[curr]) === null || _tokens_meta$curr === void 0 ? void 0 : _tokens_meta$curr.delimiters;
3370
+ if (delimiters) postProcess$1(state, delimiters);
3371
+ }
3372
+ }
3373
+ var strikethrough_default = {
3374
+ tokenize: strikethrough_tokenize,
3375
+ postProcess: strikethrough_postProcess
3376
+ };
3377
+ //#endregion
3378
+ //#region src/rules_inline/emphasis.ts
3379
+ function emphasis_tokenize(state, silent) {
3380
+ const start = state.pos;
3381
+ const marker = state.src.charCodeAt(start);
3382
+ if (silent) return false;
3383
+ if (marker !== 95 && marker !== 42) return false;
3384
+ const scanned = state.scanDelims(state.pos, marker === 42);
3385
+ for (let i = 0; i < scanned.length; i++) {
3386
+ const token = state.push("text", "", 0);
3387
+ token.content = String.fromCharCode(marker);
3388
+ state.delimiters.push({
3389
+ marker,
3390
+ length: scanned.length,
3391
+ token: state.tokens.length - 1,
3392
+ end: -1,
3393
+ open: scanned.can_open,
3394
+ close: scanned.can_close
3395
+ });
3396
+ }
3397
+ state.pos += scanned.length;
3398
+ return true;
3399
+ }
3400
+ function postProcess(state, delimiters) {
3401
+ const max = delimiters.length;
3402
+ for (let i = max - 1; i >= 0; i--) {
3403
+ const startDelim = delimiters[i];
3404
+ if (startDelim.marker !== 95 && startDelim.marker !== 42) continue;
3405
+ if (startDelim.end === -1) continue;
3406
+ const endDelim = delimiters[startDelim.end];
3407
+ const isStrong = i > 0 && delimiters[i - 1].end === startDelim.end + 1 && delimiters[i - 1].marker === startDelim.marker && delimiters[i - 1].token === startDelim.token - 1 && delimiters[startDelim.end + 1].token === endDelim.token + 1;
3408
+ const ch = String.fromCharCode(startDelim.marker);
3409
+ const token_o = state.tokens[startDelim.token];
3410
+ token_o.type = isStrong ? "strong_open" : "em_open";
3411
+ token_o.tag = isStrong ? "strong" : "em";
3412
+ token_o.nesting = 1;
3413
+ token_o.markup = isStrong ? ch + ch : ch;
3414
+ token_o.content = "";
3415
+ const token_c = state.tokens[endDelim.token];
3416
+ token_c.type = isStrong ? "strong_close" : "em_close";
3417
+ token_c.tag = isStrong ? "strong" : "em";
3418
+ token_c.nesting = -1;
3419
+ token_c.markup = isStrong ? ch + ch : ch;
3420
+ token_c.content = "";
3421
+ if (isStrong) {
3422
+ state.tokens[delimiters[i - 1].token].content = "";
3423
+ state.tokens[delimiters[startDelim.end + 1].token].content = "";
3424
+ i--;
3425
+ }
3426
+ }
3427
+ }
3428
+ function emphasis_post_process(state) {
3429
+ const tokens_meta = state.tokens_meta;
3430
+ const max = state.tokens_meta.length;
3431
+ postProcess(state, state.delimiters);
3432
+ for (let curr = 0; curr < max; curr++) {
3433
+ var _tokens_meta$curr;
3434
+ const delimiters = (_tokens_meta$curr = tokens_meta[curr]) === null || _tokens_meta$curr === void 0 ? void 0 : _tokens_meta$curr.delimiters;
3435
+ if (delimiters) postProcess(state, delimiters);
3436
+ }
3437
+ }
3438
+ var emphasis_default = {
3439
+ tokenize: emphasis_tokenize,
3440
+ postProcess: emphasis_post_process
3441
+ };
3442
+ //#endregion
3443
+ //#region src/rules_inline/link.ts
3444
+ function link(state, silent) {
3445
+ let code, label, res, ref;
3446
+ let href = "";
3447
+ let title = "";
3448
+ let start = state.pos;
3449
+ let parseReference = true;
3450
+ if (state.src.charCodeAt(state.pos) !== 91) return false;
3451
+ const oldPos = state.pos;
3452
+ const max = state.posMax;
3453
+ const labelStart = state.pos + 1;
3454
+ const labelEnd = state.md.helpers.parseLinkLabel(state, state.pos, true);
3455
+ if (labelEnd < 0) return false;
3456
+ let pos = labelEnd + 1;
3457
+ if (pos < max && state.src.charCodeAt(pos) === 40) {
3458
+ parseReference = false;
3459
+ pos++;
3460
+ for (; pos < max; pos++) {
3461
+ code = state.src.charCodeAt(pos);
3462
+ if (!isSpace(code) && code !== 10) break;
3463
+ }
3464
+ if (pos >= max) return false;
3465
+ start = pos;
3466
+ res = state.md.helpers.parseLinkDestination(state.src, pos, state.posMax);
3467
+ if (res.ok) {
3468
+ href = state.md.normalizeLink(res.str);
3469
+ if (state.md.validateLink(href)) pos = res.pos;
3470
+ else href = "";
3471
+ start = pos;
3472
+ for (; pos < max; pos++) {
3473
+ code = state.src.charCodeAt(pos);
3474
+ if (!isSpace(code) && code !== 10) break;
3475
+ }
3476
+ res = state.md.helpers.parseLinkTitle(state.src, pos, state.posMax);
3477
+ if (pos < max && start !== pos && res.ok) {
3478
+ title = res.str;
3479
+ pos = res.pos;
3480
+ for (; pos < max; pos++) {
3481
+ code = state.src.charCodeAt(pos);
3482
+ if (!isSpace(code) && code !== 10) break;
3483
+ }
3484
+ }
3485
+ }
3486
+ if (pos >= max || state.src.charCodeAt(pos) !== 41) parseReference = true;
3487
+ pos++;
3488
+ }
3489
+ if (parseReference) {
3490
+ if (typeof state.env.references === "undefined") return false;
3491
+ if (pos < max && state.src.charCodeAt(pos) === 91) {
3492
+ start = pos + 1;
3493
+ pos = state.md.helpers.parseLinkLabel(state, pos);
3494
+ if (pos >= 0) label = state.src.slice(start, pos++);
3495
+ else pos = labelEnd + 1;
3496
+ } else pos = labelEnd + 1;
3497
+ if (!label) label = state.src.slice(labelStart, labelEnd);
3498
+ label = normalizeReference(label);
3499
+ ref = state.env.references[label];
3500
+ if (!ref) {
3501
+ state.pos = oldPos;
3502
+ return false;
3503
+ }
3504
+ href = ref.href;
3505
+ title = ref.title;
3506
+ }
3507
+ if (!silent) {
3508
+ state.pos = labelStart;
3509
+ state.posMax = labelEnd;
3510
+ const token_o = state.push("link_open", "a", 1);
3511
+ const attrs = [["href", href]];
3512
+ token_o.attrs = attrs;
3513
+ if (title) attrs.push(["title", title]);
3514
+ if (label) {
3515
+ const meta = Object.create(null);
3516
+ meta.label = label;
3517
+ token_o.meta = meta;
3518
+ }
3519
+ state.linkLevel++;
3520
+ state.md.inline.tokenize(state);
3521
+ state.linkLevel--;
3522
+ state.push("link_close", "a", -1);
3523
+ }
3524
+ state.pos = pos;
3525
+ state.posMax = max;
3526
+ return true;
3527
+ }
3528
+ //#endregion
3529
+ //#region src/rules_inline/image.ts
3530
+ function image(state, silent) {
3531
+ let code, content, label, pos, ref, res, title, start;
3532
+ let href = "";
3533
+ const oldPos = state.pos;
3534
+ const max = state.posMax;
3535
+ if (state.src.charCodeAt(state.pos) !== 33) return false;
3536
+ if (state.src.charCodeAt(state.pos + 1) !== 91) return false;
3537
+ const labelStart = state.pos + 2;
3538
+ const labelEnd = state.md.helpers.parseLinkLabel(state, state.pos + 1, false);
3539
+ if (labelEnd < 0) return false;
3540
+ pos = labelEnd + 1;
3541
+ if (pos < max && state.src.charCodeAt(pos) === 40) {
3542
+ pos++;
3543
+ for (; pos < max; pos++) {
3544
+ code = state.src.charCodeAt(pos);
3545
+ if (!isSpace(code) && code !== 10) break;
3546
+ }
3547
+ if (pos >= max) return false;
3548
+ start = pos;
3549
+ res = state.md.helpers.parseLinkDestination(state.src, pos, state.posMax);
3550
+ if (res.ok) {
3551
+ href = state.md.normalizeLink(res.str);
3552
+ if (state.md.validateLink(href)) pos = res.pos;
3553
+ else href = "";
3554
+ }
3555
+ start = pos;
3556
+ for (; pos < max; pos++) {
3557
+ code = state.src.charCodeAt(pos);
3558
+ if (!isSpace(code) && code !== 10) break;
3559
+ }
3560
+ res = state.md.helpers.parseLinkTitle(state.src, pos, state.posMax);
3561
+ if (pos < max && start !== pos && res.ok) {
3562
+ title = res.str;
3563
+ pos = res.pos;
3564
+ for (; pos < max; pos++) {
3565
+ code = state.src.charCodeAt(pos);
3566
+ if (!isSpace(code) && code !== 10) break;
3567
+ }
3568
+ } else title = "";
3569
+ if (pos >= max || state.src.charCodeAt(pos) !== 41) {
3570
+ state.pos = oldPos;
3571
+ return false;
3572
+ }
3573
+ pos++;
3574
+ } else {
3575
+ if (typeof state.env.references === "undefined") return false;
3576
+ if (pos < max && state.src.charCodeAt(pos) === 91) {
3577
+ start = pos + 1;
3578
+ pos = state.md.helpers.parseLinkLabel(state, pos);
3579
+ if (pos >= 0) label = state.src.slice(start, pos++);
3580
+ else pos = labelEnd + 1;
3581
+ } else pos = labelEnd + 1;
3582
+ if (!label) label = state.src.slice(labelStart, labelEnd);
3583
+ label = normalizeReference(label);
3584
+ ref = state.env.references[label];
3585
+ if (!ref) {
3586
+ state.pos = oldPos;
3587
+ return false;
3588
+ }
3589
+ href = ref.href;
3590
+ title = ref.title;
3591
+ }
3592
+ if (!silent) {
3593
+ content = state.src.slice(labelStart, labelEnd);
3594
+ const tokens = [];
3595
+ state.md.inline.parse(content, state.md, state.env, tokens);
3596
+ const token = state.push("image", "img", 0);
3597
+ const attrs = [["src", href], ["alt", ""]];
3598
+ token.attrs = attrs;
3599
+ token.children = tokens;
3600
+ token.content = content;
3601
+ if (title) attrs.push(["title", title]);
3602
+ if (label) {
3603
+ const meta = Object.create(null);
3604
+ meta.label = label;
3605
+ token.meta = meta;
3606
+ }
3607
+ }
3608
+ state.pos = pos;
3609
+ state.posMax = max;
3610
+ return true;
3611
+ }
3612
+ //#endregion
3613
+ //#region src/rules_inline/autolink.ts
3614
+ 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])?)*)$/;
3615
+ var AUTOLINK_RE = /^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;
3616
+ function autolink(state, silent) {
3617
+ let pos = state.pos;
3618
+ if (state.src.charCodeAt(pos) !== 60) return false;
3619
+ const start = state.pos;
3620
+ const max = state.posMax;
3621
+ for (;;) {
3622
+ if (++pos >= max) return false;
3623
+ const ch = state.src.charCodeAt(pos);
3624
+ if (ch === 60) return false;
3625
+ if (ch === 62) break;
3626
+ }
3627
+ const url = state.src.slice(start + 1, pos);
3628
+ if (AUTOLINK_RE.test(url)) {
3629
+ const fullUrl = state.md.normalizeLink(url);
3630
+ if (!state.md.validateLink(fullUrl)) return false;
3631
+ if (!silent) {
3632
+ const token_o = state.push("link_open", "a", 1);
3633
+ token_o.attrs = [["href", fullUrl]];
3634
+ token_o.markup = "autolink";
3635
+ token_o.info = "auto";
3636
+ const token_t = state.push("text", "", 0);
3637
+ token_t.content = state.md.normalizeLinkText(url);
3638
+ const token_c = state.push("link_close", "a", -1);
3639
+ token_c.markup = "autolink";
3640
+ token_c.info = "auto";
3641
+ }
3642
+ state.pos += url.length + 2;
3643
+ return true;
3644
+ }
3645
+ if (EMAIL_RE.test(url)) {
3646
+ const fullUrl = state.md.normalizeLink(`mailto:${url}`);
3647
+ if (!state.md.validateLink(fullUrl)) return false;
3648
+ if (!silent) {
3649
+ const token_o = state.push("link_open", "a", 1);
3650
+ token_o.attrs = [["href", fullUrl]];
3651
+ token_o.markup = "autolink";
3652
+ token_o.info = "auto";
3653
+ const token_t = state.push("text", "", 0);
3654
+ token_t.content = state.md.normalizeLinkText(url);
3655
+ const token_c = state.push("link_close", "a", -1);
3656
+ token_c.markup = "autolink";
3657
+ token_c.info = "auto";
3658
+ }
3659
+ state.pos += url.length + 2;
3660
+ return true;
3661
+ }
3662
+ return false;
3663
+ }
3664
+ //#endregion
3665
+ //#region src/rules_inline/html_inline.ts
3666
+ function isLinkOpen(str) {
3667
+ return /^<a[>\s]/i.test(str);
3668
+ }
3669
+ function isLinkClose(str) {
3670
+ return /^<\/a\s*>/i.test(str);
3671
+ }
3672
+ function isLetter(ch) {
3673
+ const lc = ch | 32;
3674
+ return lc >= 97 && lc <= 122;
3675
+ }
3676
+ function html_inline(state, silent) {
3677
+ if (!state.md.options.html) return false;
3678
+ const max = state.posMax;
3679
+ const pos = state.pos;
3680
+ if (state.src.charCodeAt(pos) !== 60 || pos + 2 >= max) return false;
3681
+ const ch = state.src.charCodeAt(pos + 1);
3682
+ if (ch !== 33 && ch !== 63 && ch !== 47 && !isLetter(ch)) return false;
3683
+ const match = state.src.slice(pos).match(HTML_TAG_RE);
3684
+ if (!match) return false;
3685
+ if (!silent) {
3686
+ const token = state.push("html_inline", "", 0);
3687
+ token.content = match[0];
3688
+ if (isLinkOpen(token.content)) state.linkLevel++;
3689
+ if (isLinkClose(token.content)) state.linkLevel--;
3690
+ }
3691
+ state.pos += match[0].length;
3692
+ return true;
3693
+ }
3694
+ //#endregion
3695
+ //#region src/rules_inline/entity.ts
3696
+ var DIGITAL_RE = /^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i;
3697
+ var NAMED_RE = /^&([a-z][a-z0-9]{1,31});/i;
3698
+ function entity(state, silent) {
3699
+ const pos = state.pos;
3700
+ const max = state.posMax;
3701
+ if (state.src.charCodeAt(pos) !== 38) return false;
3702
+ if (pos + 1 >= max) return false;
3703
+ if (state.src.charCodeAt(pos + 1) === 35) {
3704
+ const match = state.src.slice(pos).match(DIGITAL_RE);
3705
+ if (match) {
3706
+ if (!silent) {
3707
+ const code = match[1][0].toLowerCase() === "x" ? parseInt(match[1].slice(1), 16) : parseInt(match[1], 10);
3708
+ const token = state.push("text_special", "", 0);
3709
+ token.content = isValidEntityCode(code) ? fromCodePoint(code) : fromCodePoint(65533);
3710
+ token.markup = match[0];
3711
+ token.info = "entity";
3712
+ }
3713
+ state.pos += match[0].length;
3714
+ return true;
3715
+ }
3716
+ } else {
3717
+ const match = state.src.slice(pos).match(NAMED_RE);
3718
+ if (match) {
3719
+ const decoded = decodeHTMLStrict(match[0]);
3720
+ if (decoded !== match[0]) {
3721
+ if (!silent) {
3722
+ const token = state.push("text_special", "", 0);
3723
+ token.content = decoded;
3724
+ token.markup = match[0];
3725
+ token.info = "entity";
3726
+ }
3727
+ state.pos += match[0].length;
3728
+ return true;
3729
+ }
3730
+ }
3731
+ }
3732
+ return false;
3733
+ }
3734
+ //#endregion
3735
+ //#region src/rules_inline/balance_pairs.ts
3736
+ function processDelimiters(delimiters) {
3737
+ const openersBottom = {};
3738
+ const max = delimiters.length;
3739
+ if (!max) return;
3740
+ let headerIdx = 0;
3741
+ let lastTokenIdx = -2;
3742
+ const jumps = [];
3743
+ for (let closerIdx = 0; closerIdx < max; closerIdx++) {
3744
+ const closer = delimiters[closerIdx];
3745
+ jumps.push(0);
3746
+ if (delimiters[headerIdx].marker !== closer.marker || lastTokenIdx !== closer.token - 1) headerIdx = closerIdx;
3747
+ lastTokenIdx = closer.token;
3748
+ closer.length = closer.length || 0;
3749
+ if (!closer.close) continue;
3750
+ if (!openersBottom.hasOwnProperty(closer.marker)) openersBottom[closer.marker] = [
3751
+ -1,
3752
+ -1,
3753
+ -1,
3754
+ -1,
3755
+ -1,
3756
+ -1
3757
+ ];
3758
+ const minOpenerIdx = openersBottom[closer.marker][(closer.open ? 3 : 0) + closer.length % 3];
3759
+ let openerIdx = headerIdx - jumps[headerIdx] - 1;
3760
+ let newMinOpenerIdx = openerIdx;
3761
+ for (; openerIdx > minOpenerIdx; openerIdx -= jumps[openerIdx] + 1) {
3762
+ const opener = delimiters[openerIdx];
3763
+ if (opener.marker !== closer.marker) continue;
3764
+ if (opener.open && opener.end < 0) {
3765
+ let isOddMatch = false;
3766
+ if (opener.close || closer.open) {
3767
+ if ((opener.length + closer.length) % 3 === 0) {
3768
+ if (opener.length % 3 !== 0 || closer.length % 3 !== 0) isOddMatch = true;
3769
+ }
3770
+ }
3771
+ if (!isOddMatch) {
3772
+ const lastJump = openerIdx > 0 && !delimiters[openerIdx - 1].open ? jumps[openerIdx - 1] + 1 : 0;
3773
+ jumps[closerIdx] = closerIdx - openerIdx + lastJump;
3774
+ jumps[openerIdx] = lastJump;
3775
+ closer.open = false;
3776
+ opener.end = closerIdx;
3777
+ opener.close = false;
3778
+ newMinOpenerIdx = -1;
3779
+ lastTokenIdx = -2;
3780
+ break;
3781
+ }
3782
+ }
3783
+ }
3784
+ if (newMinOpenerIdx !== -1) openersBottom[closer.marker][(closer.open ? 3 : 0) + (closer.length || 0) % 3] = newMinOpenerIdx;
3785
+ }
3786
+ }
3787
+ function link_pairs(state) {
3788
+ const tokens_meta = state.tokens_meta;
3789
+ const max = state.tokens_meta.length;
3790
+ processDelimiters(state.delimiters);
3791
+ for (let curr = 0; curr < max; curr++) {
3792
+ var _tokens_meta$curr;
3793
+ const delimiters = (_tokens_meta$curr = tokens_meta[curr]) === null || _tokens_meta$curr === void 0 ? void 0 : _tokens_meta$curr.delimiters;
3794
+ if (delimiters) processDelimiters(delimiters);
3795
+ }
3796
+ }
3797
+ //#endregion
3798
+ //#region src/rules_inline/fragments_join.ts
3799
+ function fragments_join(state) {
3800
+ let curr, last;
3801
+ let level = 0;
3802
+ const tokens = state.tokens;
3803
+ const max = state.tokens.length;
3804
+ for (curr = last = 0; curr < max; curr++) {
3805
+ if (tokens[curr].nesting < 0) level--;
3806
+ tokens[curr].level = level;
3807
+ if (tokens[curr].nesting > 0) level++;
3808
+ if (tokens[curr].type === "text" && curr + 1 < max && tokens[curr + 1].type === "text") tokens[curr + 1].content = tokens[curr].content + tokens[curr + 1].content;
3809
+ else {
3810
+ if (curr !== last) tokens[last] = tokens[curr];
3811
+ last++;
3812
+ }
3813
+ }
3814
+ if (curr !== last) tokens.length = last;
3815
+ }
3816
+ //#endregion
3817
+ //#region src/parser_inline.ts
3818
+ var _rules = [
3819
+ ["text", text],
3820
+ ["linkify", linkify],
3821
+ ["newline", newline],
3822
+ ["escape", escape],
3823
+ ["backticks", backtick],
3824
+ ["strikethrough", strikethrough_default.tokenize],
3825
+ ["emphasis", emphasis_default.tokenize],
3826
+ ["link", link],
3827
+ ["image", image],
3828
+ ["autolink", autolink],
3829
+ ["html_inline", html_inline],
3830
+ ["entity", entity]
3831
+ ];
3832
+ var _rules2 = [
3833
+ ["balance_pairs", link_pairs],
3834
+ ["strikethrough", strikethrough_default.postProcess],
3835
+ ["emphasis", emphasis_default.postProcess],
3836
+ ["fragments_join", fragments_join]
3837
+ ];
3838
+ /**
3839
+ * Tokenizes paragraph content.
3840
+ */
3841
+ var ParserInline = class {
3842
+ constructor() {
3843
+ _defineProperty(
3844
+ this,
3845
+ /**
3846
+ * {@link Ruler} instance. Keep configuration of inline rules.
3847
+ */
3848
+ "ruler",
3849
+ new Ruler()
3850
+ );
3851
+ _defineProperty(
3852
+ this,
3853
+ /**
3854
+ * {@link Ruler} instance. Second ruler used for post-processing
3855
+ * (e.g. in emphasis-like rules).
3856
+ */
3857
+ "ruler2",
3858
+ new Ruler()
3859
+ );
3860
+ _defineProperty(this, "State", StateInline);
3861
+ for (let i = 0; i < _rules.length; i++) this.ruler.push(_rules[i][0], _rules[i][1]);
3862
+ for (let i = 0; i < _rules2.length; i++) this.ruler2.push(_rules2[i][0], _rules2[i][1]);
3863
+ }
3864
+ skipToken(state) {
3865
+ const pos = state.pos;
3866
+ const rules = this.ruler.getRules("");
3867
+ const len = rules.length;
3868
+ const maxNesting = state.md.options.maxNesting;
3869
+ const cache = state.cache;
3870
+ if (typeof cache[pos] !== "undefined") {
3871
+ state.pos = cache[pos];
3872
+ return;
3873
+ }
3874
+ let ok = false;
3875
+ if (state.level < maxNesting) for (let i = 0; i < len; i++) {
3876
+ state.level++;
3877
+ ok = rules[i](state, true);
3878
+ state.level--;
3879
+ if (ok) {
3880
+ if (pos >= state.pos) throw new Error("inline rule didn't increment state.pos");
3881
+ break;
3882
+ }
3883
+ }
3884
+ else state.pos = state.posMax;
3885
+ if (!ok) state.pos++;
3886
+ cache[pos] = state.pos;
3887
+ }
3888
+ tokenize(state) {
3889
+ const rules = this.ruler.getRules("");
3890
+ const len = rules.length;
3891
+ const end = state.posMax;
3892
+ const maxNesting = state.md.options.maxNesting;
3893
+ while (state.pos < end) {
3894
+ const prevPos = state.pos;
3895
+ let ok = false;
3896
+ if (state.level < maxNesting) for (let i = 0; i < len; i++) {
3897
+ ok = rules[i](state, false);
3898
+ if (ok) {
3899
+ if (prevPos >= state.pos) throw new Error("inline rule didn't increment state.pos");
3900
+ break;
3901
+ }
3902
+ }
3903
+ if (ok) {
3904
+ if (state.pos >= end) break;
3905
+ continue;
3906
+ }
3907
+ state.pending += state.src[state.pos++];
3908
+ }
3909
+ if (state.pending) state.pushPending();
3910
+ }
3911
+ /**
3912
+ * Process input string and push inline tokens into `outTokens`
3913
+ */
3914
+ parse(str, md, env, outTokens) {
3915
+ const state = new this.State(str, md, env, outTokens);
3916
+ this.tokenize(state);
3917
+ const rules = this.ruler2.getRules("");
3918
+ const len = rules.length;
3919
+ for (let i = 0; i < len; i++) rules[i](state);
3920
+ }
3921
+ };
3922
+ var default_default = {
3923
+ options: {
3924
+ html: false,
3925
+ xhtmlOut: false,
3926
+ breaks: false,
3927
+ langPrefix: "language-",
3928
+ linkify: false,
3929
+ typographer: false,
3930
+ quotes: "“”‘’",
3931
+ highlight: null,
3932
+ maxNesting: 100
3933
+ },
3934
+ components: {
3935
+ core: {},
3936
+ block: {},
3937
+ inline: {}
3938
+ }
3939
+ };
3940
+ var zero_default = {
3941
+ options: {
3942
+ html: false,
3943
+ xhtmlOut: false,
3944
+ breaks: false,
3945
+ langPrefix: "language-",
3946
+ linkify: false,
3947
+ typographer: false,
3948
+ quotes: "“”‘’",
3949
+ highlight: null,
3950
+ maxNesting: 20
3951
+ },
3952
+ components: {
3953
+ core: { rules: [
3954
+ "normalize",
3955
+ "block",
3956
+ "strip_references",
3957
+ "inline",
3958
+ "text_join"
3959
+ ] },
3960
+ block: { rules: ["paragraph"] },
3961
+ inline: {
3962
+ rules: ["text"],
3963
+ rules2: ["balance_pairs", "fragments_join"]
3964
+ }
3965
+ }
3966
+ };
3967
+ var commonmark_default = {
3968
+ options: {
3969
+ html: true,
3970
+ xhtmlOut: true,
3971
+ breaks: false,
3972
+ langPrefix: "language-",
3973
+ linkify: false,
3974
+ typographer: false,
3975
+ quotes: "“”‘’",
3976
+ highlight: null,
3977
+ maxNesting: 20
3978
+ },
3979
+ components: {
3980
+ core: { rules: [
3981
+ "normalize",
3982
+ "block",
3983
+ "strip_references",
3984
+ "inline",
3985
+ "text_join"
3986
+ ] },
3987
+ block: { rules: [
3988
+ "blockquote",
3989
+ "code",
3990
+ "fence",
3991
+ "heading",
3992
+ "hr",
3993
+ "html_block",
3994
+ "lheading",
3995
+ "list",
3996
+ "reference",
3997
+ "paragraph"
3998
+ ] },
3999
+ inline: {
4000
+ rules: [
4001
+ "autolink",
4002
+ "backticks",
4003
+ "emphasis",
4004
+ "entity",
4005
+ "escape",
4006
+ "html_inline",
4007
+ "image",
4008
+ "link",
4009
+ "newline",
4010
+ "text"
4011
+ ],
4012
+ rules2: [
4013
+ "balance_pairs",
4014
+ "emphasis",
4015
+ "fragments_join"
4016
+ ]
4017
+ }
4018
+ }
4019
+ };
4020
+ //#endregion
4021
+ //#region \0@oxc-project+runtime@0.142.0/helpers/esm/objectSpread2.js
4022
+ function ownKeys(e, r) {
4023
+ var t = Object.keys(e);
4024
+ if (Object.getOwnPropertySymbols) {
4025
+ var o = Object.getOwnPropertySymbols(e);
4026
+ r && (o = o.filter(function(r) {
4027
+ return Object.getOwnPropertyDescriptor(e, r).enumerable;
4028
+ })), t.push.apply(t, o);
4029
+ }
4030
+ return t;
4031
+ }
4032
+ function _objectSpread2(e) {
4033
+ for (var r = 1; r < arguments.length; r++) {
4034
+ var t = null != arguments[r] ? arguments[r] : {};
4035
+ r % 2 ? ownKeys(Object(t), !0).forEach(function(r) {
4036
+ _defineProperty(e, r, t[r]);
4037
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r) {
4038
+ Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
4039
+ });
4040
+ }
4041
+ return e;
4042
+ }
4043
+ //#endregion
4044
+ //#region src/markdownit.ts
4045
+ var config = {
4046
+ default: default_default,
4047
+ zero: zero_default,
4048
+ commonmark: commonmark_default
4049
+ };
4050
+ var BAD_PROTO_RE = /^(vbscript|javascript|file|data):/;
4051
+ var GOOD_DATA_RE = /^data:image\/(gif|png|jpeg|webp);/;
4052
+ var RECODE_HOSTNAME_FOR = [
4053
+ "http:",
4054
+ "https:",
4055
+ "mailto:"
4056
+ ];
4057
+ /**
4058
+ * Parses Markdown into tokens and renders them to HTML.
4059
+ *
4060
+ * @category Main
4061
+ */
4062
+ var MarkdownIt = class {
4063
+ /**
4064
+ * Link validation function. CommonMark allows too much in links. By default
4065
+ * we disable `javascript:`, `vbscript:`, `file:` schemas, and almost all `data:...` schemas
4066
+ * except some embedded image types.
4067
+ *
4068
+ * You can change this behaviour:
4069
+ *
4070
+ * @example
4071
+ * ```javascript
4072
+ * import MarkdownIt from 'markdown-it'
4073
+ * const md = new MarkdownIt()
4074
+ *
4075
+ * // enable everything
4076
+ * md.validateLink = function () { return true; }
4077
+ * ```
4078
+ */
4079
+ validateLink(url) {
4080
+ const str = url.trim().toLowerCase();
4081
+ return BAD_PROTO_RE.test(str) ? GOOD_DATA_RE.test(str) : true;
4082
+ }
4083
+ /**
4084
+ * Function used to encode link url to a machine-readable format,
4085
+ * which includes url-encoding, punycode, etc.
4086
+ */
4087
+ normalizeLink(url) {
4088
+ const parsed = mdurl.parse(url, true);
4089
+ if (parsed.hostname) {
4090
+ if (!parsed.protocol || RECODE_HOSTNAME_FOR.indexOf(parsed.protocol) >= 0) try {
4091
+ parsed.hostname = punycode_js.default.toASCII(parsed.hostname);
4092
+ } catch (er) {}
4093
+ }
4094
+ return mdurl.encode(mdurl.format(parsed));
4095
+ }
4096
+ /**
4097
+ * Function used to decode link url to a human-readable format`
4098
+ */
4099
+ normalizeLinkText(url) {
4100
+ const parsed = mdurl.parse(url, true);
4101
+ if (parsed.hostname) {
4102
+ if (!parsed.protocol || RECODE_HOSTNAME_FOR.indexOf(parsed.protocol) >= 0) try {
4103
+ parsed.hostname = punycode_js.default.toUnicode(parsed.hostname);
4104
+ } catch (er) {}
4105
+ }
4106
+ return mdurl.decode(mdurl.format(parsed), mdurl.decode.defaultChars + "%");
4107
+ }
4108
+ constructor(...args) {
4109
+ _defineProperty(
4110
+ this,
4111
+ /**
4112
+ * Instance of {@link ParserInline}. You may need it to add new rules when
4113
+ * writing plugins. For simple rules control use {@link MarkdownIt.disable}
4114
+ * and {@link MarkdownIt.enable}.
4115
+ */
4116
+ "inline",
4117
+ new ParserInline()
4118
+ );
4119
+ _defineProperty(
4120
+ this,
4121
+ /**
4122
+ * Instance of {@link ParserBlock}. You may need it to add new rules when
4123
+ * writing plugins. For simple rules control use {@link MarkdownIt.disable}
4124
+ * and {@link MarkdownIt.enable}.
4125
+ */
4126
+ "block",
4127
+ new ParserBlock()
4128
+ );
4129
+ _defineProperty(
4130
+ this,
4131
+ /**
4132
+ * Instance of {@link ParserCore} chain executor. You may need it to add new
4133
+ * rules when writing plugins. For simple rules control use
4134
+ * {@link MarkdownIt.disable} and {@link MarkdownIt.enable}.
4135
+ */
4136
+ "core",
4137
+ new ParserCore()
4138
+ );
4139
+ _defineProperty(
4140
+ this,
4141
+ /**
4142
+ * Instance of {@link Renderer}. Use it to modify output look. Or to add rendering
4143
+ * rules for new token types, generated by plugins.
4144
+ *
4145
+ * See {@link Renderer} docs and
4146
+ * [source code](https://github.com/markdown-it/markdown-it/blob/master/src/renderer.ts).
4147
+ *
4148
+ * @example
4149
+ * ```javascript
4150
+ * import MarkdownIt from 'markdown-it'
4151
+ * const md = new MarkdownIt()
4152
+ *
4153
+ * function myToken(tokens, idx, options, env, self) {
4154
+ * //...
4155
+ * return result;
4156
+ * };
4157
+ *
4158
+ * md.renderer.rules['my_token'] = myToken
4159
+ * ```
4160
+ */
4161
+ "renderer",
4162
+ new Renderer()
4163
+ );
4164
+ _defineProperty(
4165
+ this,
4166
+ /**
4167
+ * [linkify-it](https://github.com/markdown-it/linkify-it) instance.
4168
+ * Used by [linkify](https://github.com/markdown-it/markdown-it/blob/master/src/rules_core/linkify.ts)
4169
+ * rule.
4170
+ */
4171
+ "linkify",
4172
+ new linkify_it.LinkifyIt()
4173
+ );
4174
+ _defineProperty(
4175
+ this,
4176
+ /**
4177
+ * Assorted utility functions, useful to write plugins. See details
4178
+ * [here](https://github.com/markdown-it/markdown-it/blob/master/src/common/utils.ts).
4179
+ */
4180
+ "utils",
4181
+ utils_exports
4182
+ );
4183
+ _defineProperty(
4184
+ this,
4185
+ /**
4186
+ * Link components parser functions, useful to write plugins. See details
4187
+ * [here](https://github.com/markdown-it/markdown-it/blob/master/src/helpers).
4188
+ */
4189
+ "helpers",
4190
+ Object.assign({}, helpers_exports)
4191
+ );
4192
+ const [presetNameOrOptions, options] = args;
4193
+ if (typeof presetNameOrOptions === "string") {
4194
+ this.configure(presetNameOrOptions);
4195
+ if (options) this.set(options);
4196
+ } else {
4197
+ this.configure("default");
4198
+ this.set(presetNameOrOptions || {});
4199
+ }
4200
+ }
4201
+ /**
4202
+ * Set parser options (in the same format as in constructor). Probably, you
4203
+ * will never need it, but you can change options after constructor call.
4204
+ *
4205
+ * __Note:__ To achieve the best possible performance, don't modify a
4206
+ * `markdown-it` instance options on the fly. If you need multiple configurations
4207
+ * it's best to create multiple instances and initialize each with separate
4208
+ * config.
4209
+ *
4210
+ * @example
4211
+ * ```javascript
4212
+ * import MarkdownIt from 'markdown-it'
4213
+ *
4214
+ * const md = new MarkdownIt()
4215
+ * .set({ html: true, breaks: true })
4216
+ * .set({ typographer: true })
4217
+ * ```
4218
+ */
4219
+ set(options) {
4220
+ Object.assign(this.options, options);
4221
+ return this;
4222
+ }
4223
+ /**
4224
+ * Batch load of all options and compenent settings. This is internal method,
4225
+ * and you probably will not need it. But if you will - see available presets
4226
+ * and data structure [here](https://github.com/markdown-it/markdown-it/tree/master/src/presets)
4227
+ *
4228
+ * We strongly recommend to use presets instead of direct config loads. That
4229
+ * will give better compatibility with next versions.
4230
+ */
4231
+ configure(presets) {
4232
+ let p;
4233
+ if (typeof presets === "string") {
4234
+ const presetName = presets;
4235
+ p = config[presetName];
4236
+ if (!p) throw new Error(`Wrong 'markdown-it' preset "${presetName}", check name`);
4237
+ } else p = presets;
4238
+ if (!p) throw new Error("Wrong `markdown-it` preset, can't be empty");
4239
+ if (p.options) this.options = _objectSpread2({}, p.options);
4240
+ const components = p.components;
4241
+ if (components) {
4242
+ var _components$inline;
4243
+ [
4244
+ "core",
4245
+ "block",
4246
+ "inline"
4247
+ ].forEach((name) => {
4248
+ var _components$name;
4249
+ const rules = (_components$name = components[name]) === null || _components$name === void 0 ? void 0 : _components$name.rules;
4250
+ if (rules) this[name].ruler.enableOnly(rules);
4251
+ });
4252
+ const rules2 = (_components$inline = components.inline) === null || _components$inline === void 0 ? void 0 : _components$inline.rules2;
4253
+ if (rules2) this.inline.ruler2.enableOnly(rules2);
4254
+ }
4255
+ return this;
4256
+ }
4257
+ /**
4258
+ * Enable list or rules. It will automatically find appropriate components,
4259
+ * containing rules with given names. If rule not found, and `ignoreInvalid`
4260
+ * not set - throws exception.
4261
+ *
4262
+ * @param list Rule name or list of rule names to enable.
4263
+ * @param ignoreInvalid Set `true` to ignore errors when rule not found.
4264
+ *
4265
+ * @example
4266
+ * ```javascript
4267
+ * import MarkdownIt from 'markdown-it'
4268
+ *
4269
+ * const md = new MarkdownIt()
4270
+ * .enable(['sub', 'sup'])
4271
+ * .disable('smartquotes')
4272
+ * ```
4273
+ */
4274
+ enable(list, ignoreInvalid = false) {
4275
+ let result = [];
4276
+ if (!Array.isArray(list)) list = [list];
4277
+ [
4278
+ "core",
4279
+ "block",
4280
+ "inline"
4281
+ ].forEach((chain) => {
4282
+ result = result.concat(this[chain].ruler.enable(list, true));
4283
+ });
4284
+ result = result.concat(this.inline.ruler2.enable(list, true));
4285
+ const missed = list.filter((name) => result.indexOf(name) < 0);
4286
+ if (missed.length && !ignoreInvalid) throw new Error(`MarkdownIt. Failed to enable unknown rule(s): ${missed}`);
4287
+ return this;
4288
+ }
4289
+ /**
4290
+ * The same as {@link MarkdownIt.enable}, but turn specified rules off.
4291
+ *
4292
+ * @param list Rule name or list of rule names to disable.
4293
+ * @param ignoreInvalid Set `true` to ignore errors when rule not found.
4294
+ */
4295
+ disable(list, ignoreInvalid = false) {
4296
+ let result = [];
4297
+ if (!Array.isArray(list)) list = [list];
4298
+ [
4299
+ "core",
4300
+ "block",
4301
+ "inline"
4302
+ ].forEach((chain) => {
4303
+ result = result.concat(this[chain].ruler.disable(list, true));
4304
+ });
4305
+ result = result.concat(this.inline.ruler2.disable(list, true));
4306
+ const missed = list.filter((name) => result.indexOf(name) < 0);
4307
+ if (missed.length && !ignoreInvalid) throw new Error(`MarkdownIt. Failed to disable unknown rule(s): ${missed}`);
4308
+ return this;
4309
+ }
4310
+ /**
4311
+ * Load specified plugin with given params into current parser instance.
4312
+ * It's just a sugar to call `plugin(md, params)` with curring.
4313
+ *
4314
+ * @example
4315
+ * ```javascript
4316
+ * import MarkdownIt from 'markdown-it'
4317
+ * import iterator from 'markdown-it-for-inline'
4318
+ *
4319
+ * const md = new MarkdownIt()
4320
+ * .use(iterator, 'foo_replace', 'text', function (tokens, idx) {
4321
+ * tokens[idx].content = tokens[idx].content.replace(/foo/g, 'bar')
4322
+ * })
4323
+ * ```
4324
+ */
4325
+ use(plugin, ...params) {
4326
+ plugin.apply(plugin, [this, ...params]);
4327
+ return this;
4328
+ }
4329
+ /**
4330
+ * Parse input string and return list of block tokens (special token type
4331
+ * "inline" will contain list of inline tokens). You should not call this
4332
+ * method directly, until you write custom renderer (for example, to produce
4333
+ * AST).
4334
+ *
4335
+ * `env` is used to pass data between "distributed" rules and return additional
4336
+ * metadata like reference info, needed for the renderer. It also can be used to
4337
+ * inject data in specific cases. Usually, you will be ok to pass `{}`,
4338
+ * and then pass updated object to renderer.
4339
+ *
4340
+ * @param src Source string.
4341
+ * @param env Environment sandbox.
4342
+ */
4343
+ parse(src, env) {
4344
+ if (typeof src !== "string") throw new Error("Input data should be a String");
4345
+ const state = new this.core.State(src, this, env);
4346
+ this.core.process(state);
4347
+ return state.tokens;
4348
+ }
4349
+ /**
4350
+ * Render markdown string into html. It does all magic for you :).
4351
+ *
4352
+ * `env` can be used to inject additional metadata (`{}` by default).
4353
+ * But you will not need it with high probability. See also comment
4354
+ * in {@link MarkdownIt.parse}.
4355
+ *
4356
+ * @param src Source string.
4357
+ * @param env Environment sandbox.
4358
+ */
4359
+ render(src, env = {}) {
4360
+ return this.renderer.render(this.parse(src, env), this.options, env);
4361
+ }
4362
+ /**
4363
+ * The same as {@link MarkdownIt.parse} but skip all block rules. It returns
4364
+ * the block tokens list with the single `inline` element, containing parsed
4365
+ * inline tokens in `children` property. Also updates `env` object.
4366
+ *
4367
+ * @param src Source string.
4368
+ * @param env Environment sandbox.
4369
+ */
4370
+ parseInline(src, env) {
4371
+ const state = new this.core.State(src, this, env);
4372
+ state.inlineMode = true;
4373
+ this.core.process(state);
4374
+ return state.tokens;
4375
+ }
4376
+ /**
4377
+ * Similar to {@link MarkdownIt.render} but for single paragraph content.
4378
+ * Result will NOT be wrapped into `<p>` tags.
4379
+ *
4380
+ * @param src Source string.
4381
+ * @param env Environment sandbox.
4382
+ */
4383
+ renderInline(src, env = {}) {
4384
+ return this.renderer.render(this.parseInline(src, env), this.options, env);
4385
+ }
4386
+ };
4387
+ _defineProperty(MarkdownIt, "Token", Token);
4388
+ _defineProperty(MarkdownIt, "Ruler", Ruler);
4389
+ _defineProperty(MarkdownIt, "Renderer", Renderer);
4390
+ _defineProperty(MarkdownIt, "ParserCore", ParserCore);
4391
+ _defineProperty(MarkdownIt, "StateCore", StateCore);
4392
+ _defineProperty(MarkdownIt, "ParserBlock", ParserBlock);
4393
+ _defineProperty(MarkdownIt, "StateBlock", StateBlock);
4394
+ _defineProperty(MarkdownIt, "ParserInline", ParserInline);
4395
+ _defineProperty(MarkdownIt, "StateInline", StateInline);
4396
+ //#endregion
4397
+ //#region src/index.ts
4398
+ /**
4399
+ * Default package export.
4400
+ *
4401
+ * For backward compatibility, the {@link MarkdownIt} class is wrapped so
4402
+ * legacy code can call it without `new`. New code should instantiate it as a
4403
+ * regular class with `new`. The compatibility wrapper may be removed in a
4404
+ * future release.
4405
+ *
4406
+ * @category Main
4407
+ */
4408
+ var MarkdownItCallable = callable(MarkdownIt);
4409
+ //#endregion
4410
+ module.exports = MarkdownItCallable;
4411
+
4412
+ //# sourceMappingURL=markdown-it.cjs.js.map