@vaadin/bundles 24.8.0-alpha8 → 24.8.0-beta1

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.
@@ -0,0 +1,2228 @@
1
+ (self["webpackChunk_vaadin_bundles"] = self["webpackChunk_vaadin_bundles"] || []).push([["vendors-node_modules_marked_lib_marked_umd_js"],{
2
+
3
+ /***/ "./node_modules/marked/lib/marked.umd.js":
4
+ /*!***********************************************!*\
5
+ !*** ./node_modules/marked/lib/marked.umd.js ***!
6
+ \***********************************************/
7
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
8
+
9
+ __webpack_require__.r(__webpack_exports__);
10
+ /**
11
+ * marked v15.0.12 - a markdown parser
12
+ * Copyright (c) 2011-2025, Christopher Jeffrey. (MIT Licensed)
13
+ * https://github.com/markedjs/marked
14
+ */
15
+
16
+ /**
17
+ * DO NOT EDIT THIS FILE
18
+ * The code in this file is generated from files in ./src/
19
+ */
20
+ (function(g,f){if(typeof exports=="object"&&typeof module<"u"){module.exports=f()}else if("function"==typeof define && define.amd){define("marked",f)}else {g["marked"]=f()}}(typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : undefined,function(){var exports={};var __exports=exports;var module={exports};
21
+ "use strict";
22
+ var __defProp = Object.defineProperty;
23
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
24
+ var __getOwnPropNames = Object.getOwnPropertyNames;
25
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
26
+ var __export = (target, all) => {
27
+ for (var name in all)
28
+ __defProp(target, name, { get: all[name], enumerable: true });
29
+ };
30
+ var __copyProps = (to, from, except, desc) => {
31
+ if (from && typeof from === "object" || typeof from === "function") {
32
+ for (let key of __getOwnPropNames(from))
33
+ if (!__hasOwnProp.call(to, key) && key !== except)
34
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
35
+ }
36
+ return to;
37
+ };
38
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
39
+
40
+ // src/marked.ts
41
+ var marked_exports = {};
42
+ __export(marked_exports, {
43
+ Hooks: () => _Hooks,
44
+ Lexer: () => _Lexer,
45
+ Marked: () => Marked,
46
+ Parser: () => _Parser,
47
+ Renderer: () => _Renderer,
48
+ TextRenderer: () => _TextRenderer,
49
+ Tokenizer: () => _Tokenizer,
50
+ defaults: () => _defaults,
51
+ getDefaults: () => _getDefaults,
52
+ lexer: () => lexer,
53
+ marked: () => marked,
54
+ options: () => options,
55
+ parse: () => parse,
56
+ parseInline: () => parseInline,
57
+ parser: () => parser,
58
+ setOptions: () => setOptions,
59
+ use: () => use,
60
+ walkTokens: () => walkTokens
61
+ });
62
+ module.exports = __toCommonJS(marked_exports);
63
+
64
+ // src/defaults.ts
65
+ function _getDefaults() {
66
+ return {
67
+ async: false,
68
+ breaks: false,
69
+ extensions: null,
70
+ gfm: true,
71
+ hooks: null,
72
+ pedantic: false,
73
+ renderer: null,
74
+ silent: false,
75
+ tokenizer: null,
76
+ walkTokens: null
77
+ };
78
+ }
79
+ var _defaults = _getDefaults();
80
+ function changeDefaults(newDefaults) {
81
+ _defaults = newDefaults;
82
+ }
83
+
84
+ // src/rules.ts
85
+ var noopTest = { exec: () => null };
86
+ function edit(regex, opt = "") {
87
+ let source = typeof regex === "string" ? regex : regex.source;
88
+ const obj = {
89
+ replace: (name, val) => {
90
+ let valSource = typeof val === "string" ? val : val.source;
91
+ valSource = valSource.replace(other.caret, "$1");
92
+ source = source.replace(name, valSource);
93
+ return obj;
94
+ },
95
+ getRegex: () => {
96
+ return new RegExp(source, opt);
97
+ }
98
+ };
99
+ return obj;
100
+ }
101
+ var other = {
102
+ codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm,
103
+ outputLinkReplace: /\\([\[\]])/g,
104
+ indentCodeCompensation: /^(\s+)(?:```)/,
105
+ beginningSpace: /^\s+/,
106
+ endingHash: /#$/,
107
+ startingSpaceChar: /^ /,
108
+ endingSpaceChar: / $/,
109
+ nonSpaceChar: /[^ ]/,
110
+ newLineCharGlobal: /\n/g,
111
+ tabCharGlobal: /\t/g,
112
+ multipleSpaceGlobal: /\s+/g,
113
+ blankLine: /^[ \t]*$/,
114
+ doubleBlankLine: /\n[ \t]*\n[ \t]*$/,
115
+ blockquoteStart: /^ {0,3}>/,
116
+ blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g,
117
+ blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm,
118
+ listReplaceTabs: /^\t+/,
119
+ listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g,
120
+ listIsTask: /^\[[ xX]\] /,
121
+ listReplaceTask: /^\[[ xX]\] +/,
122
+ anyLine: /\n.*\n/,
123
+ hrefBrackets: /^<(.*)>$/,
124
+ tableDelimiter: /[:|]/,
125
+ tableAlignChars: /^\||\| *$/g,
126
+ tableRowBlankLine: /\n[ \t]*$/,
127
+ tableAlignRight: /^ *-+: *$/,
128
+ tableAlignCenter: /^ *:-+: *$/,
129
+ tableAlignLeft: /^ *:-+ *$/,
130
+ startATag: /^<a /i,
131
+ endATag: /^<\/a>/i,
132
+ startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i,
133
+ endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i,
134
+ startAngleBracket: /^</,
135
+ endAngleBracket: />$/,
136
+ pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/,
137
+ unicodeAlphaNumeric: /[\p{L}\p{N}]/u,
138
+ escapeTest: /[&<>"']/,
139
+ escapeReplace: /[&<>"']/g,
140
+ escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,
141
+ escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,
142
+ unescapeTest: /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,
143
+ caret: /(^|[^\[])\^/g,
144
+ percentDecode: /%25/g,
145
+ findPipe: /\|/g,
146
+ splitPipe: / \|/,
147
+ slashPipe: /\\\|/g,
148
+ carriageReturn: /\r\n|\r/g,
149
+ spaceLine: /^ +$/gm,
150
+ notSpaceStart: /^\S*/,
151
+ endingNewline: /\n$/,
152
+ listItemRegex: (bull) => new RegExp(`^( {0,3}${bull})((?:[ ][^\\n]*)?(?:\\n|$))`),
153
+ nextBulletRegex: (indent) => new RegExp(`^ {0,${Math.min(3, indent - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),
154
+ hrRegex: (indent) => new RegExp(`^ {0,${Math.min(3, indent - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),
155
+ fencesBeginRegex: (indent) => new RegExp(`^ {0,${Math.min(3, indent - 1)}}(?:\`\`\`|~~~)`),
156
+ headingBeginRegex: (indent) => new RegExp(`^ {0,${Math.min(3, indent - 1)}}#`),
157
+ htmlBeginRegex: (indent) => new RegExp(`^ {0,${Math.min(3, indent - 1)}}<(?:[a-z].*>|!--)`, "i")
158
+ };
159
+ var newline = /^(?:[ \t]*(?:\n|$))+/;
160
+ var blockCode = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/;
161
+ var fences = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/;
162
+ var hr = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/;
163
+ var heading = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/;
164
+ var bullet = /(?:[*+-]|\d{1,9}[.)])/;
165
+ var lheadingCore = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/;
166
+ var lheading = edit(lheadingCore).replace(/bull/g, bullet).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex();
167
+ var lheadingGfm = edit(lheadingCore).replace(/bull/g, bullet).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex();
168
+ var _paragraph = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/;
169
+ var blockText = /^[^\n]+/;
170
+ var _blockLabel = /(?!\s*\])(?:\\.|[^\[\]\\])+/;
171
+ var def = edit(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", _blockLabel).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex();
172
+ var list = edit(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, bullet).getRegex();
173
+ var _tag = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul";
174
+ var _comment = /<!--(?:-?>|[\s\S]*?(?:-->|$))/;
175
+ var html = edit(
176
+ "^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))",
177
+ "i"
178
+ ).replace("comment", _comment).replace("tag", _tag).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();
179
+ var paragraph = edit(_paragraph).replace("hr", hr).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", _tag).getRegex();
180
+ var blockquote = edit(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", paragraph).getRegex();
181
+ var blockNormal = {
182
+ blockquote,
183
+ code: blockCode,
184
+ def,
185
+ fences,
186
+ heading,
187
+ hr,
188
+ html,
189
+ lheading,
190
+ list,
191
+ newline,
192
+ paragraph,
193
+ table: noopTest,
194
+ text: blockText
195
+ };
196
+ var gfmTable = edit(
197
+ "^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"
198
+ ).replace("hr", hr).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", _tag).getRegex();
199
+ var blockGfm = {
200
+ ...blockNormal,
201
+ lheading: lheadingGfm,
202
+ table: gfmTable,
203
+ paragraph: edit(_paragraph).replace("hr", hr).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", gfmTable).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", _tag).getRegex()
204
+ };
205
+ var blockPedantic = {
206
+ ...blockNormal,
207
+ html: edit(
208
+ `^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`
209
+ ).replace("comment", _comment).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),
210
+ def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
211
+ heading: /^(#{1,6})(.*)(?:\n+|$)/,
212
+ fences: noopTest,
213
+ // fences not supported
214
+ lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
215
+ paragraph: edit(_paragraph).replace("hr", hr).replace("heading", " *#{1,6} *[^\n]").replace("lheading", lheading).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
216
+ };
217
+ var escape = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/;
218
+ var inlineCode = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/;
219
+ var br = /^( {2,}|\\)\n(?!\s*$)/;
220
+ var inlineText = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/;
221
+ var _punctuation = /[\p{P}\p{S}]/u;
222
+ var _punctuationOrSpace = /[\s\p{P}\p{S}]/u;
223
+ var _notPunctuationOrSpace = /[^\s\p{P}\p{S}]/u;
224
+ var punctuation = edit(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, _punctuationOrSpace).getRegex();
225
+ var _punctuationGfmStrongEm = /(?!~)[\p{P}\p{S}]/u;
226
+ var _punctuationOrSpaceGfmStrongEm = /(?!~)[\s\p{P}\p{S}]/u;
227
+ var _notPunctuationOrSpaceGfmStrongEm = /(?:[^\s\p{P}\p{S}]|~)/u;
228
+ var blockSkip = /\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g;
229
+ var emStrongLDelimCore = /^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/;
230
+ var emStrongLDelim = edit(emStrongLDelimCore, "u").replace(/punct/g, _punctuation).getRegex();
231
+ var emStrongLDelimGfm = edit(emStrongLDelimCore, "u").replace(/punct/g, _punctuationGfmStrongEm).getRegex();
232
+ var emStrongRDelimAstCore = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)";
233
+ var emStrongRDelimAst = edit(emStrongRDelimAstCore, "gu").replace(/notPunctSpace/g, _notPunctuationOrSpace).replace(/punctSpace/g, _punctuationOrSpace).replace(/punct/g, _punctuation).getRegex();
234
+ var emStrongRDelimAstGfm = edit(emStrongRDelimAstCore, "gu").replace(/notPunctSpace/g, _notPunctuationOrSpaceGfmStrongEm).replace(/punctSpace/g, _punctuationOrSpaceGfmStrongEm).replace(/punct/g, _punctuationGfmStrongEm).getRegex();
235
+ var emStrongRDelimUnd = edit(
236
+ "^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)",
237
+ "gu"
238
+ ).replace(/notPunctSpace/g, _notPunctuationOrSpace).replace(/punctSpace/g, _punctuationOrSpace).replace(/punct/g, _punctuation).getRegex();
239
+ var anyPunctuation = edit(/\\(punct)/, "gu").replace(/punct/g, _punctuation).getRegex();
240
+ var autolink = edit(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[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])?)+(?![-_])/).getRegex();
241
+ var _inlineComment = edit(_comment).replace("(?:-->|$)", "-->").getRegex();
242
+ var tag = edit(
243
+ "^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>"
244
+ ).replace("comment", _inlineComment).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex();
245
+ var _inlineLabel = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;
246
+ var link = edit(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label", _inlineLabel).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex();
247
+ var reflink = edit(/^!?\[(label)\]\[(ref)\]/).replace("label", _inlineLabel).replace("ref", _blockLabel).getRegex();
248
+ var nolink = edit(/^!?\[(ref)\](?:\[\])?/).replace("ref", _blockLabel).getRegex();
249
+ var reflinkSearch = edit("reflink|nolink(?!\\()", "g").replace("reflink", reflink).replace("nolink", nolink).getRegex();
250
+ var inlineNormal = {
251
+ _backpedal: noopTest,
252
+ // only used for GFM url
253
+ anyPunctuation,
254
+ autolink,
255
+ blockSkip,
256
+ br,
257
+ code: inlineCode,
258
+ del: noopTest,
259
+ emStrongLDelim,
260
+ emStrongRDelimAst,
261
+ emStrongRDelimUnd,
262
+ escape,
263
+ link,
264
+ nolink,
265
+ punctuation,
266
+ reflink,
267
+ reflinkSearch,
268
+ tag,
269
+ text: inlineText,
270
+ url: noopTest
271
+ };
272
+ var inlinePedantic = {
273
+ ...inlineNormal,
274
+ link: edit(/^!?\[(label)\]\((.*?)\)/).replace("label", _inlineLabel).getRegex(),
275
+ reflink: edit(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", _inlineLabel).getRegex()
276
+ };
277
+ var inlineGfm = {
278
+ ...inlineNormal,
279
+ emStrongRDelimAst: emStrongRDelimAstGfm,
280
+ emStrongLDelim: emStrongLDelimGfm,
281
+ url: edit(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/, "i").replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),
282
+ _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
283
+ del: /^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,
284
+ text: /^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/
285
+ };
286
+ var inlineBreaks = {
287
+ ...inlineGfm,
288
+ br: edit(br).replace("{2,}", "*").getRegex(),
289
+ text: edit(inlineGfm.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
290
+ };
291
+ var block = {
292
+ normal: blockNormal,
293
+ gfm: blockGfm,
294
+ pedantic: blockPedantic
295
+ };
296
+ var inline = {
297
+ normal: inlineNormal,
298
+ gfm: inlineGfm,
299
+ breaks: inlineBreaks,
300
+ pedantic: inlinePedantic
301
+ };
302
+
303
+ // src/helpers.ts
304
+ var escapeReplacements = {
305
+ "&": "&amp;",
306
+ "<": "&lt;",
307
+ ">": "&gt;",
308
+ '"': "&quot;",
309
+ "'": "&#39;"
310
+ };
311
+ var getEscapeReplacement = (ch) => escapeReplacements[ch];
312
+ function escape2(html2, encode) {
313
+ if (encode) {
314
+ if (other.escapeTest.test(html2)) {
315
+ return html2.replace(other.escapeReplace, getEscapeReplacement);
316
+ }
317
+ } else {
318
+ if (other.escapeTestNoEncode.test(html2)) {
319
+ return html2.replace(other.escapeReplaceNoEncode, getEscapeReplacement);
320
+ }
321
+ }
322
+ return html2;
323
+ }
324
+ function cleanUrl(href) {
325
+ try {
326
+ href = encodeURI(href).replace(other.percentDecode, "%");
327
+ } catch {
328
+ return null;
329
+ }
330
+ return href;
331
+ }
332
+ function splitCells(tableRow, count) {
333
+ const row = tableRow.replace(other.findPipe, (match, offset, str) => {
334
+ let escaped = false;
335
+ let curr = offset;
336
+ while (--curr >= 0 && str[curr] === "\\") escaped = !escaped;
337
+ if (escaped) {
338
+ return "|";
339
+ } else {
340
+ return " |";
341
+ }
342
+ }), cells = row.split(other.splitPipe);
343
+ let i = 0;
344
+ if (!cells[0].trim()) {
345
+ cells.shift();
346
+ }
347
+ if (cells.length > 0 && !cells.at(-1)?.trim()) {
348
+ cells.pop();
349
+ }
350
+ if (count) {
351
+ if (cells.length > count) {
352
+ cells.splice(count);
353
+ } else {
354
+ while (cells.length < count) cells.push("");
355
+ }
356
+ }
357
+ for (; i < cells.length; i++) {
358
+ cells[i] = cells[i].trim().replace(other.slashPipe, "|");
359
+ }
360
+ return cells;
361
+ }
362
+ function rtrim(str, c, invert) {
363
+ const l = str.length;
364
+ if (l === 0) {
365
+ return "";
366
+ }
367
+ let suffLen = 0;
368
+ while (suffLen < l) {
369
+ const currChar = str.charAt(l - suffLen - 1);
370
+ if (currChar === c && !invert) {
371
+ suffLen++;
372
+ } else if (currChar !== c && invert) {
373
+ suffLen++;
374
+ } else {
375
+ break;
376
+ }
377
+ }
378
+ return str.slice(0, l - suffLen);
379
+ }
380
+ function findClosingBracket(str, b) {
381
+ if (str.indexOf(b[1]) === -1) {
382
+ return -1;
383
+ }
384
+ let level = 0;
385
+ for (let i = 0; i < str.length; i++) {
386
+ if (str[i] === "\\") {
387
+ i++;
388
+ } else if (str[i] === b[0]) {
389
+ level++;
390
+ } else if (str[i] === b[1]) {
391
+ level--;
392
+ if (level < 0) {
393
+ return i;
394
+ }
395
+ }
396
+ }
397
+ if (level > 0) {
398
+ return -2;
399
+ }
400
+ return -1;
401
+ }
402
+
403
+ // src/Tokenizer.ts
404
+ function outputLink(cap, link2, raw, lexer2, rules) {
405
+ const href = link2.href;
406
+ const title = link2.title || null;
407
+ const text = cap[1].replace(rules.other.outputLinkReplace, "$1");
408
+ lexer2.state.inLink = true;
409
+ const token = {
410
+ type: cap[0].charAt(0) === "!" ? "image" : "link",
411
+ raw,
412
+ href,
413
+ title,
414
+ text,
415
+ tokens: lexer2.inlineTokens(text)
416
+ };
417
+ lexer2.state.inLink = false;
418
+ return token;
419
+ }
420
+ function indentCodeCompensation(raw, text, rules) {
421
+ const matchIndentToCode = raw.match(rules.other.indentCodeCompensation);
422
+ if (matchIndentToCode === null) {
423
+ return text;
424
+ }
425
+ const indentToCode = matchIndentToCode[1];
426
+ return text.split("\n").map((node) => {
427
+ const matchIndentInNode = node.match(rules.other.beginningSpace);
428
+ if (matchIndentInNode === null) {
429
+ return node;
430
+ }
431
+ const [indentInNode] = matchIndentInNode;
432
+ if (indentInNode.length >= indentToCode.length) {
433
+ return node.slice(indentToCode.length);
434
+ }
435
+ return node;
436
+ }).join("\n");
437
+ }
438
+ var _Tokenizer = class {
439
+ options;
440
+ rules;
441
+ // set by the lexer
442
+ lexer;
443
+ // set by the lexer
444
+ constructor(options2) {
445
+ this.options = options2 || _defaults;
446
+ }
447
+ space(src) {
448
+ const cap = this.rules.block.newline.exec(src);
449
+ if (cap && cap[0].length > 0) {
450
+ return {
451
+ type: "space",
452
+ raw: cap[0]
453
+ };
454
+ }
455
+ }
456
+ code(src) {
457
+ const cap = this.rules.block.code.exec(src);
458
+ if (cap) {
459
+ const text = cap[0].replace(this.rules.other.codeRemoveIndent, "");
460
+ return {
461
+ type: "code",
462
+ raw: cap[0],
463
+ codeBlockStyle: "indented",
464
+ text: !this.options.pedantic ? rtrim(text, "\n") : text
465
+ };
466
+ }
467
+ }
468
+ fences(src) {
469
+ const cap = this.rules.block.fences.exec(src);
470
+ if (cap) {
471
+ const raw = cap[0];
472
+ const text = indentCodeCompensation(raw, cap[3] || "", this.rules);
473
+ return {
474
+ type: "code",
475
+ raw,
476
+ lang: cap[2] ? cap[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : cap[2],
477
+ text
478
+ };
479
+ }
480
+ }
481
+ heading(src) {
482
+ const cap = this.rules.block.heading.exec(src);
483
+ if (cap) {
484
+ let text = cap[2].trim();
485
+ if (this.rules.other.endingHash.test(text)) {
486
+ const trimmed = rtrim(text, "#");
487
+ if (this.options.pedantic) {
488
+ text = trimmed.trim();
489
+ } else if (!trimmed || this.rules.other.endingSpaceChar.test(trimmed)) {
490
+ text = trimmed.trim();
491
+ }
492
+ }
493
+ return {
494
+ type: "heading",
495
+ raw: cap[0],
496
+ depth: cap[1].length,
497
+ text,
498
+ tokens: this.lexer.inline(text)
499
+ };
500
+ }
501
+ }
502
+ hr(src) {
503
+ const cap = this.rules.block.hr.exec(src);
504
+ if (cap) {
505
+ return {
506
+ type: "hr",
507
+ raw: rtrim(cap[0], "\n")
508
+ };
509
+ }
510
+ }
511
+ blockquote(src) {
512
+ const cap = this.rules.block.blockquote.exec(src);
513
+ if (cap) {
514
+ let lines = rtrim(cap[0], "\n").split("\n");
515
+ let raw = "";
516
+ let text = "";
517
+ const tokens = [];
518
+ while (lines.length > 0) {
519
+ let inBlockquote = false;
520
+ const currentLines = [];
521
+ let i;
522
+ for (i = 0; i < lines.length; i++) {
523
+ if (this.rules.other.blockquoteStart.test(lines[i])) {
524
+ currentLines.push(lines[i]);
525
+ inBlockquote = true;
526
+ } else if (!inBlockquote) {
527
+ currentLines.push(lines[i]);
528
+ } else {
529
+ break;
530
+ }
531
+ }
532
+ lines = lines.slice(i);
533
+ const currentRaw = currentLines.join("\n");
534
+ const currentText = currentRaw.replace(this.rules.other.blockquoteSetextReplace, "\n $1").replace(this.rules.other.blockquoteSetextReplace2, "");
535
+ raw = raw ? `${raw}
536
+ ${currentRaw}` : currentRaw;
537
+ text = text ? `${text}
538
+ ${currentText}` : currentText;
539
+ const top = this.lexer.state.top;
540
+ this.lexer.state.top = true;
541
+ this.lexer.blockTokens(currentText, tokens, true);
542
+ this.lexer.state.top = top;
543
+ if (lines.length === 0) {
544
+ break;
545
+ }
546
+ const lastToken = tokens.at(-1);
547
+ if (lastToken?.type === "code") {
548
+ break;
549
+ } else if (lastToken?.type === "blockquote") {
550
+ const oldToken = lastToken;
551
+ const newText = oldToken.raw + "\n" + lines.join("\n");
552
+ const newToken = this.blockquote(newText);
553
+ tokens[tokens.length - 1] = newToken;
554
+ raw = raw.substring(0, raw.length - oldToken.raw.length) + newToken.raw;
555
+ text = text.substring(0, text.length - oldToken.text.length) + newToken.text;
556
+ break;
557
+ } else if (lastToken?.type === "list") {
558
+ const oldToken = lastToken;
559
+ const newText = oldToken.raw + "\n" + lines.join("\n");
560
+ const newToken = this.list(newText);
561
+ tokens[tokens.length - 1] = newToken;
562
+ raw = raw.substring(0, raw.length - lastToken.raw.length) + newToken.raw;
563
+ text = text.substring(0, text.length - oldToken.raw.length) + newToken.raw;
564
+ lines = newText.substring(tokens.at(-1).raw.length).split("\n");
565
+ continue;
566
+ }
567
+ }
568
+ return {
569
+ type: "blockquote",
570
+ raw,
571
+ tokens,
572
+ text
573
+ };
574
+ }
575
+ }
576
+ list(src) {
577
+ let cap = this.rules.block.list.exec(src);
578
+ if (cap) {
579
+ let bull = cap[1].trim();
580
+ const isordered = bull.length > 1;
581
+ const list2 = {
582
+ type: "list",
583
+ raw: "",
584
+ ordered: isordered,
585
+ start: isordered ? +bull.slice(0, -1) : "",
586
+ loose: false,
587
+ items: []
588
+ };
589
+ bull = isordered ? `\\d{1,9}\\${bull.slice(-1)}` : `\\${bull}`;
590
+ if (this.options.pedantic) {
591
+ bull = isordered ? bull : "[*+-]";
592
+ }
593
+ const itemRegex = this.rules.other.listItemRegex(bull);
594
+ let endsWithBlankLine = false;
595
+ while (src) {
596
+ let endEarly = false;
597
+ let raw = "";
598
+ let itemContents = "";
599
+ if (!(cap = itemRegex.exec(src))) {
600
+ break;
601
+ }
602
+ if (this.rules.block.hr.test(src)) {
603
+ break;
604
+ }
605
+ raw = cap[0];
606
+ src = src.substring(raw.length);
607
+ let line = cap[2].split("\n", 1)[0].replace(this.rules.other.listReplaceTabs, (t) => " ".repeat(3 * t.length));
608
+ let nextLine = src.split("\n", 1)[0];
609
+ let blankLine = !line.trim();
610
+ let indent = 0;
611
+ if (this.options.pedantic) {
612
+ indent = 2;
613
+ itemContents = line.trimStart();
614
+ } else if (blankLine) {
615
+ indent = cap[1].length + 1;
616
+ } else {
617
+ indent = cap[2].search(this.rules.other.nonSpaceChar);
618
+ indent = indent > 4 ? 1 : indent;
619
+ itemContents = line.slice(indent);
620
+ indent += cap[1].length;
621
+ }
622
+ if (blankLine && this.rules.other.blankLine.test(nextLine)) {
623
+ raw += nextLine + "\n";
624
+ src = src.substring(nextLine.length + 1);
625
+ endEarly = true;
626
+ }
627
+ if (!endEarly) {
628
+ const nextBulletRegex = this.rules.other.nextBulletRegex(indent);
629
+ const hrRegex = this.rules.other.hrRegex(indent);
630
+ const fencesBeginRegex = this.rules.other.fencesBeginRegex(indent);
631
+ const headingBeginRegex = this.rules.other.headingBeginRegex(indent);
632
+ const htmlBeginRegex = this.rules.other.htmlBeginRegex(indent);
633
+ while (src) {
634
+ const rawLine = src.split("\n", 1)[0];
635
+ let nextLineWithoutTabs;
636
+ nextLine = rawLine;
637
+ if (this.options.pedantic) {
638
+ nextLine = nextLine.replace(this.rules.other.listReplaceNesting, " ");
639
+ nextLineWithoutTabs = nextLine;
640
+ } else {
641
+ nextLineWithoutTabs = nextLine.replace(this.rules.other.tabCharGlobal, " ");
642
+ }
643
+ if (fencesBeginRegex.test(nextLine)) {
644
+ break;
645
+ }
646
+ if (headingBeginRegex.test(nextLine)) {
647
+ break;
648
+ }
649
+ if (htmlBeginRegex.test(nextLine)) {
650
+ break;
651
+ }
652
+ if (nextBulletRegex.test(nextLine)) {
653
+ break;
654
+ }
655
+ if (hrRegex.test(nextLine)) {
656
+ break;
657
+ }
658
+ if (nextLineWithoutTabs.search(this.rules.other.nonSpaceChar) >= indent || !nextLine.trim()) {
659
+ itemContents += "\n" + nextLineWithoutTabs.slice(indent);
660
+ } else {
661
+ if (blankLine) {
662
+ break;
663
+ }
664
+ if (line.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4) {
665
+ break;
666
+ }
667
+ if (fencesBeginRegex.test(line)) {
668
+ break;
669
+ }
670
+ if (headingBeginRegex.test(line)) {
671
+ break;
672
+ }
673
+ if (hrRegex.test(line)) {
674
+ break;
675
+ }
676
+ itemContents += "\n" + nextLine;
677
+ }
678
+ if (!blankLine && !nextLine.trim()) {
679
+ blankLine = true;
680
+ }
681
+ raw += rawLine + "\n";
682
+ src = src.substring(rawLine.length + 1);
683
+ line = nextLineWithoutTabs.slice(indent);
684
+ }
685
+ }
686
+ if (!list2.loose) {
687
+ if (endsWithBlankLine) {
688
+ list2.loose = true;
689
+ } else if (this.rules.other.doubleBlankLine.test(raw)) {
690
+ endsWithBlankLine = true;
691
+ }
692
+ }
693
+ let istask = null;
694
+ let ischecked;
695
+ if (this.options.gfm) {
696
+ istask = this.rules.other.listIsTask.exec(itemContents);
697
+ if (istask) {
698
+ ischecked = istask[0] !== "[ ] ";
699
+ itemContents = itemContents.replace(this.rules.other.listReplaceTask, "");
700
+ }
701
+ }
702
+ list2.items.push({
703
+ type: "list_item",
704
+ raw,
705
+ task: !!istask,
706
+ checked: ischecked,
707
+ loose: false,
708
+ text: itemContents,
709
+ tokens: []
710
+ });
711
+ list2.raw += raw;
712
+ }
713
+ const lastItem = list2.items.at(-1);
714
+ if (lastItem) {
715
+ lastItem.raw = lastItem.raw.trimEnd();
716
+ lastItem.text = lastItem.text.trimEnd();
717
+ } else {
718
+ return;
719
+ }
720
+ list2.raw = list2.raw.trimEnd();
721
+ for (let i = 0; i < list2.items.length; i++) {
722
+ this.lexer.state.top = false;
723
+ list2.items[i].tokens = this.lexer.blockTokens(list2.items[i].text, []);
724
+ if (!list2.loose) {
725
+ const spacers = list2.items[i].tokens.filter((t) => t.type === "space");
726
+ const hasMultipleLineBreaks = spacers.length > 0 && spacers.some((t) => this.rules.other.anyLine.test(t.raw));
727
+ list2.loose = hasMultipleLineBreaks;
728
+ }
729
+ }
730
+ if (list2.loose) {
731
+ for (let i = 0; i < list2.items.length; i++) {
732
+ list2.items[i].loose = true;
733
+ }
734
+ }
735
+ return list2;
736
+ }
737
+ }
738
+ html(src) {
739
+ const cap = this.rules.block.html.exec(src);
740
+ if (cap) {
741
+ const token = {
742
+ type: "html",
743
+ block: true,
744
+ raw: cap[0],
745
+ pre: cap[1] === "pre" || cap[1] === "script" || cap[1] === "style",
746
+ text: cap[0]
747
+ };
748
+ return token;
749
+ }
750
+ }
751
+ def(src) {
752
+ const cap = this.rules.block.def.exec(src);
753
+ if (cap) {
754
+ const tag2 = cap[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal, " ");
755
+ const href = cap[2] ? cap[2].replace(this.rules.other.hrefBrackets, "$1").replace(this.rules.inline.anyPunctuation, "$1") : "";
756
+ const title = cap[3] ? cap[3].substring(1, cap[3].length - 1).replace(this.rules.inline.anyPunctuation, "$1") : cap[3];
757
+ return {
758
+ type: "def",
759
+ tag: tag2,
760
+ raw: cap[0],
761
+ href,
762
+ title
763
+ };
764
+ }
765
+ }
766
+ table(src) {
767
+ const cap = this.rules.block.table.exec(src);
768
+ if (!cap) {
769
+ return;
770
+ }
771
+ if (!this.rules.other.tableDelimiter.test(cap[2])) {
772
+ return;
773
+ }
774
+ const headers = splitCells(cap[1]);
775
+ const aligns = cap[2].replace(this.rules.other.tableAlignChars, "").split("|");
776
+ const rows = cap[3]?.trim() ? cap[3].replace(this.rules.other.tableRowBlankLine, "").split("\n") : [];
777
+ const item = {
778
+ type: "table",
779
+ raw: cap[0],
780
+ header: [],
781
+ align: [],
782
+ rows: []
783
+ };
784
+ if (headers.length !== aligns.length) {
785
+ return;
786
+ }
787
+ for (const align of aligns) {
788
+ if (this.rules.other.tableAlignRight.test(align)) {
789
+ item.align.push("right");
790
+ } else if (this.rules.other.tableAlignCenter.test(align)) {
791
+ item.align.push("center");
792
+ } else if (this.rules.other.tableAlignLeft.test(align)) {
793
+ item.align.push("left");
794
+ } else {
795
+ item.align.push(null);
796
+ }
797
+ }
798
+ for (let i = 0; i < headers.length; i++) {
799
+ item.header.push({
800
+ text: headers[i],
801
+ tokens: this.lexer.inline(headers[i]),
802
+ header: true,
803
+ align: item.align[i]
804
+ });
805
+ }
806
+ for (const row of rows) {
807
+ item.rows.push(splitCells(row, item.header.length).map((cell, i) => {
808
+ return {
809
+ text: cell,
810
+ tokens: this.lexer.inline(cell),
811
+ header: false,
812
+ align: item.align[i]
813
+ };
814
+ }));
815
+ }
816
+ return item;
817
+ }
818
+ lheading(src) {
819
+ const cap = this.rules.block.lheading.exec(src);
820
+ if (cap) {
821
+ return {
822
+ type: "heading",
823
+ raw: cap[0],
824
+ depth: cap[2].charAt(0) === "=" ? 1 : 2,
825
+ text: cap[1],
826
+ tokens: this.lexer.inline(cap[1])
827
+ };
828
+ }
829
+ }
830
+ paragraph(src) {
831
+ const cap = this.rules.block.paragraph.exec(src);
832
+ if (cap) {
833
+ const text = cap[1].charAt(cap[1].length - 1) === "\n" ? cap[1].slice(0, -1) : cap[1];
834
+ return {
835
+ type: "paragraph",
836
+ raw: cap[0],
837
+ text,
838
+ tokens: this.lexer.inline(text)
839
+ };
840
+ }
841
+ }
842
+ text(src) {
843
+ const cap = this.rules.block.text.exec(src);
844
+ if (cap) {
845
+ return {
846
+ type: "text",
847
+ raw: cap[0],
848
+ text: cap[0],
849
+ tokens: this.lexer.inline(cap[0])
850
+ };
851
+ }
852
+ }
853
+ escape(src) {
854
+ const cap = this.rules.inline.escape.exec(src);
855
+ if (cap) {
856
+ return {
857
+ type: "escape",
858
+ raw: cap[0],
859
+ text: cap[1]
860
+ };
861
+ }
862
+ }
863
+ tag(src) {
864
+ const cap = this.rules.inline.tag.exec(src);
865
+ if (cap) {
866
+ if (!this.lexer.state.inLink && this.rules.other.startATag.test(cap[0])) {
867
+ this.lexer.state.inLink = true;
868
+ } else if (this.lexer.state.inLink && this.rules.other.endATag.test(cap[0])) {
869
+ this.lexer.state.inLink = false;
870
+ }
871
+ if (!this.lexer.state.inRawBlock && this.rules.other.startPreScriptTag.test(cap[0])) {
872
+ this.lexer.state.inRawBlock = true;
873
+ } else if (this.lexer.state.inRawBlock && this.rules.other.endPreScriptTag.test(cap[0])) {
874
+ this.lexer.state.inRawBlock = false;
875
+ }
876
+ return {
877
+ type: "html",
878
+ raw: cap[0],
879
+ inLink: this.lexer.state.inLink,
880
+ inRawBlock: this.lexer.state.inRawBlock,
881
+ block: false,
882
+ text: cap[0]
883
+ };
884
+ }
885
+ }
886
+ link(src) {
887
+ const cap = this.rules.inline.link.exec(src);
888
+ if (cap) {
889
+ const trimmedUrl = cap[2].trim();
890
+ if (!this.options.pedantic && this.rules.other.startAngleBracket.test(trimmedUrl)) {
891
+ if (!this.rules.other.endAngleBracket.test(trimmedUrl)) {
892
+ return;
893
+ }
894
+ const rtrimSlash = rtrim(trimmedUrl.slice(0, -1), "\\");
895
+ if ((trimmedUrl.length - rtrimSlash.length) % 2 === 0) {
896
+ return;
897
+ }
898
+ } else {
899
+ const lastParenIndex = findClosingBracket(cap[2], "()");
900
+ if (lastParenIndex === -2) {
901
+ return;
902
+ }
903
+ if (lastParenIndex > -1) {
904
+ const start = cap[0].indexOf("!") === 0 ? 5 : 4;
905
+ const linkLen = start + cap[1].length + lastParenIndex;
906
+ cap[2] = cap[2].substring(0, lastParenIndex);
907
+ cap[0] = cap[0].substring(0, linkLen).trim();
908
+ cap[3] = "";
909
+ }
910
+ }
911
+ let href = cap[2];
912
+ let title = "";
913
+ if (this.options.pedantic) {
914
+ const link2 = this.rules.other.pedanticHrefTitle.exec(href);
915
+ if (link2) {
916
+ href = link2[1];
917
+ title = link2[3];
918
+ }
919
+ } else {
920
+ title = cap[3] ? cap[3].slice(1, -1) : "";
921
+ }
922
+ href = href.trim();
923
+ if (this.rules.other.startAngleBracket.test(href)) {
924
+ if (this.options.pedantic && !this.rules.other.endAngleBracket.test(trimmedUrl)) {
925
+ href = href.slice(1);
926
+ } else {
927
+ href = href.slice(1, -1);
928
+ }
929
+ }
930
+ return outputLink(cap, {
931
+ href: href ? href.replace(this.rules.inline.anyPunctuation, "$1") : href,
932
+ title: title ? title.replace(this.rules.inline.anyPunctuation, "$1") : title
933
+ }, cap[0], this.lexer, this.rules);
934
+ }
935
+ }
936
+ reflink(src, links) {
937
+ let cap;
938
+ if ((cap = this.rules.inline.reflink.exec(src)) || (cap = this.rules.inline.nolink.exec(src))) {
939
+ const linkString = (cap[2] || cap[1]).replace(this.rules.other.multipleSpaceGlobal, " ");
940
+ const link2 = links[linkString.toLowerCase()];
941
+ if (!link2) {
942
+ const text = cap[0].charAt(0);
943
+ return {
944
+ type: "text",
945
+ raw: text,
946
+ text
947
+ };
948
+ }
949
+ return outputLink(cap, link2, cap[0], this.lexer, this.rules);
950
+ }
951
+ }
952
+ emStrong(src, maskedSrc, prevChar = "") {
953
+ let match = this.rules.inline.emStrongLDelim.exec(src);
954
+ if (!match) return;
955
+ if (match[3] && prevChar.match(this.rules.other.unicodeAlphaNumeric)) return;
956
+ const nextChar = match[1] || match[2] || "";
957
+ if (!nextChar || !prevChar || this.rules.inline.punctuation.exec(prevChar)) {
958
+ const lLength = [...match[0]].length - 1;
959
+ let rDelim, rLength, delimTotal = lLength, midDelimTotal = 0;
960
+ const endReg = match[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
961
+ endReg.lastIndex = 0;
962
+ maskedSrc = maskedSrc.slice(-1 * src.length + lLength);
963
+ while ((match = endReg.exec(maskedSrc)) != null) {
964
+ rDelim = match[1] || match[2] || match[3] || match[4] || match[5] || match[6];
965
+ if (!rDelim) continue;
966
+ rLength = [...rDelim].length;
967
+ if (match[3] || match[4]) {
968
+ delimTotal += rLength;
969
+ continue;
970
+ } else if (match[5] || match[6]) {
971
+ if (lLength % 3 && !((lLength + rLength) % 3)) {
972
+ midDelimTotal += rLength;
973
+ continue;
974
+ }
975
+ }
976
+ delimTotal -= rLength;
977
+ if (delimTotal > 0) continue;
978
+ rLength = Math.min(rLength, rLength + delimTotal + midDelimTotal);
979
+ const lastCharLength = [...match[0]][0].length;
980
+ const raw = src.slice(0, lLength + match.index + lastCharLength + rLength);
981
+ if (Math.min(lLength, rLength) % 2) {
982
+ const text2 = raw.slice(1, -1);
983
+ return {
984
+ type: "em",
985
+ raw,
986
+ text: text2,
987
+ tokens: this.lexer.inlineTokens(text2)
988
+ };
989
+ }
990
+ const text = raw.slice(2, -2);
991
+ return {
992
+ type: "strong",
993
+ raw,
994
+ text,
995
+ tokens: this.lexer.inlineTokens(text)
996
+ };
997
+ }
998
+ }
999
+ }
1000
+ codespan(src) {
1001
+ const cap = this.rules.inline.code.exec(src);
1002
+ if (cap) {
1003
+ let text = cap[2].replace(this.rules.other.newLineCharGlobal, " ");
1004
+ const hasNonSpaceChars = this.rules.other.nonSpaceChar.test(text);
1005
+ const hasSpaceCharsOnBothEnds = this.rules.other.startingSpaceChar.test(text) && this.rules.other.endingSpaceChar.test(text);
1006
+ if (hasNonSpaceChars && hasSpaceCharsOnBothEnds) {
1007
+ text = text.substring(1, text.length - 1);
1008
+ }
1009
+ return {
1010
+ type: "codespan",
1011
+ raw: cap[0],
1012
+ text
1013
+ };
1014
+ }
1015
+ }
1016
+ br(src) {
1017
+ const cap = this.rules.inline.br.exec(src);
1018
+ if (cap) {
1019
+ return {
1020
+ type: "br",
1021
+ raw: cap[0]
1022
+ };
1023
+ }
1024
+ }
1025
+ del(src) {
1026
+ const cap = this.rules.inline.del.exec(src);
1027
+ if (cap) {
1028
+ return {
1029
+ type: "del",
1030
+ raw: cap[0],
1031
+ text: cap[2],
1032
+ tokens: this.lexer.inlineTokens(cap[2])
1033
+ };
1034
+ }
1035
+ }
1036
+ autolink(src) {
1037
+ const cap = this.rules.inline.autolink.exec(src);
1038
+ if (cap) {
1039
+ let text, href;
1040
+ if (cap[2] === "@") {
1041
+ text = cap[1];
1042
+ href = "mailto:" + text;
1043
+ } else {
1044
+ text = cap[1];
1045
+ href = text;
1046
+ }
1047
+ return {
1048
+ type: "link",
1049
+ raw: cap[0],
1050
+ text,
1051
+ href,
1052
+ tokens: [
1053
+ {
1054
+ type: "text",
1055
+ raw: text,
1056
+ text
1057
+ }
1058
+ ]
1059
+ };
1060
+ }
1061
+ }
1062
+ url(src) {
1063
+ let cap;
1064
+ if (cap = this.rules.inline.url.exec(src)) {
1065
+ let text, href;
1066
+ if (cap[2] === "@") {
1067
+ text = cap[0];
1068
+ href = "mailto:" + text;
1069
+ } else {
1070
+ let prevCapZero;
1071
+ do {
1072
+ prevCapZero = cap[0];
1073
+ cap[0] = this.rules.inline._backpedal.exec(cap[0])?.[0] ?? "";
1074
+ } while (prevCapZero !== cap[0]);
1075
+ text = cap[0];
1076
+ if (cap[1] === "www.") {
1077
+ href = "http://" + cap[0];
1078
+ } else {
1079
+ href = cap[0];
1080
+ }
1081
+ }
1082
+ return {
1083
+ type: "link",
1084
+ raw: cap[0],
1085
+ text,
1086
+ href,
1087
+ tokens: [
1088
+ {
1089
+ type: "text",
1090
+ raw: text,
1091
+ text
1092
+ }
1093
+ ]
1094
+ };
1095
+ }
1096
+ }
1097
+ inlineText(src) {
1098
+ const cap = this.rules.inline.text.exec(src);
1099
+ if (cap) {
1100
+ const escaped = this.lexer.state.inRawBlock;
1101
+ return {
1102
+ type: "text",
1103
+ raw: cap[0],
1104
+ text: cap[0],
1105
+ escaped
1106
+ };
1107
+ }
1108
+ }
1109
+ };
1110
+
1111
+ // src/Lexer.ts
1112
+ var _Lexer = class __Lexer {
1113
+ tokens;
1114
+ options;
1115
+ state;
1116
+ tokenizer;
1117
+ inlineQueue;
1118
+ constructor(options2) {
1119
+ this.tokens = [];
1120
+ this.tokens.links = /* @__PURE__ */ Object.create(null);
1121
+ this.options = options2 || _defaults;
1122
+ this.options.tokenizer = this.options.tokenizer || new _Tokenizer();
1123
+ this.tokenizer = this.options.tokenizer;
1124
+ this.tokenizer.options = this.options;
1125
+ this.tokenizer.lexer = this;
1126
+ this.inlineQueue = [];
1127
+ this.state = {
1128
+ inLink: false,
1129
+ inRawBlock: false,
1130
+ top: true
1131
+ };
1132
+ const rules = {
1133
+ other,
1134
+ block: block.normal,
1135
+ inline: inline.normal
1136
+ };
1137
+ if (this.options.pedantic) {
1138
+ rules.block = block.pedantic;
1139
+ rules.inline = inline.pedantic;
1140
+ } else if (this.options.gfm) {
1141
+ rules.block = block.gfm;
1142
+ if (this.options.breaks) {
1143
+ rules.inline = inline.breaks;
1144
+ } else {
1145
+ rules.inline = inline.gfm;
1146
+ }
1147
+ }
1148
+ this.tokenizer.rules = rules;
1149
+ }
1150
+ /**
1151
+ * Expose Rules
1152
+ */
1153
+ static get rules() {
1154
+ return {
1155
+ block,
1156
+ inline
1157
+ };
1158
+ }
1159
+ /**
1160
+ * Static Lex Method
1161
+ */
1162
+ static lex(src, options2) {
1163
+ const lexer2 = new __Lexer(options2);
1164
+ return lexer2.lex(src);
1165
+ }
1166
+ /**
1167
+ * Static Lex Inline Method
1168
+ */
1169
+ static lexInline(src, options2) {
1170
+ const lexer2 = new __Lexer(options2);
1171
+ return lexer2.inlineTokens(src);
1172
+ }
1173
+ /**
1174
+ * Preprocessing
1175
+ */
1176
+ lex(src) {
1177
+ src = src.replace(other.carriageReturn, "\n");
1178
+ this.blockTokens(src, this.tokens);
1179
+ for (let i = 0; i < this.inlineQueue.length; i++) {
1180
+ const next = this.inlineQueue[i];
1181
+ this.inlineTokens(next.src, next.tokens);
1182
+ }
1183
+ this.inlineQueue = [];
1184
+ return this.tokens;
1185
+ }
1186
+ blockTokens(src, tokens = [], lastParagraphClipped = false) {
1187
+ if (this.options.pedantic) {
1188
+ src = src.replace(other.tabCharGlobal, " ").replace(other.spaceLine, "");
1189
+ }
1190
+ while (src) {
1191
+ let token;
1192
+ if (this.options.extensions?.block?.some((extTokenizer) => {
1193
+ if (token = extTokenizer.call({ lexer: this }, src, tokens)) {
1194
+ src = src.substring(token.raw.length);
1195
+ tokens.push(token);
1196
+ return true;
1197
+ }
1198
+ return false;
1199
+ })) {
1200
+ continue;
1201
+ }
1202
+ if (token = this.tokenizer.space(src)) {
1203
+ src = src.substring(token.raw.length);
1204
+ const lastToken = tokens.at(-1);
1205
+ if (token.raw.length === 1 && lastToken !== void 0) {
1206
+ lastToken.raw += "\n";
1207
+ } else {
1208
+ tokens.push(token);
1209
+ }
1210
+ continue;
1211
+ }
1212
+ if (token = this.tokenizer.code(src)) {
1213
+ src = src.substring(token.raw.length);
1214
+ const lastToken = tokens.at(-1);
1215
+ if (lastToken?.type === "paragraph" || lastToken?.type === "text") {
1216
+ lastToken.raw += "\n" + token.raw;
1217
+ lastToken.text += "\n" + token.text;
1218
+ this.inlineQueue.at(-1).src = lastToken.text;
1219
+ } else {
1220
+ tokens.push(token);
1221
+ }
1222
+ continue;
1223
+ }
1224
+ if (token = this.tokenizer.fences(src)) {
1225
+ src = src.substring(token.raw.length);
1226
+ tokens.push(token);
1227
+ continue;
1228
+ }
1229
+ if (token = this.tokenizer.heading(src)) {
1230
+ src = src.substring(token.raw.length);
1231
+ tokens.push(token);
1232
+ continue;
1233
+ }
1234
+ if (token = this.tokenizer.hr(src)) {
1235
+ src = src.substring(token.raw.length);
1236
+ tokens.push(token);
1237
+ continue;
1238
+ }
1239
+ if (token = this.tokenizer.blockquote(src)) {
1240
+ src = src.substring(token.raw.length);
1241
+ tokens.push(token);
1242
+ continue;
1243
+ }
1244
+ if (token = this.tokenizer.list(src)) {
1245
+ src = src.substring(token.raw.length);
1246
+ tokens.push(token);
1247
+ continue;
1248
+ }
1249
+ if (token = this.tokenizer.html(src)) {
1250
+ src = src.substring(token.raw.length);
1251
+ tokens.push(token);
1252
+ continue;
1253
+ }
1254
+ if (token = this.tokenizer.def(src)) {
1255
+ src = src.substring(token.raw.length);
1256
+ const lastToken = tokens.at(-1);
1257
+ if (lastToken?.type === "paragraph" || lastToken?.type === "text") {
1258
+ lastToken.raw += "\n" + token.raw;
1259
+ lastToken.text += "\n" + token.raw;
1260
+ this.inlineQueue.at(-1).src = lastToken.text;
1261
+ } else if (!this.tokens.links[token.tag]) {
1262
+ this.tokens.links[token.tag] = {
1263
+ href: token.href,
1264
+ title: token.title
1265
+ };
1266
+ }
1267
+ continue;
1268
+ }
1269
+ if (token = this.tokenizer.table(src)) {
1270
+ src = src.substring(token.raw.length);
1271
+ tokens.push(token);
1272
+ continue;
1273
+ }
1274
+ if (token = this.tokenizer.lheading(src)) {
1275
+ src = src.substring(token.raw.length);
1276
+ tokens.push(token);
1277
+ continue;
1278
+ }
1279
+ let cutSrc = src;
1280
+ if (this.options.extensions?.startBlock) {
1281
+ let startIndex = Infinity;
1282
+ const tempSrc = src.slice(1);
1283
+ let tempStart;
1284
+ this.options.extensions.startBlock.forEach((getStartIndex) => {
1285
+ tempStart = getStartIndex.call({ lexer: this }, tempSrc);
1286
+ if (typeof tempStart === "number" && tempStart >= 0) {
1287
+ startIndex = Math.min(startIndex, tempStart);
1288
+ }
1289
+ });
1290
+ if (startIndex < Infinity && startIndex >= 0) {
1291
+ cutSrc = src.substring(0, startIndex + 1);
1292
+ }
1293
+ }
1294
+ if (this.state.top && (token = this.tokenizer.paragraph(cutSrc))) {
1295
+ const lastToken = tokens.at(-1);
1296
+ if (lastParagraphClipped && lastToken?.type === "paragraph") {
1297
+ lastToken.raw += "\n" + token.raw;
1298
+ lastToken.text += "\n" + token.text;
1299
+ this.inlineQueue.pop();
1300
+ this.inlineQueue.at(-1).src = lastToken.text;
1301
+ } else {
1302
+ tokens.push(token);
1303
+ }
1304
+ lastParagraphClipped = cutSrc.length !== src.length;
1305
+ src = src.substring(token.raw.length);
1306
+ continue;
1307
+ }
1308
+ if (token = this.tokenizer.text(src)) {
1309
+ src = src.substring(token.raw.length);
1310
+ const lastToken = tokens.at(-1);
1311
+ if (lastToken?.type === "text") {
1312
+ lastToken.raw += "\n" + token.raw;
1313
+ lastToken.text += "\n" + token.text;
1314
+ this.inlineQueue.pop();
1315
+ this.inlineQueue.at(-1).src = lastToken.text;
1316
+ } else {
1317
+ tokens.push(token);
1318
+ }
1319
+ continue;
1320
+ }
1321
+ if (src) {
1322
+ const errMsg = "Infinite loop on byte: " + src.charCodeAt(0);
1323
+ if (this.options.silent) {
1324
+ console.error(errMsg);
1325
+ break;
1326
+ } else {
1327
+ throw new Error(errMsg);
1328
+ }
1329
+ }
1330
+ }
1331
+ this.state.top = true;
1332
+ return tokens;
1333
+ }
1334
+ inline(src, tokens = []) {
1335
+ this.inlineQueue.push({ src, tokens });
1336
+ return tokens;
1337
+ }
1338
+ /**
1339
+ * Lexing/Compiling
1340
+ */
1341
+ inlineTokens(src, tokens = []) {
1342
+ let maskedSrc = src;
1343
+ let match = null;
1344
+ if (this.tokens.links) {
1345
+ const links = Object.keys(this.tokens.links);
1346
+ if (links.length > 0) {
1347
+ while ((match = this.tokenizer.rules.inline.reflinkSearch.exec(maskedSrc)) != null) {
1348
+ if (links.includes(match[0].slice(match[0].lastIndexOf("[") + 1, -1))) {
1349
+ maskedSrc = maskedSrc.slice(0, match.index) + "[" + "a".repeat(match[0].length - 2) + "]" + maskedSrc.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex);
1350
+ }
1351
+ }
1352
+ }
1353
+ }
1354
+ while ((match = this.tokenizer.rules.inline.anyPunctuation.exec(maskedSrc)) != null) {
1355
+ maskedSrc = maskedSrc.slice(0, match.index) + "++" + maskedSrc.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
1356
+ }
1357
+ while ((match = this.tokenizer.rules.inline.blockSkip.exec(maskedSrc)) != null) {
1358
+ maskedSrc = maskedSrc.slice(0, match.index) + "[" + "a".repeat(match[0].length - 2) + "]" + maskedSrc.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
1359
+ }
1360
+ let keepPrevChar = false;
1361
+ let prevChar = "";
1362
+ while (src) {
1363
+ if (!keepPrevChar) {
1364
+ prevChar = "";
1365
+ }
1366
+ keepPrevChar = false;
1367
+ let token;
1368
+ if (this.options.extensions?.inline?.some((extTokenizer) => {
1369
+ if (token = extTokenizer.call({ lexer: this }, src, tokens)) {
1370
+ src = src.substring(token.raw.length);
1371
+ tokens.push(token);
1372
+ return true;
1373
+ }
1374
+ return false;
1375
+ })) {
1376
+ continue;
1377
+ }
1378
+ if (token = this.tokenizer.escape(src)) {
1379
+ src = src.substring(token.raw.length);
1380
+ tokens.push(token);
1381
+ continue;
1382
+ }
1383
+ if (token = this.tokenizer.tag(src)) {
1384
+ src = src.substring(token.raw.length);
1385
+ tokens.push(token);
1386
+ continue;
1387
+ }
1388
+ if (token = this.tokenizer.link(src)) {
1389
+ src = src.substring(token.raw.length);
1390
+ tokens.push(token);
1391
+ continue;
1392
+ }
1393
+ if (token = this.tokenizer.reflink(src, this.tokens.links)) {
1394
+ src = src.substring(token.raw.length);
1395
+ const lastToken = tokens.at(-1);
1396
+ if (token.type === "text" && lastToken?.type === "text") {
1397
+ lastToken.raw += token.raw;
1398
+ lastToken.text += token.text;
1399
+ } else {
1400
+ tokens.push(token);
1401
+ }
1402
+ continue;
1403
+ }
1404
+ if (token = this.tokenizer.emStrong(src, maskedSrc, prevChar)) {
1405
+ src = src.substring(token.raw.length);
1406
+ tokens.push(token);
1407
+ continue;
1408
+ }
1409
+ if (token = this.tokenizer.codespan(src)) {
1410
+ src = src.substring(token.raw.length);
1411
+ tokens.push(token);
1412
+ continue;
1413
+ }
1414
+ if (token = this.tokenizer.br(src)) {
1415
+ src = src.substring(token.raw.length);
1416
+ tokens.push(token);
1417
+ continue;
1418
+ }
1419
+ if (token = this.tokenizer.del(src)) {
1420
+ src = src.substring(token.raw.length);
1421
+ tokens.push(token);
1422
+ continue;
1423
+ }
1424
+ if (token = this.tokenizer.autolink(src)) {
1425
+ src = src.substring(token.raw.length);
1426
+ tokens.push(token);
1427
+ continue;
1428
+ }
1429
+ if (!this.state.inLink && (token = this.tokenizer.url(src))) {
1430
+ src = src.substring(token.raw.length);
1431
+ tokens.push(token);
1432
+ continue;
1433
+ }
1434
+ let cutSrc = src;
1435
+ if (this.options.extensions?.startInline) {
1436
+ let startIndex = Infinity;
1437
+ const tempSrc = src.slice(1);
1438
+ let tempStart;
1439
+ this.options.extensions.startInline.forEach((getStartIndex) => {
1440
+ tempStart = getStartIndex.call({ lexer: this }, tempSrc);
1441
+ if (typeof tempStart === "number" && tempStart >= 0) {
1442
+ startIndex = Math.min(startIndex, tempStart);
1443
+ }
1444
+ });
1445
+ if (startIndex < Infinity && startIndex >= 0) {
1446
+ cutSrc = src.substring(0, startIndex + 1);
1447
+ }
1448
+ }
1449
+ if (token = this.tokenizer.inlineText(cutSrc)) {
1450
+ src = src.substring(token.raw.length);
1451
+ if (token.raw.slice(-1) !== "_") {
1452
+ prevChar = token.raw.slice(-1);
1453
+ }
1454
+ keepPrevChar = true;
1455
+ const lastToken = tokens.at(-1);
1456
+ if (lastToken?.type === "text") {
1457
+ lastToken.raw += token.raw;
1458
+ lastToken.text += token.text;
1459
+ } else {
1460
+ tokens.push(token);
1461
+ }
1462
+ continue;
1463
+ }
1464
+ if (src) {
1465
+ const errMsg = "Infinite loop on byte: " + src.charCodeAt(0);
1466
+ if (this.options.silent) {
1467
+ console.error(errMsg);
1468
+ break;
1469
+ } else {
1470
+ throw new Error(errMsg);
1471
+ }
1472
+ }
1473
+ }
1474
+ return tokens;
1475
+ }
1476
+ };
1477
+
1478
+ // src/Renderer.ts
1479
+ var _Renderer = class {
1480
+ options;
1481
+ parser;
1482
+ // set by the parser
1483
+ constructor(options2) {
1484
+ this.options = options2 || _defaults;
1485
+ }
1486
+ space(token) {
1487
+ return "";
1488
+ }
1489
+ code({ text, lang, escaped }) {
1490
+ const langString = (lang || "").match(other.notSpaceStart)?.[0];
1491
+ const code = text.replace(other.endingNewline, "") + "\n";
1492
+ if (!langString) {
1493
+ return "<pre><code>" + (escaped ? code : escape2(code, true)) + "</code></pre>\n";
1494
+ }
1495
+ return '<pre><code class="language-' + escape2(langString) + '">' + (escaped ? code : escape2(code, true)) + "</code></pre>\n";
1496
+ }
1497
+ blockquote({ tokens }) {
1498
+ const body = this.parser.parse(tokens);
1499
+ return `<blockquote>
1500
+ ${body}</blockquote>
1501
+ `;
1502
+ }
1503
+ html({ text }) {
1504
+ return text;
1505
+ }
1506
+ heading({ tokens, depth }) {
1507
+ return `<h${depth}>${this.parser.parseInline(tokens)}</h${depth}>
1508
+ `;
1509
+ }
1510
+ hr(token) {
1511
+ return "<hr>\n";
1512
+ }
1513
+ list(token) {
1514
+ const ordered = token.ordered;
1515
+ const start = token.start;
1516
+ let body = "";
1517
+ for (let j = 0; j < token.items.length; j++) {
1518
+ const item = token.items[j];
1519
+ body += this.listitem(item);
1520
+ }
1521
+ const type = ordered ? "ol" : "ul";
1522
+ const startAttr = ordered && start !== 1 ? ' start="' + start + '"' : "";
1523
+ return "<" + type + startAttr + ">\n" + body + "</" + type + ">\n";
1524
+ }
1525
+ listitem(item) {
1526
+ let itemBody = "";
1527
+ if (item.task) {
1528
+ const checkbox = this.checkbox({ checked: !!item.checked });
1529
+ if (item.loose) {
1530
+ if (item.tokens[0]?.type === "paragraph") {
1531
+ item.tokens[0].text = checkbox + " " + item.tokens[0].text;
1532
+ if (item.tokens[0].tokens && item.tokens[0].tokens.length > 0 && item.tokens[0].tokens[0].type === "text") {
1533
+ item.tokens[0].tokens[0].text = checkbox + " " + escape2(item.tokens[0].tokens[0].text);
1534
+ item.tokens[0].tokens[0].escaped = true;
1535
+ }
1536
+ } else {
1537
+ item.tokens.unshift({
1538
+ type: "text",
1539
+ raw: checkbox + " ",
1540
+ text: checkbox + " ",
1541
+ escaped: true
1542
+ });
1543
+ }
1544
+ } else {
1545
+ itemBody += checkbox + " ";
1546
+ }
1547
+ }
1548
+ itemBody += this.parser.parse(item.tokens, !!item.loose);
1549
+ return `<li>${itemBody}</li>
1550
+ `;
1551
+ }
1552
+ checkbox({ checked }) {
1553
+ return "<input " + (checked ? 'checked="" ' : "") + 'disabled="" type="checkbox">';
1554
+ }
1555
+ paragraph({ tokens }) {
1556
+ return `<p>${this.parser.parseInline(tokens)}</p>
1557
+ `;
1558
+ }
1559
+ table(token) {
1560
+ let header = "";
1561
+ let cell = "";
1562
+ for (let j = 0; j < token.header.length; j++) {
1563
+ cell += this.tablecell(token.header[j]);
1564
+ }
1565
+ header += this.tablerow({ text: cell });
1566
+ let body = "";
1567
+ for (let j = 0; j < token.rows.length; j++) {
1568
+ const row = token.rows[j];
1569
+ cell = "";
1570
+ for (let k = 0; k < row.length; k++) {
1571
+ cell += this.tablecell(row[k]);
1572
+ }
1573
+ body += this.tablerow({ text: cell });
1574
+ }
1575
+ if (body) body = `<tbody>${body}</tbody>`;
1576
+ return "<table>\n<thead>\n" + header + "</thead>\n" + body + "</table>\n";
1577
+ }
1578
+ tablerow({ text }) {
1579
+ return `<tr>
1580
+ ${text}</tr>
1581
+ `;
1582
+ }
1583
+ tablecell(token) {
1584
+ const content = this.parser.parseInline(token.tokens);
1585
+ const type = token.header ? "th" : "td";
1586
+ const tag2 = token.align ? `<${type} align="${token.align}">` : `<${type}>`;
1587
+ return tag2 + content + `</${type}>
1588
+ `;
1589
+ }
1590
+ /**
1591
+ * span level renderer
1592
+ */
1593
+ strong({ tokens }) {
1594
+ return `<strong>${this.parser.parseInline(tokens)}</strong>`;
1595
+ }
1596
+ em({ tokens }) {
1597
+ return `<em>${this.parser.parseInline(tokens)}</em>`;
1598
+ }
1599
+ codespan({ text }) {
1600
+ return `<code>${escape2(text, true)}</code>`;
1601
+ }
1602
+ br(token) {
1603
+ return "<br>";
1604
+ }
1605
+ del({ tokens }) {
1606
+ return `<del>${this.parser.parseInline(tokens)}</del>`;
1607
+ }
1608
+ link({ href, title, tokens }) {
1609
+ const text = this.parser.parseInline(tokens);
1610
+ const cleanHref = cleanUrl(href);
1611
+ if (cleanHref === null) {
1612
+ return text;
1613
+ }
1614
+ href = cleanHref;
1615
+ let out = '<a href="' + href + '"';
1616
+ if (title) {
1617
+ out += ' title="' + escape2(title) + '"';
1618
+ }
1619
+ out += ">" + text + "</a>";
1620
+ return out;
1621
+ }
1622
+ image({ href, title, text, tokens }) {
1623
+ if (tokens) {
1624
+ text = this.parser.parseInline(tokens, this.parser.textRenderer);
1625
+ }
1626
+ const cleanHref = cleanUrl(href);
1627
+ if (cleanHref === null) {
1628
+ return escape2(text);
1629
+ }
1630
+ href = cleanHref;
1631
+ let out = `<img src="${href}" alt="${text}"`;
1632
+ if (title) {
1633
+ out += ` title="${escape2(title)}"`;
1634
+ }
1635
+ out += ">";
1636
+ return out;
1637
+ }
1638
+ text(token) {
1639
+ return "tokens" in token && token.tokens ? this.parser.parseInline(token.tokens) : "escaped" in token && token.escaped ? token.text : escape2(token.text);
1640
+ }
1641
+ };
1642
+
1643
+ // src/TextRenderer.ts
1644
+ var _TextRenderer = class {
1645
+ // no need for block level renderers
1646
+ strong({ text }) {
1647
+ return text;
1648
+ }
1649
+ em({ text }) {
1650
+ return text;
1651
+ }
1652
+ codespan({ text }) {
1653
+ return text;
1654
+ }
1655
+ del({ text }) {
1656
+ return text;
1657
+ }
1658
+ html({ text }) {
1659
+ return text;
1660
+ }
1661
+ text({ text }) {
1662
+ return text;
1663
+ }
1664
+ link({ text }) {
1665
+ return "" + text;
1666
+ }
1667
+ image({ text }) {
1668
+ return "" + text;
1669
+ }
1670
+ br() {
1671
+ return "";
1672
+ }
1673
+ };
1674
+
1675
+ // src/Parser.ts
1676
+ var _Parser = class __Parser {
1677
+ options;
1678
+ renderer;
1679
+ textRenderer;
1680
+ constructor(options2) {
1681
+ this.options = options2 || _defaults;
1682
+ this.options.renderer = this.options.renderer || new _Renderer();
1683
+ this.renderer = this.options.renderer;
1684
+ this.renderer.options = this.options;
1685
+ this.renderer.parser = this;
1686
+ this.textRenderer = new _TextRenderer();
1687
+ }
1688
+ /**
1689
+ * Static Parse Method
1690
+ */
1691
+ static parse(tokens, options2) {
1692
+ const parser2 = new __Parser(options2);
1693
+ return parser2.parse(tokens);
1694
+ }
1695
+ /**
1696
+ * Static Parse Inline Method
1697
+ */
1698
+ static parseInline(tokens, options2) {
1699
+ const parser2 = new __Parser(options2);
1700
+ return parser2.parseInline(tokens);
1701
+ }
1702
+ /**
1703
+ * Parse Loop
1704
+ */
1705
+ parse(tokens, top = true) {
1706
+ let out = "";
1707
+ for (let i = 0; i < tokens.length; i++) {
1708
+ const anyToken = tokens[i];
1709
+ if (this.options.extensions?.renderers?.[anyToken.type]) {
1710
+ const genericToken = anyToken;
1711
+ const ret = this.options.extensions.renderers[genericToken.type].call({ parser: this }, genericToken);
1712
+ if (ret !== false || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "paragraph", "text"].includes(genericToken.type)) {
1713
+ out += ret || "";
1714
+ continue;
1715
+ }
1716
+ }
1717
+ const token = anyToken;
1718
+ switch (token.type) {
1719
+ case "space": {
1720
+ out += this.renderer.space(token);
1721
+ continue;
1722
+ }
1723
+ case "hr": {
1724
+ out += this.renderer.hr(token);
1725
+ continue;
1726
+ }
1727
+ case "heading": {
1728
+ out += this.renderer.heading(token);
1729
+ continue;
1730
+ }
1731
+ case "code": {
1732
+ out += this.renderer.code(token);
1733
+ continue;
1734
+ }
1735
+ case "table": {
1736
+ out += this.renderer.table(token);
1737
+ continue;
1738
+ }
1739
+ case "blockquote": {
1740
+ out += this.renderer.blockquote(token);
1741
+ continue;
1742
+ }
1743
+ case "list": {
1744
+ out += this.renderer.list(token);
1745
+ continue;
1746
+ }
1747
+ case "html": {
1748
+ out += this.renderer.html(token);
1749
+ continue;
1750
+ }
1751
+ case "paragraph": {
1752
+ out += this.renderer.paragraph(token);
1753
+ continue;
1754
+ }
1755
+ case "text": {
1756
+ let textToken = token;
1757
+ let body = this.renderer.text(textToken);
1758
+ while (i + 1 < tokens.length && tokens[i + 1].type === "text") {
1759
+ textToken = tokens[++i];
1760
+ body += "\n" + this.renderer.text(textToken);
1761
+ }
1762
+ if (top) {
1763
+ out += this.renderer.paragraph({
1764
+ type: "paragraph",
1765
+ raw: body,
1766
+ text: body,
1767
+ tokens: [{ type: "text", raw: body, text: body, escaped: true }]
1768
+ });
1769
+ } else {
1770
+ out += body;
1771
+ }
1772
+ continue;
1773
+ }
1774
+ default: {
1775
+ const errMsg = 'Token with "' + token.type + '" type was not found.';
1776
+ if (this.options.silent) {
1777
+ console.error(errMsg);
1778
+ return "";
1779
+ } else {
1780
+ throw new Error(errMsg);
1781
+ }
1782
+ }
1783
+ }
1784
+ }
1785
+ return out;
1786
+ }
1787
+ /**
1788
+ * Parse Inline Tokens
1789
+ */
1790
+ parseInline(tokens, renderer = this.renderer) {
1791
+ let out = "";
1792
+ for (let i = 0; i < tokens.length; i++) {
1793
+ const anyToken = tokens[i];
1794
+ if (this.options.extensions?.renderers?.[anyToken.type]) {
1795
+ const ret = this.options.extensions.renderers[anyToken.type].call({ parser: this }, anyToken);
1796
+ if (ret !== false || !["escape", "html", "link", "image", "strong", "em", "codespan", "br", "del", "text"].includes(anyToken.type)) {
1797
+ out += ret || "";
1798
+ continue;
1799
+ }
1800
+ }
1801
+ const token = anyToken;
1802
+ switch (token.type) {
1803
+ case "escape": {
1804
+ out += renderer.text(token);
1805
+ break;
1806
+ }
1807
+ case "html": {
1808
+ out += renderer.html(token);
1809
+ break;
1810
+ }
1811
+ case "link": {
1812
+ out += renderer.link(token);
1813
+ break;
1814
+ }
1815
+ case "image": {
1816
+ out += renderer.image(token);
1817
+ break;
1818
+ }
1819
+ case "strong": {
1820
+ out += renderer.strong(token);
1821
+ break;
1822
+ }
1823
+ case "em": {
1824
+ out += renderer.em(token);
1825
+ break;
1826
+ }
1827
+ case "codespan": {
1828
+ out += renderer.codespan(token);
1829
+ break;
1830
+ }
1831
+ case "br": {
1832
+ out += renderer.br(token);
1833
+ break;
1834
+ }
1835
+ case "del": {
1836
+ out += renderer.del(token);
1837
+ break;
1838
+ }
1839
+ case "text": {
1840
+ out += renderer.text(token);
1841
+ break;
1842
+ }
1843
+ default: {
1844
+ const errMsg = 'Token with "' + token.type + '" type was not found.';
1845
+ if (this.options.silent) {
1846
+ console.error(errMsg);
1847
+ return "";
1848
+ } else {
1849
+ throw new Error(errMsg);
1850
+ }
1851
+ }
1852
+ }
1853
+ }
1854
+ return out;
1855
+ }
1856
+ };
1857
+
1858
+ // src/Hooks.ts
1859
+ var _Hooks = class {
1860
+ options;
1861
+ block;
1862
+ constructor(options2) {
1863
+ this.options = options2 || _defaults;
1864
+ }
1865
+ static passThroughHooks = /* @__PURE__ */ new Set([
1866
+ "preprocess",
1867
+ "postprocess",
1868
+ "processAllTokens"
1869
+ ]);
1870
+ /**
1871
+ * Process markdown before marked
1872
+ */
1873
+ preprocess(markdown) {
1874
+ return markdown;
1875
+ }
1876
+ /**
1877
+ * Process HTML after marked is finished
1878
+ */
1879
+ postprocess(html2) {
1880
+ return html2;
1881
+ }
1882
+ /**
1883
+ * Process all tokens before walk tokens
1884
+ */
1885
+ processAllTokens(tokens) {
1886
+ return tokens;
1887
+ }
1888
+ /**
1889
+ * Provide function to tokenize markdown
1890
+ */
1891
+ provideLexer() {
1892
+ return this.block ? _Lexer.lex : _Lexer.lexInline;
1893
+ }
1894
+ /**
1895
+ * Provide function to parse tokens
1896
+ */
1897
+ provideParser() {
1898
+ return this.block ? _Parser.parse : _Parser.parseInline;
1899
+ }
1900
+ };
1901
+
1902
+ // src/Instance.ts
1903
+ var Marked = class {
1904
+ defaults = _getDefaults();
1905
+ options = this.setOptions;
1906
+ parse = this.parseMarkdown(true);
1907
+ parseInline = this.parseMarkdown(false);
1908
+ Parser = _Parser;
1909
+ Renderer = _Renderer;
1910
+ TextRenderer = _TextRenderer;
1911
+ Lexer = _Lexer;
1912
+ Tokenizer = _Tokenizer;
1913
+ Hooks = _Hooks;
1914
+ constructor(...args) {
1915
+ this.use(...args);
1916
+ }
1917
+ /**
1918
+ * Run callback for every token
1919
+ */
1920
+ walkTokens(tokens, callback) {
1921
+ let values = [];
1922
+ for (const token of tokens) {
1923
+ values = values.concat(callback.call(this, token));
1924
+ switch (token.type) {
1925
+ case "table": {
1926
+ const tableToken = token;
1927
+ for (const cell of tableToken.header) {
1928
+ values = values.concat(this.walkTokens(cell.tokens, callback));
1929
+ }
1930
+ for (const row of tableToken.rows) {
1931
+ for (const cell of row) {
1932
+ values = values.concat(this.walkTokens(cell.tokens, callback));
1933
+ }
1934
+ }
1935
+ break;
1936
+ }
1937
+ case "list": {
1938
+ const listToken = token;
1939
+ values = values.concat(this.walkTokens(listToken.items, callback));
1940
+ break;
1941
+ }
1942
+ default: {
1943
+ const genericToken = token;
1944
+ if (this.defaults.extensions?.childTokens?.[genericToken.type]) {
1945
+ this.defaults.extensions.childTokens[genericToken.type].forEach((childTokens) => {
1946
+ const tokens2 = genericToken[childTokens].flat(Infinity);
1947
+ values = values.concat(this.walkTokens(tokens2, callback));
1948
+ });
1949
+ } else if (genericToken.tokens) {
1950
+ values = values.concat(this.walkTokens(genericToken.tokens, callback));
1951
+ }
1952
+ }
1953
+ }
1954
+ }
1955
+ return values;
1956
+ }
1957
+ use(...args) {
1958
+ const extensions = this.defaults.extensions || { renderers: {}, childTokens: {} };
1959
+ args.forEach((pack) => {
1960
+ const opts = { ...pack };
1961
+ opts.async = this.defaults.async || opts.async || false;
1962
+ if (pack.extensions) {
1963
+ pack.extensions.forEach((ext) => {
1964
+ if (!ext.name) {
1965
+ throw new Error("extension name required");
1966
+ }
1967
+ if ("renderer" in ext) {
1968
+ const prevRenderer = extensions.renderers[ext.name];
1969
+ if (prevRenderer) {
1970
+ extensions.renderers[ext.name] = function(...args2) {
1971
+ let ret = ext.renderer.apply(this, args2);
1972
+ if (ret === false) {
1973
+ ret = prevRenderer.apply(this, args2);
1974
+ }
1975
+ return ret;
1976
+ };
1977
+ } else {
1978
+ extensions.renderers[ext.name] = ext.renderer;
1979
+ }
1980
+ }
1981
+ if ("tokenizer" in ext) {
1982
+ if (!ext.level || ext.level !== "block" && ext.level !== "inline") {
1983
+ throw new Error("extension level must be 'block' or 'inline'");
1984
+ }
1985
+ const extLevel = extensions[ext.level];
1986
+ if (extLevel) {
1987
+ extLevel.unshift(ext.tokenizer);
1988
+ } else {
1989
+ extensions[ext.level] = [ext.tokenizer];
1990
+ }
1991
+ if (ext.start) {
1992
+ if (ext.level === "block") {
1993
+ if (extensions.startBlock) {
1994
+ extensions.startBlock.push(ext.start);
1995
+ } else {
1996
+ extensions.startBlock = [ext.start];
1997
+ }
1998
+ } else if (ext.level === "inline") {
1999
+ if (extensions.startInline) {
2000
+ extensions.startInline.push(ext.start);
2001
+ } else {
2002
+ extensions.startInline = [ext.start];
2003
+ }
2004
+ }
2005
+ }
2006
+ }
2007
+ if ("childTokens" in ext && ext.childTokens) {
2008
+ extensions.childTokens[ext.name] = ext.childTokens;
2009
+ }
2010
+ });
2011
+ opts.extensions = extensions;
2012
+ }
2013
+ if (pack.renderer) {
2014
+ const renderer = this.defaults.renderer || new _Renderer(this.defaults);
2015
+ for (const prop in pack.renderer) {
2016
+ if (!(prop in renderer)) {
2017
+ throw new Error(`renderer '${prop}' does not exist`);
2018
+ }
2019
+ if (["options", "parser"].includes(prop)) {
2020
+ continue;
2021
+ }
2022
+ const rendererProp = prop;
2023
+ const rendererFunc = pack.renderer[rendererProp];
2024
+ const prevRenderer = renderer[rendererProp];
2025
+ renderer[rendererProp] = (...args2) => {
2026
+ let ret = rendererFunc.apply(renderer, args2);
2027
+ if (ret === false) {
2028
+ ret = prevRenderer.apply(renderer, args2);
2029
+ }
2030
+ return ret || "";
2031
+ };
2032
+ }
2033
+ opts.renderer = renderer;
2034
+ }
2035
+ if (pack.tokenizer) {
2036
+ const tokenizer = this.defaults.tokenizer || new _Tokenizer(this.defaults);
2037
+ for (const prop in pack.tokenizer) {
2038
+ if (!(prop in tokenizer)) {
2039
+ throw new Error(`tokenizer '${prop}' does not exist`);
2040
+ }
2041
+ if (["options", "rules", "lexer"].includes(prop)) {
2042
+ continue;
2043
+ }
2044
+ const tokenizerProp = prop;
2045
+ const tokenizerFunc = pack.tokenizer[tokenizerProp];
2046
+ const prevTokenizer = tokenizer[tokenizerProp];
2047
+ tokenizer[tokenizerProp] = (...args2) => {
2048
+ let ret = tokenizerFunc.apply(tokenizer, args2);
2049
+ if (ret === false) {
2050
+ ret = prevTokenizer.apply(tokenizer, args2);
2051
+ }
2052
+ return ret;
2053
+ };
2054
+ }
2055
+ opts.tokenizer = tokenizer;
2056
+ }
2057
+ if (pack.hooks) {
2058
+ const hooks = this.defaults.hooks || new _Hooks();
2059
+ for (const prop in pack.hooks) {
2060
+ if (!(prop in hooks)) {
2061
+ throw new Error(`hook '${prop}' does not exist`);
2062
+ }
2063
+ if (["options", "block"].includes(prop)) {
2064
+ continue;
2065
+ }
2066
+ const hooksProp = prop;
2067
+ const hooksFunc = pack.hooks[hooksProp];
2068
+ const prevHook = hooks[hooksProp];
2069
+ if (_Hooks.passThroughHooks.has(prop)) {
2070
+ hooks[hooksProp] = (arg) => {
2071
+ if (this.defaults.async) {
2072
+ return Promise.resolve(hooksFunc.call(hooks, arg)).then((ret2) => {
2073
+ return prevHook.call(hooks, ret2);
2074
+ });
2075
+ }
2076
+ const ret = hooksFunc.call(hooks, arg);
2077
+ return prevHook.call(hooks, ret);
2078
+ };
2079
+ } else {
2080
+ hooks[hooksProp] = (...args2) => {
2081
+ let ret = hooksFunc.apply(hooks, args2);
2082
+ if (ret === false) {
2083
+ ret = prevHook.apply(hooks, args2);
2084
+ }
2085
+ return ret;
2086
+ };
2087
+ }
2088
+ }
2089
+ opts.hooks = hooks;
2090
+ }
2091
+ if (pack.walkTokens) {
2092
+ const walkTokens2 = this.defaults.walkTokens;
2093
+ const packWalktokens = pack.walkTokens;
2094
+ opts.walkTokens = function(token) {
2095
+ let values = [];
2096
+ values.push(packWalktokens.call(this, token));
2097
+ if (walkTokens2) {
2098
+ values = values.concat(walkTokens2.call(this, token));
2099
+ }
2100
+ return values;
2101
+ };
2102
+ }
2103
+ this.defaults = { ...this.defaults, ...opts };
2104
+ });
2105
+ return this;
2106
+ }
2107
+ setOptions(opt) {
2108
+ this.defaults = { ...this.defaults, ...opt };
2109
+ return this;
2110
+ }
2111
+ lexer(src, options2) {
2112
+ return _Lexer.lex(src, options2 ?? this.defaults);
2113
+ }
2114
+ parser(tokens, options2) {
2115
+ return _Parser.parse(tokens, options2 ?? this.defaults);
2116
+ }
2117
+ parseMarkdown(blockType) {
2118
+ const parse2 = (src, options2) => {
2119
+ const origOpt = { ...options2 };
2120
+ const opt = { ...this.defaults, ...origOpt };
2121
+ const throwError = this.onError(!!opt.silent, !!opt.async);
2122
+ if (this.defaults.async === true && origOpt.async === false) {
2123
+ return throwError(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));
2124
+ }
2125
+ if (typeof src === "undefined" || src === null) {
2126
+ return throwError(new Error("marked(): input parameter is undefined or null"));
2127
+ }
2128
+ if (typeof src !== "string") {
2129
+ return throwError(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(src) + ", string expected"));
2130
+ }
2131
+ if (opt.hooks) {
2132
+ opt.hooks.options = opt;
2133
+ opt.hooks.block = blockType;
2134
+ }
2135
+ const lexer2 = opt.hooks ? opt.hooks.provideLexer() : blockType ? _Lexer.lex : _Lexer.lexInline;
2136
+ const parser2 = opt.hooks ? opt.hooks.provideParser() : blockType ? _Parser.parse : _Parser.parseInline;
2137
+ if (opt.async) {
2138
+ return Promise.resolve(opt.hooks ? opt.hooks.preprocess(src) : src).then((src2) => lexer2(src2, opt)).then((tokens) => opt.hooks ? opt.hooks.processAllTokens(tokens) : tokens).then((tokens) => opt.walkTokens ? Promise.all(this.walkTokens(tokens, opt.walkTokens)).then(() => tokens) : tokens).then((tokens) => parser2(tokens, opt)).then((html2) => opt.hooks ? opt.hooks.postprocess(html2) : html2).catch(throwError);
2139
+ }
2140
+ try {
2141
+ if (opt.hooks) {
2142
+ src = opt.hooks.preprocess(src);
2143
+ }
2144
+ let tokens = lexer2(src, opt);
2145
+ if (opt.hooks) {
2146
+ tokens = opt.hooks.processAllTokens(tokens);
2147
+ }
2148
+ if (opt.walkTokens) {
2149
+ this.walkTokens(tokens, opt.walkTokens);
2150
+ }
2151
+ let html2 = parser2(tokens, opt);
2152
+ if (opt.hooks) {
2153
+ html2 = opt.hooks.postprocess(html2);
2154
+ }
2155
+ return html2;
2156
+ } catch (e) {
2157
+ return throwError(e);
2158
+ }
2159
+ };
2160
+ return parse2;
2161
+ }
2162
+ onError(silent, async) {
2163
+ return (e) => {
2164
+ e.message += "\nPlease report this to https://github.com/markedjs/marked.";
2165
+ if (silent) {
2166
+ const msg = "<p>An error occurred:</p><pre>" + escape2(e.message + "", true) + "</pre>";
2167
+ if (async) {
2168
+ return Promise.resolve(msg);
2169
+ }
2170
+ return msg;
2171
+ }
2172
+ if (async) {
2173
+ return Promise.reject(e);
2174
+ }
2175
+ throw e;
2176
+ };
2177
+ }
2178
+ };
2179
+
2180
+ // src/marked.ts
2181
+ var markedInstance = new Marked();
2182
+ function marked(src, opt) {
2183
+ return markedInstance.parse(src, opt);
2184
+ }
2185
+ marked.options = marked.setOptions = function(options2) {
2186
+ markedInstance.setOptions(options2);
2187
+ marked.defaults = markedInstance.defaults;
2188
+ changeDefaults(marked.defaults);
2189
+ return marked;
2190
+ };
2191
+ marked.getDefaults = _getDefaults;
2192
+ marked.defaults = _defaults;
2193
+ marked.use = function(...args) {
2194
+ markedInstance.use(...args);
2195
+ marked.defaults = markedInstance.defaults;
2196
+ changeDefaults(marked.defaults);
2197
+ return marked;
2198
+ };
2199
+ marked.walkTokens = function(tokens, callback) {
2200
+ return markedInstance.walkTokens(tokens, callback);
2201
+ };
2202
+ marked.parseInline = markedInstance.parseInline;
2203
+ marked.Parser = _Parser;
2204
+ marked.parser = _Parser.parse;
2205
+ marked.Renderer = _Renderer;
2206
+ marked.TextRenderer = _TextRenderer;
2207
+ marked.Lexer = _Lexer;
2208
+ marked.lexer = _Lexer.lex;
2209
+ marked.Tokenizer = _Tokenizer;
2210
+ marked.Hooks = _Hooks;
2211
+ marked.parse = marked;
2212
+ var options = marked.options;
2213
+ var setOptions = marked.setOptions;
2214
+ var use = marked.use;
2215
+ var walkTokens = marked.walkTokens;
2216
+ var parseInline = marked.parseInline;
2217
+ var parse = marked;
2218
+ var parser = _Parser.parse;
2219
+ var lexer = _Lexer.lex;
2220
+
2221
+ if(__exports != exports)module.exports = exports;return module.exports}));
2222
+ //# sourceMappingURL=marked.umd.js.map
2223
+
2224
+
2225
+ /***/ })
2226
+
2227
+ }])
2228
+ //# sourceMappingURL=vendors-node_modules_marked_lib_marked_umd_js.js.map