@pilotiq/tiptap 3.4.0 → 3.6.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.
- package/dist/extensions/AiInlineDiffExtension.d.ts +82 -0
- package/dist/extensions/AiInlineDiffExtension.d.ts.map +1 -0
- package/dist/extensions/AiInlineDiffExtension.js +205 -0
- package/dist/extensions/AiInlineDiffExtension.js.map +1 -0
- package/dist/extensions/AiSuggestionExtension.d.ts.map +1 -1
- package/dist/extensions/AiSuggestionExtension.js +108 -0
- package/dist/extensions/AiSuggestionExtension.js.map +1 -1
- package/dist/markdownExtension.js +0 -1
- package/dist/react/AiSuggestionBanner.d.ts +72 -0
- package/dist/react/AiSuggestionBanner.d.ts.map +1 -0
- package/dist/react/AiSuggestionBanner.js +72 -0
- package/dist/react/AiSuggestionBanner.js.map +1 -0
- package/dist/react/CollabTextRenderer.d.ts.map +1 -1
- package/dist/react/CollabTextRenderer.js +62 -27
- package/dist/react/CollabTextRenderer.js.map +1 -1
- package/dist/react/MarkdownEditor.d.ts.map +1 -1
- package/dist/react/MarkdownEditor.js +62 -7
- package/dist/react/MarkdownEditor.js.map +1 -1
- package/dist/react/TiptapEditor.d.ts.map +1 -1
- package/dist/react/TiptapEditor.js +47 -5
- package/dist/react/TiptapEditor.js.map +1 -1
- package/dist/react/useAiInlineDiff.d.ts +57 -0
- package/dist/react/useAiInlineDiff.d.ts.map +1 -0
- package/dist/react/useAiInlineDiff.js +121 -0
- package/dist/react/useAiInlineDiff.js.map +1 -0
- package/dist/react/useAiSuggestionBridge.d.ts +37 -1
- package/dist/react/useAiSuggestionBridge.d.ts.map +1 -1
- package/dist/react/useAiSuggestionBridge.js +63 -32
- package/dist/react/useAiSuggestionBridge.js.map +1 -1
- package/package.json +26 -24
- package/src/extensions/AiInlineDiffExtension.ts +263 -0
- package/src/extensions/AiSuggestionExtension.ts +107 -0
- package/src/react/AiSuggestionBanner.tsx +184 -0
- package/src/react/CollabTextRenderer.tsx +61 -27
- package/src/react/MarkdownEditor.tsx +62 -6
- package/src/react/TiptapEditor.tsx +48 -4
- package/src/react/useAiInlineDiff.ts +146 -0
- package/src/react/useAiSuggestionBridge.ts +105 -9
- package/dist/markdownExtension.js.map +0 -7
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../node_modules/.pnpm/markdown-it-task-lists@2.1.1/node_modules/markdown-it-task-lists/index.js", "../../../node_modules/.pnpm/orderedmap@2.1.1/node_modules/orderedmap/dist/index.js", "../../../node_modules/.pnpm/prosemirror-model@1.25.4/node_modules/prosemirror-model/dist/index.js", "../../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/common/utils.mjs", "../../../node_modules/.pnpm/mdurl@2.0.0/node_modules/mdurl/index.mjs", "../../../node_modules/.pnpm/mdurl@2.0.0/node_modules/mdurl/lib/decode.mjs", "../../../node_modules/.pnpm/mdurl@2.0.0/node_modules/mdurl/lib/encode.mjs", "../../../node_modules/.pnpm/mdurl@2.0.0/node_modules/mdurl/lib/format.mjs", "../../../node_modules/.pnpm/mdurl@2.0.0/node_modules/mdurl/lib/parse.mjs", "../../../node_modules/.pnpm/uc.micro@2.1.0/node_modules/uc.micro/index.mjs", "../../../node_modules/.pnpm/uc.micro@2.1.0/node_modules/uc.micro/properties/Any/regex.mjs", "../../../node_modules/.pnpm/uc.micro@2.1.0/node_modules/uc.micro/categories/Cc/regex.mjs", "../../../node_modules/.pnpm/uc.micro@2.1.0/node_modules/uc.micro/categories/Cf/regex.mjs", "../../../node_modules/.pnpm/uc.micro@2.1.0/node_modules/uc.micro/categories/P/regex.mjs", "../../../node_modules/.pnpm/uc.micro@2.1.0/node_modules/uc.micro/categories/S/regex.mjs", "../../../node_modules/.pnpm/uc.micro@2.1.0/node_modules/uc.micro/categories/Z/regex.mjs", "https://raw.githubusercontent.com/fb55/entities/61afd4701eaa736978b13c7351cd3de9a96b04bc/src/generated/decode-data-html.ts", "https://raw.githubusercontent.com/fb55/entities/61afd4701eaa736978b13c7351cd3de9a96b04bc/src/generated/decode-data-xml.ts", "https://raw.githubusercontent.com/fb55/entities/61afd4701eaa736978b13c7351cd3de9a96b04bc/src/decode_codepoint.ts", "https://raw.githubusercontent.com/fb55/entities/61afd4701eaa736978b13c7351cd3de9a96b04bc/src/decode.ts", "https://raw.githubusercontent.com/fb55/entities/61afd4701eaa736978b13c7351cd3de9a96b04bc/src/generated/encode-html.ts", "https://raw.githubusercontent.com/fb55/entities/61afd4701eaa736978b13c7351cd3de9a96b04bc/src/escape.ts", "https://raw.githubusercontent.com/fb55/entities/61afd4701eaa736978b13c7351cd3de9a96b04bc/src/index.ts", "../../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/helpers/index.mjs", "../../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/helpers/parse_link_label.mjs", "../../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/helpers/parse_link_destination.mjs", "../../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/helpers/parse_link_title.mjs", "../../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/renderer.mjs", "../../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/ruler.mjs", "../../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/token.mjs", "../../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_core/state_core.mjs", "../../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_core/normalize.mjs", "../../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_core/block.mjs", "../../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_core/inline.mjs", "../../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_core/linkify.mjs", "../../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_core/replacements.mjs", "../../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_core/smartquotes.mjs", "../../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_core/text_join.mjs", "../../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/parser_core.mjs", "../../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_block/state_block.mjs", "../../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_block/table.mjs", "../../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_block/code.mjs", "../../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_block/fence.mjs", "../../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_block/blockquote.mjs", "../../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_block/hr.mjs", "../../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_block/list.mjs", "../../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_block/reference.mjs", "../../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/common/html_blocks.mjs", "../../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/common/html_re.mjs", "../../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_block/html_block.mjs", "../../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_block/heading.mjs", "../../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_block/lheading.mjs", "../../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_block/paragraph.mjs", "../../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/parser_block.mjs", "../../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_inline/state_inline.mjs", "../../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_inline/text.mjs", "../../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_inline/linkify.mjs", "../../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_inline/newline.mjs", "../../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_inline/escape.mjs", "../../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_inline/backticks.mjs", "../../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_inline/strikethrough.mjs", "../../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_inline/emphasis.mjs", "../../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_inline/link.mjs", "../../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_inline/image.mjs", "../../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_inline/autolink.mjs", "../../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_inline/html_inline.mjs", "../../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_inline/entity.mjs", "../../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_inline/balance_pairs.mjs", "../../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_inline/fragments_join.mjs", "../../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/parser_inline.mjs", "../../../node_modules/.pnpm/linkify-it@5.0.0/node_modules/linkify-it/lib/re.mjs", "../../../node_modules/.pnpm/linkify-it@5.0.0/node_modules/linkify-it/index.mjs", "../../../node_modules/.pnpm/punycode.js@2.3.1/node_modules/punycode.js/punycode.es6.js", "../../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/presets/default.mjs", "../../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/presets/zero.mjs", "../../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/presets/commonmark.mjs", "../../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/index.mjs", "../../../node_modules/.pnpm/prosemirror-markdown@1.13.4/node_modules/prosemirror-markdown/dist/index.js", "../../../node_modules/.pnpm/tiptap-markdown@0.9.0_@tiptap+core@3.22.4_@tiptap+pm@3.22.4_/node_modules/tiptap-markdown/src/extensions/tiptap/tight-lists.js", "../../../node_modules/.pnpm/tiptap-markdown@0.9.0_@tiptap+core@3.22.4_@tiptap+pm@3.22.4_/node_modules/tiptap-markdown/src/util/markdown.js", "../../../node_modules/.pnpm/tiptap-markdown@0.9.0_@tiptap+core@3.22.4_@tiptap+pm@3.22.4_/node_modules/tiptap-markdown/src/serialize/state.js", "../../../node_modules/.pnpm/tiptap-markdown@0.9.0_@tiptap+core@3.22.4_@tiptap+pm@3.22.4_/node_modules/tiptap-markdown/src/extensions/marks/html.js", "../../../node_modules/.pnpm/tiptap-markdown@0.9.0_@tiptap+core@3.22.4_@tiptap+pm@3.22.4_/node_modules/tiptap-markdown/src/util/dom.js", "../../../node_modules/.pnpm/tiptap-markdown@0.9.0_@tiptap+core@3.22.4_@tiptap+pm@3.22.4_/node_modules/tiptap-markdown/src/extensions/nodes/html.js", "../../../node_modules/.pnpm/tiptap-markdown@0.9.0_@tiptap+core@3.22.4_@tiptap+pm@3.22.4_/node_modules/tiptap-markdown/src/extensions/nodes/blockquote.js", "../../../node_modules/.pnpm/tiptap-markdown@0.9.0_@tiptap+core@3.22.4_@tiptap+pm@3.22.4_/node_modules/tiptap-markdown/src/extensions/nodes/bullet-list.js", "../../../node_modules/.pnpm/tiptap-markdown@0.9.0_@tiptap+core@3.22.4_@tiptap+pm@3.22.4_/node_modules/tiptap-markdown/src/extensions/nodes/code-block.js", "../../../node_modules/.pnpm/tiptap-markdown@0.9.0_@tiptap+core@3.22.4_@tiptap+pm@3.22.4_/node_modules/tiptap-markdown/src/extensions/nodes/hard-break.js", "../../../node_modules/.pnpm/tiptap-markdown@0.9.0_@tiptap+core@3.22.4_@tiptap+pm@3.22.4_/node_modules/tiptap-markdown/src/extensions/nodes/heading.js", "../../../node_modules/.pnpm/tiptap-markdown@0.9.0_@tiptap+core@3.22.4_@tiptap+pm@3.22.4_/node_modules/tiptap-markdown/src/extensions/nodes/horizontal-rule.js", "../../../node_modules/.pnpm/tiptap-markdown@0.9.0_@tiptap+core@3.22.4_@tiptap+pm@3.22.4_/node_modules/tiptap-markdown/src/extensions/nodes/image.js", "../../../node_modules/.pnpm/tiptap-markdown@0.9.0_@tiptap+core@3.22.4_@tiptap+pm@3.22.4_/node_modules/tiptap-markdown/src/extensions/nodes/list-item.js", "../../../node_modules/.pnpm/tiptap-markdown@0.9.0_@tiptap+core@3.22.4_@tiptap+pm@3.22.4_/node_modules/tiptap-markdown/src/extensions/nodes/ordered-list.js", "../../../node_modules/.pnpm/tiptap-markdown@0.9.0_@tiptap+core@3.22.4_@tiptap+pm@3.22.4_/node_modules/tiptap-markdown/src/extensions/nodes/paragraph.js", "../../../node_modules/.pnpm/tiptap-markdown@0.9.0_@tiptap+core@3.22.4_@tiptap+pm@3.22.4_/node_modules/tiptap-markdown/src/util/prosemirror.js", "../../../node_modules/.pnpm/tiptap-markdown@0.9.0_@tiptap+core@3.22.4_@tiptap+pm@3.22.4_/node_modules/tiptap-markdown/src/extensions/nodes/table.js", "../../../node_modules/.pnpm/tiptap-markdown@0.9.0_@tiptap+core@3.22.4_@tiptap+pm@3.22.4_/node_modules/tiptap-markdown/src/extensions/nodes/task-item.js", "../../../node_modules/.pnpm/tiptap-markdown@0.9.0_@tiptap+core@3.22.4_@tiptap+pm@3.22.4_/node_modules/tiptap-markdown/src/extensions/nodes/task-list.js", "../../../node_modules/.pnpm/tiptap-markdown@0.9.0_@tiptap+core@3.22.4_@tiptap+pm@3.22.4_/node_modules/tiptap-markdown/src/extensions/nodes/text.js", "../../../node_modules/.pnpm/tiptap-markdown@0.9.0_@tiptap+core@3.22.4_@tiptap+pm@3.22.4_/node_modules/tiptap-markdown/src/extensions/marks/bold.js", "../../../node_modules/.pnpm/tiptap-markdown@0.9.0_@tiptap+core@3.22.4_@tiptap+pm@3.22.4_/node_modules/tiptap-markdown/src/extensions/marks/code.js", "../../../node_modules/.pnpm/tiptap-markdown@0.9.0_@tiptap+core@3.22.4_@tiptap+pm@3.22.4_/node_modules/tiptap-markdown/src/extensions/marks/italic.js", "../../../node_modules/.pnpm/tiptap-markdown@0.9.0_@tiptap+core@3.22.4_@tiptap+pm@3.22.4_/node_modules/tiptap-markdown/src/extensions/marks/link.js", "../../../node_modules/.pnpm/tiptap-markdown@0.9.0_@tiptap+core@3.22.4_@tiptap+pm@3.22.4_/node_modules/tiptap-markdown/src/extensions/marks/strike.js", "../../../node_modules/.pnpm/tiptap-markdown@0.9.0_@tiptap+core@3.22.4_@tiptap+pm@3.22.4_/node_modules/tiptap-markdown/src/extensions/index.js", "../../../node_modules/.pnpm/tiptap-markdown@0.9.0_@tiptap+core@3.22.4_@tiptap+pm@3.22.4_/node_modules/tiptap-markdown/src/util/extensions.js", "../../../node_modules/.pnpm/tiptap-markdown@0.9.0_@tiptap+core@3.22.4_@tiptap+pm@3.22.4_/node_modules/tiptap-markdown/src/serialize/MarkdownSerializer.js", "../../../node_modules/.pnpm/tiptap-markdown@0.9.0_@tiptap+core@3.22.4_@tiptap+pm@3.22.4_/node_modules/tiptap-markdown/src/parse/MarkdownParser.js", "../../../node_modules/.pnpm/tiptap-markdown@0.9.0_@tiptap+core@3.22.4_@tiptap+pm@3.22.4_/node_modules/tiptap-markdown/src/extensions/tiptap/clipboard.js", "../../../node_modules/.pnpm/tiptap-markdown@0.9.0_@tiptap+core@3.22.4_@tiptap+pm@3.22.4_/node_modules/tiptap-markdown/src/Markdown.js", "../src/markdownExtension.ts"],
|
|
4
|
-
"sourcesContent": ["// Markdown-it plugin to render GitHub-style task lists; see\n//\n// https://github.com/blog/1375-task-lists-in-gfm-issues-pulls-comments\n// https://github.com/blog/1825-task-lists-in-all-markdown-documents\n\nvar disableCheckboxes = true;\nvar useLabelWrapper = false;\nvar useLabelAfter = false;\n\nmodule.exports = function(md, options) {\n\tif (options) {\n\t\tdisableCheckboxes = !options.enabled;\n\t\tuseLabelWrapper = !!options.label;\n\t\tuseLabelAfter = !!options.labelAfter;\n\t}\n\n\tmd.core.ruler.after('inline', 'github-task-lists', function(state) {\n\t\tvar tokens = state.tokens;\n\t\tfor (var i = 2; i < tokens.length; i++) {\n\t\t\tif (isTodoItem(tokens, i)) {\n\t\t\t\ttodoify(tokens[i], state.Token);\n\t\t\t\tattrSet(tokens[i-2], 'class', 'task-list-item' + (!disableCheckboxes ? ' enabled' : ''));\n\t\t\t\tattrSet(tokens[parentToken(tokens, i-2)], 'class', 'contains-task-list');\n\t\t\t}\n\t\t}\n\t});\n};\n\nfunction attrSet(token, name, value) {\n\tvar index = token.attrIndex(name);\n\tvar attr = [name, value];\n\n\tif (index < 0) {\n\t\ttoken.attrPush(attr);\n\t} else {\n\t\ttoken.attrs[index] = attr;\n\t}\n}\n\nfunction parentToken(tokens, index) {\n\tvar targetLevel = tokens[index].level - 1;\n\tfor (var i = index - 1; i >= 0; i--) {\n\t\tif (tokens[i].level === targetLevel) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n}\n\nfunction isTodoItem(tokens, index) {\n\treturn isInline(tokens[index]) &&\n\t isParagraph(tokens[index - 1]) &&\n\t isListItem(tokens[index - 2]) &&\n\t startsWithTodoMarkdown(tokens[index]);\n}\n\nfunction todoify(token, TokenConstructor) {\n\ttoken.children.unshift(makeCheckbox(token, TokenConstructor));\n\ttoken.children[1].content = token.children[1].content.slice(3);\n\ttoken.content = token.content.slice(3);\n\n\tif (useLabelWrapper) {\n\t\tif (useLabelAfter) {\n\t\t\ttoken.children.pop();\n\n\t\t\t// Use large random number as id property of the checkbox.\n\t\t\tvar id = 'task-item-' + Math.ceil(Math.random() * (10000 * 1000) - 1000);\n\t\t\ttoken.children[0].content = token.children[0].content.slice(0, -1) + ' id=\"' + id + '\">';\n\t\t\ttoken.children.push(afterLabel(token.content, id, TokenConstructor));\n\t\t} else {\n\t\t\ttoken.children.unshift(beginLabel(TokenConstructor));\n\t\t\ttoken.children.push(endLabel(TokenConstructor));\n\t\t}\n\t}\n}\n\nfunction makeCheckbox(token, TokenConstructor) {\n\tvar checkbox = new TokenConstructor('html_inline', '', 0);\n\tvar disabledAttr = disableCheckboxes ? ' disabled=\"\" ' : '';\n\tif (token.content.indexOf('[ ] ') === 0) {\n\t\tcheckbox.content = '<input class=\"task-list-item-checkbox\"' + disabledAttr + 'type=\"checkbox\">';\n\t} else if (token.content.indexOf('[x] ') === 0 || token.content.indexOf('[X] ') === 0) {\n\t\tcheckbox.content = '<input class=\"task-list-item-checkbox\" checked=\"\"' + disabledAttr + 'type=\"checkbox\">';\n\t}\n\treturn checkbox;\n}\n\n// these next two functions are kind of hacky; probably should really be a\n// true block-level token with .tag=='label'\nfunction beginLabel(TokenConstructor) {\n\tvar token = new TokenConstructor('html_inline', '', 0);\n\ttoken.content = '<label>';\n\treturn token;\n}\n\nfunction endLabel(TokenConstructor) {\n\tvar token = new TokenConstructor('html_inline', '', 0);\n\ttoken.content = '</label>';\n\treturn token;\n}\n\nfunction afterLabel(content, id, TokenConstructor) {\n\tvar token = new TokenConstructor('html_inline', '', 0);\n\ttoken.content = '<label class=\"task-list-item-label\" for=\"' + id + '\">' + content + '</label>';\n\ttoken.attrs = [{for: id}];\n\treturn token;\n}\n\nfunction isInline(token) { return token.type === 'inline'; }\nfunction isParagraph(token) { return token.type === 'paragraph_open'; }\nfunction isListItem(token) { return token.type === 'list_item_open'; }\n\nfunction startsWithTodoMarkdown(token) {\n\t// leading whitespace in a list item is already trimmed off by markdown-it\n\treturn token.content.indexOf('[ ] ') === 0 || token.content.indexOf('[x] ') === 0 || token.content.indexOf('[X] ') === 0;\n}\n", "// ::- Persistent data structure representing an ordered mapping from\n// strings to values, with some convenient update methods.\nfunction OrderedMap(content) {\n this.content = content;\n}\n\nOrderedMap.prototype = {\n constructor: OrderedMap,\n\n find: function(key) {\n for (var i = 0; i < this.content.length; i += 2)\n if (this.content[i] === key) return i\n return -1\n },\n\n // :: (string) \u2192 ?any\n // Retrieve the value stored under `key`, or return undefined when\n // no such key exists.\n get: function(key) {\n var found = this.find(key);\n return found == -1 ? undefined : this.content[found + 1]\n },\n\n // :: (string, any, ?string) \u2192 OrderedMap\n // Create a new map by replacing the value of `key` with a new\n // value, or adding a binding to the end of the map. If `newKey` is\n // given, the key of the binding will be replaced with that key.\n update: function(key, value, newKey) {\n var self = newKey && newKey != key ? this.remove(newKey) : this;\n var found = self.find(key), content = self.content.slice();\n if (found == -1) {\n content.push(newKey || key, value);\n } else {\n content[found + 1] = value;\n if (newKey) content[found] = newKey;\n }\n return new OrderedMap(content)\n },\n\n // :: (string) \u2192 OrderedMap\n // Return a map with the given key removed, if it existed.\n remove: function(key) {\n var found = this.find(key);\n if (found == -1) return this\n var content = this.content.slice();\n content.splice(found, 2);\n return new OrderedMap(content)\n },\n\n // :: (string, any) \u2192 OrderedMap\n // Add a new key to the start of the map.\n addToStart: function(key, value) {\n return new OrderedMap([key, value].concat(this.remove(key).content))\n },\n\n // :: (string, any) \u2192 OrderedMap\n // Add a new key to the end of the map.\n addToEnd: function(key, value) {\n var content = this.remove(key).content.slice();\n content.push(key, value);\n return new OrderedMap(content)\n },\n\n // :: (string, string, any) \u2192 OrderedMap\n // Add a key after the given key. If `place` is not found, the new\n // key is added to the end.\n addBefore: function(place, key, value) {\n var without = this.remove(key), content = without.content.slice();\n var found = without.find(place);\n content.splice(found == -1 ? content.length : found, 0, key, value);\n return new OrderedMap(content)\n },\n\n // :: ((key: string, value: any))\n // Call the given function for each key/value pair in the map, in\n // order.\n forEach: function(f) {\n for (var i = 0; i < this.content.length; i += 2)\n f(this.content[i], this.content[i + 1]);\n },\n\n // :: (union<Object, OrderedMap>) \u2192 OrderedMap\n // Create a new map by prepending the keys in this map that don't\n // appear in `map` before the keys in `map`.\n prepend: function(map) {\n map = OrderedMap.from(map);\n if (!map.size) return this\n return new OrderedMap(map.content.concat(this.subtract(map).content))\n },\n\n // :: (union<Object, OrderedMap>) \u2192 OrderedMap\n // Create a new map by appending the keys in this map that don't\n // appear in `map` after the keys in `map`.\n append: function(map) {\n map = OrderedMap.from(map);\n if (!map.size) return this\n return new OrderedMap(this.subtract(map).content.concat(map.content))\n },\n\n // :: (union<Object, OrderedMap>) \u2192 OrderedMap\n // Create a map containing all the keys in this map that don't\n // appear in `map`.\n subtract: function(map) {\n var result = this;\n map = OrderedMap.from(map);\n for (var i = 0; i < map.content.length; i += 2)\n result = result.remove(map.content[i]);\n return result\n },\n\n // :: () \u2192 Object\n // Turn ordered map into a plain object.\n toObject: function() {\n var result = {};\n this.forEach(function(key, value) { result[key] = value; });\n return result\n },\n\n // :: number\n // The amount of keys in this map.\n get size() {\n return this.content.length >> 1\n }\n};\n\n// :: (?union<Object, OrderedMap>) \u2192 OrderedMap\n// Return a map with the given content. If null, create an empty\n// map. If given an ordered map, return that map itself. If given an\n// object, create a map from the object's properties.\nOrderedMap.from = function(value) {\n if (value instanceof OrderedMap) return value\n var content = [];\n if (value) for (var prop in value) content.push(prop, value[prop]);\n return new OrderedMap(content)\n};\n\nexport default OrderedMap;\n", "import OrderedMap from 'orderedmap';\n\nfunction findDiffStart(a, b, pos) {\n for (let i = 0;; i++) {\n if (i == a.childCount || i == b.childCount)\n return a.childCount == b.childCount ? null : pos;\n let childA = a.child(i), childB = b.child(i);\n if (childA == childB) {\n pos += childA.nodeSize;\n continue;\n }\n if (!childA.sameMarkup(childB))\n return pos;\n if (childA.isText && childA.text != childB.text) {\n for (let j = 0; childA.text[j] == childB.text[j]; j++)\n pos++;\n return pos;\n }\n if (childA.content.size || childB.content.size) {\n let inner = findDiffStart(childA.content, childB.content, pos + 1);\n if (inner != null)\n return inner;\n }\n pos += childA.nodeSize;\n }\n}\nfunction findDiffEnd(a, b, posA, posB) {\n for (let iA = a.childCount, iB = b.childCount;;) {\n if (iA == 0 || iB == 0)\n return iA == iB ? null : { a: posA, b: posB };\n let childA = a.child(--iA), childB = b.child(--iB), size = childA.nodeSize;\n if (childA == childB) {\n posA -= size;\n posB -= size;\n continue;\n }\n if (!childA.sameMarkup(childB))\n return { a: posA, b: posB };\n if (childA.isText && childA.text != childB.text) {\n let same = 0, minSize = Math.min(childA.text.length, childB.text.length);\n while (same < minSize && childA.text[childA.text.length - same - 1] == childB.text[childB.text.length - same - 1]) {\n same++;\n posA--;\n posB--;\n }\n return { a: posA, b: posB };\n }\n if (childA.content.size || childB.content.size) {\n let inner = findDiffEnd(childA.content, childB.content, posA - 1, posB - 1);\n if (inner)\n return inner;\n }\n posA -= size;\n posB -= size;\n }\n}\n\n/**\nA fragment represents a node's collection of child nodes.\n\nLike nodes, fragments are persistent data structures, and you\nshould not mutate them or their content. Rather, you create new\ninstances whenever needed. The API tries to make this easy.\n*/\nclass Fragment {\n /**\n @internal\n */\n constructor(\n /**\n The child nodes in this fragment.\n */\n content, size) {\n this.content = content;\n this.size = size || 0;\n if (size == null)\n for (let i = 0; i < content.length; i++)\n this.size += content[i].nodeSize;\n }\n /**\n Invoke a callback for all descendant nodes between the given two\n positions (relative to start of this fragment). Doesn't descend\n into a node when the callback returns `false`.\n */\n nodesBetween(from, to, f, nodeStart = 0, parent) {\n for (let i = 0, pos = 0; pos < to; i++) {\n let child = this.content[i], end = pos + child.nodeSize;\n if (end > from && f(child, nodeStart + pos, parent || null, i) !== false && child.content.size) {\n let start = pos + 1;\n child.nodesBetween(Math.max(0, from - start), Math.min(child.content.size, to - start), f, nodeStart + start);\n }\n pos = end;\n }\n }\n /**\n Call the given callback for every descendant node. `pos` will be\n relative to the start of the fragment. The callback may return\n `false` to prevent traversal of a given node's children.\n */\n descendants(f) {\n this.nodesBetween(0, this.size, f);\n }\n /**\n Extract the text between `from` and `to`. See the same method on\n [`Node`](https://prosemirror.net/docs/ref/#model.Node.textBetween).\n */\n textBetween(from, to, blockSeparator, leafText) {\n let text = \"\", first = true;\n this.nodesBetween(from, to, (node, pos) => {\n let nodeText = node.isText ? node.text.slice(Math.max(from, pos) - pos, to - pos)\n : !node.isLeaf ? \"\"\n : leafText ? (typeof leafText === \"function\" ? leafText(node) : leafText)\n : node.type.spec.leafText ? node.type.spec.leafText(node)\n : \"\";\n if (node.isBlock && (node.isLeaf && nodeText || node.isTextblock) && blockSeparator) {\n if (first)\n first = false;\n else\n text += blockSeparator;\n }\n text += nodeText;\n }, 0);\n return text;\n }\n /**\n Create a new fragment containing the combined content of this\n fragment and the other.\n */\n append(other) {\n if (!other.size)\n return this;\n if (!this.size)\n return other;\n let last = this.lastChild, first = other.firstChild, content = this.content.slice(), i = 0;\n if (last.isText && last.sameMarkup(first)) {\n content[content.length - 1] = last.withText(last.text + first.text);\n i = 1;\n }\n for (; i < other.content.length; i++)\n content.push(other.content[i]);\n return new Fragment(content, this.size + other.size);\n }\n /**\n Cut out the sub-fragment between the two given positions.\n */\n cut(from, to = this.size) {\n if (from == 0 && to == this.size)\n return this;\n let result = [], size = 0;\n if (to > from)\n for (let i = 0, pos = 0; pos < to; i++) {\n let child = this.content[i], end = pos + child.nodeSize;\n if (end > from) {\n if (pos < from || end > to) {\n if (child.isText)\n child = child.cut(Math.max(0, from - pos), Math.min(child.text.length, to - pos));\n else\n child = child.cut(Math.max(0, from - pos - 1), Math.min(child.content.size, to - pos - 1));\n }\n result.push(child);\n size += child.nodeSize;\n }\n pos = end;\n }\n return new Fragment(result, size);\n }\n /**\n @internal\n */\n cutByIndex(from, to) {\n if (from == to)\n return Fragment.empty;\n if (from == 0 && to == this.content.length)\n return this;\n return new Fragment(this.content.slice(from, to));\n }\n /**\n Create a new fragment in which the node at the given index is\n replaced by the given node.\n */\n replaceChild(index, node) {\n let current = this.content[index];\n if (current == node)\n return this;\n let copy = this.content.slice();\n let size = this.size + node.nodeSize - current.nodeSize;\n copy[index] = node;\n return new Fragment(copy, size);\n }\n /**\n Create a new fragment by prepending the given node to this\n fragment.\n */\n addToStart(node) {\n return new Fragment([node].concat(this.content), this.size + node.nodeSize);\n }\n /**\n Create a new fragment by appending the given node to this\n fragment.\n */\n addToEnd(node) {\n return new Fragment(this.content.concat(node), this.size + node.nodeSize);\n }\n /**\n Compare this fragment to another one.\n */\n eq(other) {\n if (this.content.length != other.content.length)\n return false;\n for (let i = 0; i < this.content.length; i++)\n if (!this.content[i].eq(other.content[i]))\n return false;\n return true;\n }\n /**\n The first child of the fragment, or `null` if it is empty.\n */\n get firstChild() { return this.content.length ? this.content[0] : null; }\n /**\n The last child of the fragment, or `null` if it is empty.\n */\n get lastChild() { return this.content.length ? this.content[this.content.length - 1] : null; }\n /**\n The number of child nodes in this fragment.\n */\n get childCount() { return this.content.length; }\n /**\n Get the child node at the given index. Raise an error when the\n index is out of range.\n */\n child(index) {\n let found = this.content[index];\n if (!found)\n throw new RangeError(\"Index \" + index + \" out of range for \" + this);\n return found;\n }\n /**\n Get the child node at the given index, if it exists.\n */\n maybeChild(index) {\n return this.content[index] || null;\n }\n /**\n Call `f` for every child node, passing the node, its offset\n into this parent node, and its index.\n */\n forEach(f) {\n for (let i = 0, p = 0; i < this.content.length; i++) {\n let child = this.content[i];\n f(child, p, i);\n p += child.nodeSize;\n }\n }\n /**\n Find the first position at which this fragment and another\n fragment differ, or `null` if they are the same.\n */\n findDiffStart(other, pos = 0) {\n return findDiffStart(this, other, pos);\n }\n /**\n Find the first position, searching from the end, at which this\n fragment and the given fragment differ, or `null` if they are\n the same. Since this position will not be the same in both\n nodes, an object with two separate positions is returned.\n */\n findDiffEnd(other, pos = this.size, otherPos = other.size) {\n return findDiffEnd(this, other, pos, otherPos);\n }\n /**\n Find the index and inner offset corresponding to a given relative\n position in this fragment. The result object will be reused\n (overwritten) the next time the function is called. @internal\n */\n findIndex(pos) {\n if (pos == 0)\n return retIndex(0, pos);\n if (pos == this.size)\n return retIndex(this.content.length, pos);\n if (pos > this.size || pos < 0)\n throw new RangeError(`Position ${pos} outside of fragment (${this})`);\n for (let i = 0, curPos = 0;; i++) {\n let cur = this.child(i), end = curPos + cur.nodeSize;\n if (end >= pos) {\n if (end == pos)\n return retIndex(i + 1, end);\n return retIndex(i, curPos);\n }\n curPos = end;\n }\n }\n /**\n Return a debugging string that describes this fragment.\n */\n toString() { return \"<\" + this.toStringInner() + \">\"; }\n /**\n @internal\n */\n toStringInner() { return this.content.join(\", \"); }\n /**\n Create a JSON-serializeable representation of this fragment.\n */\n toJSON() {\n return this.content.length ? this.content.map(n => n.toJSON()) : null;\n }\n /**\n Deserialize a fragment from its JSON representation.\n */\n static fromJSON(schema, value) {\n if (!value)\n return Fragment.empty;\n if (!Array.isArray(value))\n throw new RangeError(\"Invalid input for Fragment.fromJSON\");\n return new Fragment(value.map(schema.nodeFromJSON));\n }\n /**\n Build a fragment from an array of nodes. Ensures that adjacent\n text nodes with the same marks are joined together.\n */\n static fromArray(array) {\n if (!array.length)\n return Fragment.empty;\n let joined, size = 0;\n for (let i = 0; i < array.length; i++) {\n let node = array[i];\n size += node.nodeSize;\n if (i && node.isText && array[i - 1].sameMarkup(node)) {\n if (!joined)\n joined = array.slice(0, i);\n joined[joined.length - 1] = node\n .withText(joined[joined.length - 1].text + node.text);\n }\n else if (joined) {\n joined.push(node);\n }\n }\n return new Fragment(joined || array, size);\n }\n /**\n Create a fragment from something that can be interpreted as a\n set of nodes. For `null`, it returns the empty fragment. For a\n fragment, the fragment itself. For a node or array of nodes, a\n fragment containing those nodes.\n */\n static from(nodes) {\n if (!nodes)\n return Fragment.empty;\n if (nodes instanceof Fragment)\n return nodes;\n if (Array.isArray(nodes))\n return this.fromArray(nodes);\n if (nodes.attrs)\n return new Fragment([nodes], nodes.nodeSize);\n throw new RangeError(\"Can not convert \" + nodes + \" to a Fragment\" +\n (nodes.nodesBetween ? \" (looks like multiple versions of prosemirror-model were loaded)\" : \"\"));\n }\n}\n/**\nAn empty fragment. Intended to be reused whenever a node doesn't\ncontain anything (rather than allocating a new empty fragment for\neach leaf node).\n*/\nFragment.empty = new Fragment([], 0);\nconst found = { index: 0, offset: 0 };\nfunction retIndex(index, offset) {\n found.index = index;\n found.offset = offset;\n return found;\n}\n\nfunction compareDeep(a, b) {\n if (a === b)\n return true;\n if (!(a && typeof a == \"object\") ||\n !(b && typeof b == \"object\"))\n return false;\n let array = Array.isArray(a);\n if (Array.isArray(b) != array)\n return false;\n if (array) {\n if (a.length != b.length)\n return false;\n for (let i = 0; i < a.length; i++)\n if (!compareDeep(a[i], b[i]))\n return false;\n }\n else {\n for (let p in a)\n if (!(p in b) || !compareDeep(a[p], b[p]))\n return false;\n for (let p in b)\n if (!(p in a))\n return false;\n }\n return true;\n}\n\n/**\nA mark is a piece of information that can be attached to a node,\nsuch as it being emphasized, in code font, or a link. It has a\ntype and optionally a set of attributes that provide further\ninformation (such as the target of the link). Marks are created\nthrough a `Schema`, which controls which types exist and which\nattributes they have.\n*/\nclass Mark {\n /**\n @internal\n */\n constructor(\n /**\n The type of this mark.\n */\n type, \n /**\n The attributes associated with this mark.\n */\n attrs) {\n this.type = type;\n this.attrs = attrs;\n }\n /**\n Given a set of marks, create a new set which contains this one as\n well, in the right position. If this mark is already in the set,\n the set itself is returned. If any marks that are set to be\n [exclusive](https://prosemirror.net/docs/ref/#model.MarkSpec.excludes) with this mark are present,\n those are replaced by this one.\n */\n addToSet(set) {\n let copy, placed = false;\n for (let i = 0; i < set.length; i++) {\n let other = set[i];\n if (this.eq(other))\n return set;\n if (this.type.excludes(other.type)) {\n if (!copy)\n copy = set.slice(0, i);\n }\n else if (other.type.excludes(this.type)) {\n return set;\n }\n else {\n if (!placed && other.type.rank > this.type.rank) {\n if (!copy)\n copy = set.slice(0, i);\n copy.push(this);\n placed = true;\n }\n if (copy)\n copy.push(other);\n }\n }\n if (!copy)\n copy = set.slice();\n if (!placed)\n copy.push(this);\n return copy;\n }\n /**\n Remove this mark from the given set, returning a new set. If this\n mark is not in the set, the set itself is returned.\n */\n removeFromSet(set) {\n for (let i = 0; i < set.length; i++)\n if (this.eq(set[i]))\n return set.slice(0, i).concat(set.slice(i + 1));\n return set;\n }\n /**\n Test whether this mark is in the given set of marks.\n */\n isInSet(set) {\n for (let i = 0; i < set.length; i++)\n if (this.eq(set[i]))\n return true;\n return false;\n }\n /**\n Test whether this mark has the same type and attributes as\n another mark.\n */\n eq(other) {\n return this == other ||\n (this.type == other.type && compareDeep(this.attrs, other.attrs));\n }\n /**\n Convert this mark to a JSON-serializeable representation.\n */\n toJSON() {\n let obj = { type: this.type.name };\n for (let _ in this.attrs) {\n obj.attrs = this.attrs;\n break;\n }\n return obj;\n }\n /**\n Deserialize a mark from JSON.\n */\n static fromJSON(schema, json) {\n if (!json)\n throw new RangeError(\"Invalid input for Mark.fromJSON\");\n let type = schema.marks[json.type];\n if (!type)\n throw new RangeError(`There is no mark type ${json.type} in this schema`);\n let mark = type.create(json.attrs);\n type.checkAttrs(mark.attrs);\n return mark;\n }\n /**\n Test whether two sets of marks are identical.\n */\n static sameSet(a, b) {\n if (a == b)\n return true;\n if (a.length != b.length)\n return false;\n for (let i = 0; i < a.length; i++)\n if (!a[i].eq(b[i]))\n return false;\n return true;\n }\n /**\n Create a properly sorted mark set from null, a single mark, or an\n unsorted array of marks.\n */\n static setFrom(marks) {\n if (!marks || Array.isArray(marks) && marks.length == 0)\n return Mark.none;\n if (marks instanceof Mark)\n return [marks];\n let copy = marks.slice();\n copy.sort((a, b) => a.type.rank - b.type.rank);\n return copy;\n }\n}\n/**\nThe empty set of marks.\n*/\nMark.none = [];\n\n/**\nError type raised by [`Node.replace`](https://prosemirror.net/docs/ref/#model.Node.replace) when\ngiven an invalid replacement.\n*/\nclass ReplaceError extends Error {\n}\n/*\nReplaceError = function(this: any, message: string) {\n let err = Error.call(this, message)\n ;(err as any).__proto__ = ReplaceError.prototype\n return err\n} as any\n\nReplaceError.prototype = Object.create(Error.prototype)\nReplaceError.prototype.constructor = ReplaceError\nReplaceError.prototype.name = \"ReplaceError\"\n*/\n/**\nA slice represents a piece cut out of a larger document. It\nstores not only a fragment, but also the depth up to which nodes on\nboth side are \u2018open\u2019 (cut through).\n*/\nclass Slice {\n /**\n Create a slice. When specifying a non-zero open depth, you must\n make sure that there are nodes of at least that depth at the\n appropriate side of the fragment\u2014i.e. if the fragment is an\n empty paragraph node, `openStart` and `openEnd` can't be greater\n than 1.\n \n It is not necessary for the content of open nodes to conform to\n the schema's content constraints, though it should be a valid\n start/end/middle for such a node, depending on which sides are\n open.\n */\n constructor(\n /**\n The slice's content.\n */\n content, \n /**\n The open depth at the start of the fragment.\n */\n openStart, \n /**\n The open depth at the end.\n */\n openEnd) {\n this.content = content;\n this.openStart = openStart;\n this.openEnd = openEnd;\n }\n /**\n The size this slice would add when inserted into a document.\n */\n get size() {\n return this.content.size - this.openStart - this.openEnd;\n }\n /**\n @internal\n */\n insertAt(pos, fragment) {\n let content = insertInto(this.content, pos + this.openStart, fragment);\n return content && new Slice(content, this.openStart, this.openEnd);\n }\n /**\n @internal\n */\n removeBetween(from, to) {\n return new Slice(removeRange(this.content, from + this.openStart, to + this.openStart), this.openStart, this.openEnd);\n }\n /**\n Tests whether this slice is equal to another slice.\n */\n eq(other) {\n return this.content.eq(other.content) && this.openStart == other.openStart && this.openEnd == other.openEnd;\n }\n /**\n @internal\n */\n toString() {\n return this.content + \"(\" + this.openStart + \",\" + this.openEnd + \")\";\n }\n /**\n Convert a slice to a JSON-serializable representation.\n */\n toJSON() {\n if (!this.content.size)\n return null;\n let json = { content: this.content.toJSON() };\n if (this.openStart > 0)\n json.openStart = this.openStart;\n if (this.openEnd > 0)\n json.openEnd = this.openEnd;\n return json;\n }\n /**\n Deserialize a slice from its JSON representation.\n */\n static fromJSON(schema, json) {\n if (!json)\n return Slice.empty;\n let openStart = json.openStart || 0, openEnd = json.openEnd || 0;\n if (typeof openStart != \"number\" || typeof openEnd != \"number\")\n throw new RangeError(\"Invalid input for Slice.fromJSON\");\n return new Slice(Fragment.fromJSON(schema, json.content), openStart, openEnd);\n }\n /**\n Create a slice from a fragment by taking the maximum possible\n open value on both side of the fragment.\n */\n static maxOpen(fragment, openIsolating = true) {\n let openStart = 0, openEnd = 0;\n for (let n = fragment.firstChild; n && !n.isLeaf && (openIsolating || !n.type.spec.isolating); n = n.firstChild)\n openStart++;\n for (let n = fragment.lastChild; n && !n.isLeaf && (openIsolating || !n.type.spec.isolating); n = n.lastChild)\n openEnd++;\n return new Slice(fragment, openStart, openEnd);\n }\n}\n/**\nThe empty slice.\n*/\nSlice.empty = new Slice(Fragment.empty, 0, 0);\nfunction removeRange(content, from, to) {\n let { index, offset } = content.findIndex(from), child = content.maybeChild(index);\n let { index: indexTo, offset: offsetTo } = content.findIndex(to);\n if (offset == from || child.isText) {\n if (offsetTo != to && !content.child(indexTo).isText)\n throw new RangeError(\"Removing non-flat range\");\n return content.cut(0, from).append(content.cut(to));\n }\n if (index != indexTo)\n throw new RangeError(\"Removing non-flat range\");\n return content.replaceChild(index, child.copy(removeRange(child.content, from - offset - 1, to - offset - 1)));\n}\nfunction insertInto(content, dist, insert, parent) {\n let { index, offset } = content.findIndex(dist), child = content.maybeChild(index);\n if (offset == dist || child.isText) {\n if (parent && !parent.canReplace(index, index, insert))\n return null;\n return content.cut(0, dist).append(insert).append(content.cut(dist));\n }\n let inner = insertInto(child.content, dist - offset - 1, insert, child);\n return inner && content.replaceChild(index, child.copy(inner));\n}\nfunction replace($from, $to, slice) {\n if (slice.openStart > $from.depth)\n throw new ReplaceError(\"Inserted content deeper than insertion position\");\n if ($from.depth - slice.openStart != $to.depth - slice.openEnd)\n throw new ReplaceError(\"Inconsistent open depths\");\n return replaceOuter($from, $to, slice, 0);\n}\nfunction replaceOuter($from, $to, slice, depth) {\n let index = $from.index(depth), node = $from.node(depth);\n if (index == $to.index(depth) && depth < $from.depth - slice.openStart) {\n let inner = replaceOuter($from, $to, slice, depth + 1);\n return node.copy(node.content.replaceChild(index, inner));\n }\n else if (!slice.content.size) {\n return close(node, replaceTwoWay($from, $to, depth));\n }\n else if (!slice.openStart && !slice.openEnd && $from.depth == depth && $to.depth == depth) { // Simple, flat case\n let parent = $from.parent, content = parent.content;\n return close(parent, content.cut(0, $from.parentOffset).append(slice.content).append(content.cut($to.parentOffset)));\n }\n else {\n let { start, end } = prepareSliceForReplace(slice, $from);\n return close(node, replaceThreeWay($from, start, end, $to, depth));\n }\n}\nfunction checkJoin(main, sub) {\n if (!sub.type.compatibleContent(main.type))\n throw new ReplaceError(\"Cannot join \" + sub.type.name + \" onto \" + main.type.name);\n}\nfunction joinable($before, $after, depth) {\n let node = $before.node(depth);\n checkJoin(node, $after.node(depth));\n return node;\n}\nfunction addNode(child, target) {\n let last = target.length - 1;\n if (last >= 0 && child.isText && child.sameMarkup(target[last]))\n target[last] = child.withText(target[last].text + child.text);\n else\n target.push(child);\n}\nfunction addRange($start, $end, depth, target) {\n let node = ($end || $start).node(depth);\n let startIndex = 0, endIndex = $end ? $end.index(depth) : node.childCount;\n if ($start) {\n startIndex = $start.index(depth);\n if ($start.depth > depth) {\n startIndex++;\n }\n else if ($start.textOffset) {\n addNode($start.nodeAfter, target);\n startIndex++;\n }\n }\n for (let i = startIndex; i < endIndex; i++)\n addNode(node.child(i), target);\n if ($end && $end.depth == depth && $end.textOffset)\n addNode($end.nodeBefore, target);\n}\nfunction close(node, content) {\n node.type.checkContent(content);\n return node.copy(content);\n}\nfunction replaceThreeWay($from, $start, $end, $to, depth) {\n let openStart = $from.depth > depth && joinable($from, $start, depth + 1);\n let openEnd = $to.depth > depth && joinable($end, $to, depth + 1);\n let content = [];\n addRange(null, $from, depth, content);\n if (openStart && openEnd && $start.index(depth) == $end.index(depth)) {\n checkJoin(openStart, openEnd);\n addNode(close(openStart, replaceThreeWay($from, $start, $end, $to, depth + 1)), content);\n }\n else {\n if (openStart)\n addNode(close(openStart, replaceTwoWay($from, $start, depth + 1)), content);\n addRange($start, $end, depth, content);\n if (openEnd)\n addNode(close(openEnd, replaceTwoWay($end, $to, depth + 1)), content);\n }\n addRange($to, null, depth, content);\n return new Fragment(content);\n}\nfunction replaceTwoWay($from, $to, depth) {\n let content = [];\n addRange(null, $from, depth, content);\n if ($from.depth > depth) {\n let type = joinable($from, $to, depth + 1);\n addNode(close(type, replaceTwoWay($from, $to, depth + 1)), content);\n }\n addRange($to, null, depth, content);\n return new Fragment(content);\n}\nfunction prepareSliceForReplace(slice, $along) {\n let extra = $along.depth - slice.openStart, parent = $along.node(extra);\n let node = parent.copy(slice.content);\n for (let i = extra - 1; i >= 0; i--)\n node = $along.node(i).copy(Fragment.from(node));\n return { start: node.resolveNoCache(slice.openStart + extra),\n end: node.resolveNoCache(node.content.size - slice.openEnd - extra) };\n}\n\n/**\nYou can [_resolve_](https://prosemirror.net/docs/ref/#model.Node.resolve) a position to get more\ninformation about it. Objects of this class represent such a\nresolved position, providing various pieces of context\ninformation, and some helper methods.\n\nThroughout this interface, methods that take an optional `depth`\nparameter will interpret undefined as `this.depth` and negative\nnumbers as `this.depth + value`.\n*/\nclass ResolvedPos {\n /**\n @internal\n */\n constructor(\n /**\n The position that was resolved.\n */\n pos, \n /**\n @internal\n */\n path, \n /**\n The offset this position has into its parent node.\n */\n parentOffset) {\n this.pos = pos;\n this.path = path;\n this.parentOffset = parentOffset;\n this.depth = path.length / 3 - 1;\n }\n /**\n @internal\n */\n resolveDepth(val) {\n if (val == null)\n return this.depth;\n if (val < 0)\n return this.depth + val;\n return val;\n }\n /**\n The parent node that the position points into. Note that even if\n a position points into a text node, that node is not considered\n the parent\u2014text nodes are \u2018flat\u2019 in this model, and have no content.\n */\n get parent() { return this.node(this.depth); }\n /**\n The root node in which the position was resolved.\n */\n get doc() { return this.node(0); }\n /**\n The ancestor node at the given level. `p.node(p.depth)` is the\n same as `p.parent`.\n */\n node(depth) { return this.path[this.resolveDepth(depth) * 3]; }\n /**\n The index into the ancestor at the given level. If this points\n at the 3rd node in the 2nd paragraph on the top level, for\n example, `p.index(0)` is 1 and `p.index(1)` is 2.\n */\n index(depth) { return this.path[this.resolveDepth(depth) * 3 + 1]; }\n /**\n The index pointing after this position into the ancestor at the\n given level.\n */\n indexAfter(depth) {\n depth = this.resolveDepth(depth);\n return this.index(depth) + (depth == this.depth && !this.textOffset ? 0 : 1);\n }\n /**\n The (absolute) position at the start of the node at the given\n level.\n */\n start(depth) {\n depth = this.resolveDepth(depth);\n return depth == 0 ? 0 : this.path[depth * 3 - 1] + 1;\n }\n /**\n The (absolute) position at the end of the node at the given\n level.\n */\n end(depth) {\n depth = this.resolveDepth(depth);\n return this.start(depth) + this.node(depth).content.size;\n }\n /**\n The (absolute) position directly before the wrapping node at the\n given level, or, when `depth` is `this.depth + 1`, the original\n position.\n */\n before(depth) {\n depth = this.resolveDepth(depth);\n if (!depth)\n throw new RangeError(\"There is no position before the top-level node\");\n return depth == this.depth + 1 ? this.pos : this.path[depth * 3 - 1];\n }\n /**\n The (absolute) position directly after the wrapping node at the\n given level, or the original position when `depth` is `this.depth + 1`.\n */\n after(depth) {\n depth = this.resolveDepth(depth);\n if (!depth)\n throw new RangeError(\"There is no position after the top-level node\");\n return depth == this.depth + 1 ? this.pos : this.path[depth * 3 - 1] + this.path[depth * 3].nodeSize;\n }\n /**\n When this position points into a text node, this returns the\n distance between the position and the start of the text node.\n Will be zero for positions that point between nodes.\n */\n get textOffset() { return this.pos - this.path[this.path.length - 1]; }\n /**\n Get the node directly after the position, if any. If the position\n points into a text node, only the part of that node after the\n position is returned.\n */\n get nodeAfter() {\n let parent = this.parent, index = this.index(this.depth);\n if (index == parent.childCount)\n return null;\n let dOff = this.pos - this.path[this.path.length - 1], child = parent.child(index);\n return dOff ? parent.child(index).cut(dOff) : child;\n }\n /**\n Get the node directly before the position, if any. If the\n position points into a text node, only the part of that node\n before the position is returned.\n */\n get nodeBefore() {\n let index = this.index(this.depth);\n let dOff = this.pos - this.path[this.path.length - 1];\n if (dOff)\n return this.parent.child(index).cut(0, dOff);\n return index == 0 ? null : this.parent.child(index - 1);\n }\n /**\n Get the position at the given index in the parent node at the\n given depth (which defaults to `this.depth`).\n */\n posAtIndex(index, depth) {\n depth = this.resolveDepth(depth);\n let node = this.path[depth * 3], pos = depth == 0 ? 0 : this.path[depth * 3 - 1] + 1;\n for (let i = 0; i < index; i++)\n pos += node.child(i).nodeSize;\n return pos;\n }\n /**\n Get the marks at this position, factoring in the surrounding\n marks' [`inclusive`](https://prosemirror.net/docs/ref/#model.MarkSpec.inclusive) property. If the\n position is at the start of a non-empty node, the marks of the\n node after it (if any) are returned.\n */\n marks() {\n let parent = this.parent, index = this.index();\n // In an empty parent, return the empty array\n if (parent.content.size == 0)\n return Mark.none;\n // When inside a text node, just return the text node's marks\n if (this.textOffset)\n return parent.child(index).marks;\n let main = parent.maybeChild(index - 1), other = parent.maybeChild(index);\n // If the `after` flag is true of there is no node before, make\n // the node after this position the main reference.\n if (!main) {\n let tmp = main;\n main = other;\n other = tmp;\n }\n // Use all marks in the main node, except those that have\n // `inclusive` set to false and are not present in the other node.\n let marks = main.marks;\n for (var i = 0; i < marks.length; i++)\n if (marks[i].type.spec.inclusive === false && (!other || !marks[i].isInSet(other.marks)))\n marks = marks[i--].removeFromSet(marks);\n return marks;\n }\n /**\n Get the marks after the current position, if any, except those\n that are non-inclusive and not present at position `$end`. This\n is mostly useful for getting the set of marks to preserve after a\n deletion. Will return `null` if this position is at the end of\n its parent node or its parent node isn't a textblock (in which\n case no marks should be preserved).\n */\n marksAcross($end) {\n let after = this.parent.maybeChild(this.index());\n if (!after || !after.isInline)\n return null;\n let marks = after.marks, next = $end.parent.maybeChild($end.index());\n for (var i = 0; i < marks.length; i++)\n if (marks[i].type.spec.inclusive === false && (!next || !marks[i].isInSet(next.marks)))\n marks = marks[i--].removeFromSet(marks);\n return marks;\n }\n /**\n The depth up to which this position and the given (non-resolved)\n position share the same parent nodes.\n */\n sharedDepth(pos) {\n for (let depth = this.depth; depth > 0; depth--)\n if (this.start(depth) <= pos && this.end(depth) >= pos)\n return depth;\n return 0;\n }\n /**\n Returns a range based on the place where this position and the\n given position diverge around block content. If both point into\n the same textblock, for example, a range around that textblock\n will be returned. If they point into different blocks, the range\n around those blocks in their shared ancestor is returned. You can\n pass in an optional predicate that will be called with a parent\n node to see if a range into that parent is acceptable.\n */\n blockRange(other = this, pred) {\n if (other.pos < this.pos)\n return other.blockRange(this);\n for (let d = this.depth - (this.parent.inlineContent || this.pos == other.pos ? 1 : 0); d >= 0; d--)\n if (other.pos <= this.end(d) && (!pred || pred(this.node(d))))\n return new NodeRange(this, other, d);\n return null;\n }\n /**\n Query whether the given position shares the same parent node.\n */\n sameParent(other) {\n return this.pos - this.parentOffset == other.pos - other.parentOffset;\n }\n /**\n Return the greater of this and the given position.\n */\n max(other) {\n return other.pos > this.pos ? other : this;\n }\n /**\n Return the smaller of this and the given position.\n */\n min(other) {\n return other.pos < this.pos ? other : this;\n }\n /**\n @internal\n */\n toString() {\n let str = \"\";\n for (let i = 1; i <= this.depth; i++)\n str += (str ? \"/\" : \"\") + this.node(i).type.name + \"_\" + this.index(i - 1);\n return str + \":\" + this.parentOffset;\n }\n /**\n @internal\n */\n static resolve(doc, pos) {\n if (!(pos >= 0 && pos <= doc.content.size))\n throw new RangeError(\"Position \" + pos + \" out of range\");\n let path = [];\n let start = 0, parentOffset = pos;\n for (let node = doc;;) {\n let { index, offset } = node.content.findIndex(parentOffset);\n let rem = parentOffset - offset;\n path.push(node, index, start + offset);\n if (!rem)\n break;\n node = node.child(index);\n if (node.isText)\n break;\n parentOffset = rem - 1;\n start += offset + 1;\n }\n return new ResolvedPos(pos, path, parentOffset);\n }\n /**\n @internal\n */\n static resolveCached(doc, pos) {\n let cache = resolveCache.get(doc);\n if (cache) {\n for (let i = 0; i < cache.elts.length; i++) {\n let elt = cache.elts[i];\n if (elt.pos == pos)\n return elt;\n }\n }\n else {\n resolveCache.set(doc, cache = new ResolveCache);\n }\n let result = cache.elts[cache.i] = ResolvedPos.resolve(doc, pos);\n cache.i = (cache.i + 1) % resolveCacheSize;\n return result;\n }\n}\nclass ResolveCache {\n constructor() {\n this.elts = [];\n this.i = 0;\n }\n}\nconst resolveCacheSize = 12, resolveCache = new WeakMap();\n/**\nRepresents a flat range of content, i.e. one that starts and\nends in the same node.\n*/\nclass NodeRange {\n /**\n Construct a node range. `$from` and `$to` should point into the\n same node until at least the given `depth`, since a node range\n denotes an adjacent set of nodes in a single parent node.\n */\n constructor(\n /**\n A resolved position along the start of the content. May have a\n `depth` greater than this object's `depth` property, since\n these are the positions that were used to compute the range,\n not re-resolved positions directly at its boundaries.\n */\n $from, \n /**\n A position along the end of the content. See\n caveat for [`$from`](https://prosemirror.net/docs/ref/#model.NodeRange.$from).\n */\n $to, \n /**\n The depth of the node that this range points into.\n */\n depth) {\n this.$from = $from;\n this.$to = $to;\n this.depth = depth;\n }\n /**\n The position at the start of the range.\n */\n get start() { return this.$from.before(this.depth + 1); }\n /**\n The position at the end of the range.\n */\n get end() { return this.$to.after(this.depth + 1); }\n /**\n The parent node that the range points into.\n */\n get parent() { return this.$from.node(this.depth); }\n /**\n The start index of the range in the parent node.\n */\n get startIndex() { return this.$from.index(this.depth); }\n /**\n The end index of the range in the parent node.\n */\n get endIndex() { return this.$to.indexAfter(this.depth); }\n}\n\nconst emptyAttrs = Object.create(null);\n/**\nThis class represents a node in the tree that makes up a\nProseMirror document. So a document is an instance of `Node`, with\nchildren that are also instances of `Node`.\n\nNodes are persistent data structures. Instead of changing them, you\ncreate new ones with the content you want. Old ones keep pointing\nat the old document shape. This is made cheaper by sharing\nstructure between the old and new data as much as possible, which a\ntree shape like this (without back pointers) makes easy.\n\n**Do not** directly mutate the properties of a `Node` object. See\n[the guide](https://prosemirror.net/docs/guide/#doc) for more information.\n*/\nclass Node {\n /**\n @internal\n */\n constructor(\n /**\n The type of node that this is.\n */\n type, \n /**\n An object mapping attribute names to values. The kind of\n attributes allowed and required are\n [determined](https://prosemirror.net/docs/ref/#model.NodeSpec.attrs) by the node type.\n */\n attrs, \n // A fragment holding the node's children.\n content, \n /**\n The marks (things like whether it is emphasized or part of a\n link) applied to this node.\n */\n marks = Mark.none) {\n this.type = type;\n this.attrs = attrs;\n this.marks = marks;\n this.content = content || Fragment.empty;\n }\n /**\n The array of this node's child nodes.\n */\n get children() { return this.content.content; }\n /**\n The size of this node, as defined by the integer-based [indexing\n scheme](https://prosemirror.net/docs/guide/#doc.indexing). For text nodes, this is the\n amount of characters. For other leaf nodes, it is one. For\n non-leaf nodes, it is the size of the content plus two (the\n start and end token).\n */\n get nodeSize() { return this.isLeaf ? 1 : 2 + this.content.size; }\n /**\n The number of children that the node has.\n */\n get childCount() { return this.content.childCount; }\n /**\n Get the child node at the given index. Raises an error when the\n index is out of range.\n */\n child(index) { return this.content.child(index); }\n /**\n Get the child node at the given index, if it exists.\n */\n maybeChild(index) { return this.content.maybeChild(index); }\n /**\n Call `f` for every child node, passing the node, its offset\n into this parent node, and its index.\n */\n forEach(f) { this.content.forEach(f); }\n /**\n Invoke a callback for all descendant nodes recursively between\n the given two positions that are relative to start of this\n node's content. The callback is invoked with the node, its\n position relative to the original node (method receiver),\n its parent node, and its child index. When the callback returns\n false for a given node, that node's children will not be\n recursed over. The last parameter can be used to specify a\n starting position to count from.\n */\n nodesBetween(from, to, f, startPos = 0) {\n this.content.nodesBetween(from, to, f, startPos, this);\n }\n /**\n Call the given callback for every descendant node. Doesn't\n descend into a node when the callback returns `false`.\n */\n descendants(f) {\n this.nodesBetween(0, this.content.size, f);\n }\n /**\n Concatenates all the text nodes found in this fragment and its\n children.\n */\n get textContent() {\n return (this.isLeaf && this.type.spec.leafText)\n ? this.type.spec.leafText(this)\n : this.textBetween(0, this.content.size, \"\");\n }\n /**\n Get all text between positions `from` and `to`. When\n `blockSeparator` is given, it will be inserted to separate text\n from different block nodes. If `leafText` is given, it'll be\n inserted for every non-text leaf node encountered, otherwise\n [`leafText`](https://prosemirror.net/docs/ref/#model.NodeSpec.leafText) will be used.\n */\n textBetween(from, to, blockSeparator, leafText) {\n return this.content.textBetween(from, to, blockSeparator, leafText);\n }\n /**\n Returns this node's first child, or `null` if there are no\n children.\n */\n get firstChild() { return this.content.firstChild; }\n /**\n Returns this node's last child, or `null` if there are no\n children.\n */\n get lastChild() { return this.content.lastChild; }\n /**\n Test whether two nodes represent the same piece of document.\n */\n eq(other) {\n return this == other || (this.sameMarkup(other) && this.content.eq(other.content));\n }\n /**\n Compare the markup (type, attributes, and marks) of this node to\n those of another. Returns `true` if both have the same markup.\n */\n sameMarkup(other) {\n return this.hasMarkup(other.type, other.attrs, other.marks);\n }\n /**\n Check whether this node's markup correspond to the given type,\n attributes, and marks.\n */\n hasMarkup(type, attrs, marks) {\n return this.type == type &&\n compareDeep(this.attrs, attrs || type.defaultAttrs || emptyAttrs) &&\n Mark.sameSet(this.marks, marks || Mark.none);\n }\n /**\n Create a new node with the same markup as this node, containing\n the given content (or empty, if no content is given).\n */\n copy(content = null) {\n if (content == this.content)\n return this;\n return new Node(this.type, this.attrs, content, this.marks);\n }\n /**\n Create a copy of this node, with the given set of marks instead\n of the node's own marks.\n */\n mark(marks) {\n return marks == this.marks ? this : new Node(this.type, this.attrs, this.content, marks);\n }\n /**\n Create a copy of this node with only the content between the\n given positions. If `to` is not given, it defaults to the end of\n the node.\n */\n cut(from, to = this.content.size) {\n if (from == 0 && to == this.content.size)\n return this;\n return this.copy(this.content.cut(from, to));\n }\n /**\n Cut out the part of the document between the given positions, and\n return it as a `Slice` object.\n */\n slice(from, to = this.content.size, includeParents = false) {\n if (from == to)\n return Slice.empty;\n let $from = this.resolve(from), $to = this.resolve(to);\n let depth = includeParents ? 0 : $from.sharedDepth(to);\n let start = $from.start(depth), node = $from.node(depth);\n let content = node.content.cut($from.pos - start, $to.pos - start);\n return new Slice(content, $from.depth - depth, $to.depth - depth);\n }\n /**\n Replace the part of the document between the given positions with\n the given slice. The slice must 'fit', meaning its open sides\n must be able to connect to the surrounding content, and its\n content nodes must be valid children for the node they are placed\n into. If any of this is violated, an error of type\n [`ReplaceError`](https://prosemirror.net/docs/ref/#model.ReplaceError) is thrown.\n */\n replace(from, to, slice) {\n return replace(this.resolve(from), this.resolve(to), slice);\n }\n /**\n Find the node directly after the given position.\n */\n nodeAt(pos) {\n for (let node = this;;) {\n let { index, offset } = node.content.findIndex(pos);\n node = node.maybeChild(index);\n if (!node)\n return null;\n if (offset == pos || node.isText)\n return node;\n pos -= offset + 1;\n }\n }\n /**\n Find the (direct) child node after the given offset, if any,\n and return it along with its index and offset relative to this\n node.\n */\n childAfter(pos) {\n let { index, offset } = this.content.findIndex(pos);\n return { node: this.content.maybeChild(index), index, offset };\n }\n /**\n Find the (direct) child node before the given offset, if any,\n and return it along with its index and offset relative to this\n node.\n */\n childBefore(pos) {\n if (pos == 0)\n return { node: null, index: 0, offset: 0 };\n let { index, offset } = this.content.findIndex(pos);\n if (offset < pos)\n return { node: this.content.child(index), index, offset };\n let node = this.content.child(index - 1);\n return { node, index: index - 1, offset: offset - node.nodeSize };\n }\n /**\n Resolve the given position in the document, returning an\n [object](https://prosemirror.net/docs/ref/#model.ResolvedPos) with information about its context.\n */\n resolve(pos) { return ResolvedPos.resolveCached(this, pos); }\n /**\n @internal\n */\n resolveNoCache(pos) { return ResolvedPos.resolve(this, pos); }\n /**\n Test whether a given mark or mark type occurs in this document\n between the two given positions.\n */\n rangeHasMark(from, to, type) {\n let found = false;\n if (to > from)\n this.nodesBetween(from, to, node => {\n if (type.isInSet(node.marks))\n found = true;\n return !found;\n });\n return found;\n }\n /**\n True when this is a block (non-inline node)\n */\n get isBlock() { return this.type.isBlock; }\n /**\n True when this is a textblock node, a block node with inline\n content.\n */\n get isTextblock() { return this.type.isTextblock; }\n /**\n True when this node allows inline content.\n */\n get inlineContent() { return this.type.inlineContent; }\n /**\n True when this is an inline node (a text node or a node that can\n appear among text).\n */\n get isInline() { return this.type.isInline; }\n /**\n True when this is a text node.\n */\n get isText() { return this.type.isText; }\n /**\n True when this is a leaf node.\n */\n get isLeaf() { return this.type.isLeaf; }\n /**\n True when this is an atom, i.e. when it does not have directly\n editable content. This is usually the same as `isLeaf`, but can\n be configured with the [`atom` property](https://prosemirror.net/docs/ref/#model.NodeSpec.atom)\n on a node's spec (typically used when the node is displayed as\n an uneditable [node view](https://prosemirror.net/docs/ref/#view.NodeView)).\n */\n get isAtom() { return this.type.isAtom; }\n /**\n Return a string representation of this node for debugging\n purposes.\n */\n toString() {\n if (this.type.spec.toDebugString)\n return this.type.spec.toDebugString(this);\n let name = this.type.name;\n if (this.content.size)\n name += \"(\" + this.content.toStringInner() + \")\";\n return wrapMarks(this.marks, name);\n }\n /**\n Get the content match in this node at the given index.\n */\n contentMatchAt(index) {\n let match = this.type.contentMatch.matchFragment(this.content, 0, index);\n if (!match)\n throw new Error(\"Called contentMatchAt on a node with invalid content\");\n return match;\n }\n /**\n Test whether replacing the range between `from` and `to` (by\n child index) with the given replacement fragment (which defaults\n to the empty fragment) would leave the node's content valid. You\n can optionally pass `start` and `end` indices into the\n replacement fragment.\n */\n canReplace(from, to, replacement = Fragment.empty, start = 0, end = replacement.childCount) {\n let one = this.contentMatchAt(from).matchFragment(replacement, start, end);\n let two = one && one.matchFragment(this.content, to);\n if (!two || !two.validEnd)\n return false;\n for (let i = start; i < end; i++)\n if (!this.type.allowsMarks(replacement.child(i).marks))\n return false;\n return true;\n }\n /**\n Test whether replacing the range `from` to `to` (by index) with\n a node of the given type would leave the node's content valid.\n */\n canReplaceWith(from, to, type, marks) {\n if (marks && !this.type.allowsMarks(marks))\n return false;\n let start = this.contentMatchAt(from).matchType(type);\n let end = start && start.matchFragment(this.content, to);\n return end ? end.validEnd : false;\n }\n /**\n Test whether the given node's content could be appended to this\n node. If that node is empty, this will only return true if there\n is at least one node type that can appear in both nodes (to avoid\n merging completely incompatible nodes).\n */\n canAppend(other) {\n if (other.content.size)\n return this.canReplace(this.childCount, this.childCount, other.content);\n else\n return this.type.compatibleContent(other.type);\n }\n /**\n Check whether this node and its descendants conform to the\n schema, and raise an exception when they do not.\n */\n check() {\n this.type.checkContent(this.content);\n this.type.checkAttrs(this.attrs);\n let copy = Mark.none;\n for (let i = 0; i < this.marks.length; i++) {\n let mark = this.marks[i];\n mark.type.checkAttrs(mark.attrs);\n copy = mark.addToSet(copy);\n }\n if (!Mark.sameSet(copy, this.marks))\n throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(m => m.type.name)}`);\n this.content.forEach(node => node.check());\n }\n /**\n Return a JSON-serializeable representation of this node.\n */\n toJSON() {\n let obj = { type: this.type.name };\n for (let _ in this.attrs) {\n obj.attrs = this.attrs;\n break;\n }\n if (this.content.size)\n obj.content = this.content.toJSON();\n if (this.marks.length)\n obj.marks = this.marks.map(n => n.toJSON());\n return obj;\n }\n /**\n Deserialize a node from its JSON representation.\n */\n static fromJSON(schema, json) {\n if (!json)\n throw new RangeError(\"Invalid input for Node.fromJSON\");\n let marks = undefined;\n if (json.marks) {\n if (!Array.isArray(json.marks))\n throw new RangeError(\"Invalid mark data for Node.fromJSON\");\n marks = json.marks.map(schema.markFromJSON);\n }\n if (json.type == \"text\") {\n if (typeof json.text != \"string\")\n throw new RangeError(\"Invalid text node in JSON\");\n return schema.text(json.text, marks);\n }\n let content = Fragment.fromJSON(schema, json.content);\n let node = schema.nodeType(json.type).create(json.attrs, content, marks);\n node.type.checkAttrs(node.attrs);\n return node;\n }\n}\nNode.prototype.text = undefined;\nclass TextNode extends Node {\n /**\n @internal\n */\n constructor(type, attrs, content, marks) {\n super(type, attrs, null, marks);\n if (!content)\n throw new RangeError(\"Empty text nodes are not allowed\");\n this.text = content;\n }\n toString() {\n if (this.type.spec.toDebugString)\n return this.type.spec.toDebugString(this);\n return wrapMarks(this.marks, JSON.stringify(this.text));\n }\n get textContent() { return this.text; }\n textBetween(from, to) { return this.text.slice(from, to); }\n get nodeSize() { return this.text.length; }\n mark(marks) {\n return marks == this.marks ? this : new TextNode(this.type, this.attrs, this.text, marks);\n }\n withText(text) {\n if (text == this.text)\n return this;\n return new TextNode(this.type, this.attrs, text, this.marks);\n }\n cut(from = 0, to = this.text.length) {\n if (from == 0 && to == this.text.length)\n return this;\n return this.withText(this.text.slice(from, to));\n }\n eq(other) {\n return this.sameMarkup(other) && this.text == other.text;\n }\n toJSON() {\n let base = super.toJSON();\n base.text = this.text;\n return base;\n }\n}\nfunction wrapMarks(marks, str) {\n for (let i = marks.length - 1; i >= 0; i--)\n str = marks[i].type.name + \"(\" + str + \")\";\n return str;\n}\n\n/**\nInstances of this class represent a match state of a node type's\n[content expression](https://prosemirror.net/docs/ref/#model.NodeSpec.content), and can be used to\nfind out whether further content matches here, and whether a given\nposition is a valid end of the node.\n*/\nclass ContentMatch {\n /**\n @internal\n */\n constructor(\n /**\n True when this match state represents a valid end of the node.\n */\n validEnd) {\n this.validEnd = validEnd;\n /**\n @internal\n */\n this.next = [];\n /**\n @internal\n */\n this.wrapCache = [];\n }\n /**\n @internal\n */\n static parse(string, nodeTypes) {\n let stream = new TokenStream(string, nodeTypes);\n if (stream.next == null)\n return ContentMatch.empty;\n let expr = parseExpr(stream);\n if (stream.next)\n stream.err(\"Unexpected trailing text\");\n let match = dfa(nfa(expr));\n checkForDeadEnds(match, stream);\n return match;\n }\n /**\n Match a node type, returning a match after that node if\n successful.\n */\n matchType(type) {\n for (let i = 0; i < this.next.length; i++)\n if (this.next[i].type == type)\n return this.next[i].next;\n return null;\n }\n /**\n Try to match a fragment. Returns the resulting match when\n successful.\n */\n matchFragment(frag, start = 0, end = frag.childCount) {\n let cur = this;\n for (let i = start; cur && i < end; i++)\n cur = cur.matchType(frag.child(i).type);\n return cur;\n }\n /**\n @internal\n */\n get inlineContent() {\n return this.next.length != 0 && this.next[0].type.isInline;\n }\n /**\n Get the first matching node type at this match position that can\n be generated.\n */\n get defaultType() {\n for (let i = 0; i < this.next.length; i++) {\n let { type } = this.next[i];\n if (!(type.isText || type.hasRequiredAttrs()))\n return type;\n }\n return null;\n }\n /**\n @internal\n */\n compatible(other) {\n for (let i = 0; i < this.next.length; i++)\n for (let j = 0; j < other.next.length; j++)\n if (this.next[i].type == other.next[j].type)\n return true;\n return false;\n }\n /**\n Try to match the given fragment, and if that fails, see if it can\n be made to match by inserting nodes in front of it. When\n successful, return a fragment of inserted nodes (which may be\n empty if nothing had to be inserted). When `toEnd` is true, only\n return a fragment if the resulting match goes to the end of the\n content expression.\n */\n fillBefore(after, toEnd = false, startIndex = 0) {\n let seen = [this];\n function search(match, types) {\n let finished = match.matchFragment(after, startIndex);\n if (finished && (!toEnd || finished.validEnd))\n return Fragment.from(types.map(tp => tp.createAndFill()));\n for (let i = 0; i < match.next.length; i++) {\n let { type, next } = match.next[i];\n if (!(type.isText || type.hasRequiredAttrs()) && seen.indexOf(next) == -1) {\n seen.push(next);\n let found = search(next, types.concat(type));\n if (found)\n return found;\n }\n }\n return null;\n }\n return search(this, []);\n }\n /**\n Find a set of wrapping node types that would allow a node of the\n given type to appear at this position. The result may be empty\n (when it fits directly) and will be null when no such wrapping\n exists.\n */\n findWrapping(target) {\n for (let i = 0; i < this.wrapCache.length; i += 2)\n if (this.wrapCache[i] == target)\n return this.wrapCache[i + 1];\n let computed = this.computeWrapping(target);\n this.wrapCache.push(target, computed);\n return computed;\n }\n /**\n @internal\n */\n computeWrapping(target) {\n let seen = Object.create(null), active = [{ match: this, type: null, via: null }];\n while (active.length) {\n let current = active.shift(), match = current.match;\n if (match.matchType(target)) {\n let result = [];\n for (let obj = current; obj.type; obj = obj.via)\n result.push(obj.type);\n return result.reverse();\n }\n for (let i = 0; i < match.next.length; i++) {\n let { type, next } = match.next[i];\n if (!type.isLeaf && !type.hasRequiredAttrs() && !(type.name in seen) && (!current.type || next.validEnd)) {\n active.push({ match: type.contentMatch, type, via: current });\n seen[type.name] = true;\n }\n }\n }\n return null;\n }\n /**\n The number of outgoing edges this node has in the finite\n automaton that describes the content expression.\n */\n get edgeCount() {\n return this.next.length;\n }\n /**\n Get the _n_\u200Bth outgoing edge from this node in the finite\n automaton that describes the content expression.\n */\n edge(n) {\n if (n >= this.next.length)\n throw new RangeError(`There's no ${n}th edge in this content match`);\n return this.next[n];\n }\n /**\n @internal\n */\n toString() {\n let seen = [];\n function scan(m) {\n seen.push(m);\n for (let i = 0; i < m.next.length; i++)\n if (seen.indexOf(m.next[i].next) == -1)\n scan(m.next[i].next);\n }\n scan(this);\n return seen.map((m, i) => {\n let out = i + (m.validEnd ? \"*\" : \" \") + \" \";\n for (let i = 0; i < m.next.length; i++)\n out += (i ? \", \" : \"\") + m.next[i].type.name + \"->\" + seen.indexOf(m.next[i].next);\n return out;\n }).join(\"\\n\");\n }\n}\n/**\n@internal\n*/\nContentMatch.empty = new ContentMatch(true);\nclass TokenStream {\n constructor(string, nodeTypes) {\n this.string = string;\n this.nodeTypes = nodeTypes;\n this.inline = null;\n this.pos = 0;\n this.tokens = string.split(/\\s*(?=\\b|\\W|$)/);\n if (this.tokens[this.tokens.length - 1] == \"\")\n this.tokens.pop();\n if (this.tokens[0] == \"\")\n this.tokens.shift();\n }\n get next() { return this.tokens[this.pos]; }\n eat(tok) { return this.next == tok && (this.pos++ || true); }\n err(str) { throw new SyntaxError(str + \" (in content expression '\" + this.string + \"')\"); }\n}\nfunction parseExpr(stream) {\n let exprs = [];\n do {\n exprs.push(parseExprSeq(stream));\n } while (stream.eat(\"|\"));\n return exprs.length == 1 ? exprs[0] : { type: \"choice\", exprs };\n}\nfunction parseExprSeq(stream) {\n let exprs = [];\n do {\n exprs.push(parseExprSubscript(stream));\n } while (stream.next && stream.next != \")\" && stream.next != \"|\");\n return exprs.length == 1 ? exprs[0] : { type: \"seq\", exprs };\n}\nfunction parseExprSubscript(stream) {\n let expr = parseExprAtom(stream);\n for (;;) {\n if (stream.eat(\"+\"))\n expr = { type: \"plus\", expr };\n else if (stream.eat(\"*\"))\n expr = { type: \"star\", expr };\n else if (stream.eat(\"?\"))\n expr = { type: \"opt\", expr };\n else if (stream.eat(\"{\"))\n expr = parseExprRange(stream, expr);\n else\n break;\n }\n return expr;\n}\nfunction parseNum(stream) {\n if (/\\D/.test(stream.next))\n stream.err(\"Expected number, got '\" + stream.next + \"'\");\n let result = Number(stream.next);\n stream.pos++;\n return result;\n}\nfunction parseExprRange(stream, expr) {\n let min = parseNum(stream), max = min;\n if (stream.eat(\",\")) {\n if (stream.next != \"}\")\n max = parseNum(stream);\n else\n max = -1;\n }\n if (!stream.eat(\"}\"))\n stream.err(\"Unclosed braced range\");\n return { type: \"range\", min, max, expr };\n}\nfunction resolveName(stream, name) {\n let types = stream.nodeTypes, type = types[name];\n if (type)\n return [type];\n let result = [];\n for (let typeName in types) {\n let type = types[typeName];\n if (type.isInGroup(name))\n result.push(type);\n }\n if (result.length == 0)\n stream.err(\"No node type or group '\" + name + \"' found\");\n return result;\n}\nfunction parseExprAtom(stream) {\n if (stream.eat(\"(\")) {\n let expr = parseExpr(stream);\n if (!stream.eat(\")\"))\n stream.err(\"Missing closing paren\");\n return expr;\n }\n else if (!/\\W/.test(stream.next)) {\n let exprs = resolveName(stream, stream.next).map(type => {\n if (stream.inline == null)\n stream.inline = type.isInline;\n else if (stream.inline != type.isInline)\n stream.err(\"Mixing inline and block content\");\n return { type: \"name\", value: type };\n });\n stream.pos++;\n return exprs.length == 1 ? exprs[0] : { type: \"choice\", exprs };\n }\n else {\n stream.err(\"Unexpected token '\" + stream.next + \"'\");\n }\n}\n// Construct an NFA from an expression as returned by the parser. The\n// NFA is represented as an array of states, which are themselves\n// arrays of edges, which are `{term, to}` objects. The first state is\n// the entry state and the last node is the success state.\n//\n// Note that unlike typical NFAs, the edge ordering in this one is\n// significant, in that it is used to contruct filler content when\n// necessary.\nfunction nfa(expr) {\n let nfa = [[]];\n connect(compile(expr, 0), node());\n return nfa;\n function node() { return nfa.push([]) - 1; }\n function edge(from, to, term) {\n let edge = { term, to };\n nfa[from].push(edge);\n return edge;\n }\n function connect(edges, to) {\n edges.forEach(edge => edge.to = to);\n }\n function compile(expr, from) {\n if (expr.type == \"choice\") {\n return expr.exprs.reduce((out, expr) => out.concat(compile(expr, from)), []);\n }\n else if (expr.type == \"seq\") {\n for (let i = 0;; i++) {\n let next = compile(expr.exprs[i], from);\n if (i == expr.exprs.length - 1)\n return next;\n connect(next, from = node());\n }\n }\n else if (expr.type == \"star\") {\n let loop = node();\n edge(from, loop);\n connect(compile(expr.expr, loop), loop);\n return [edge(loop)];\n }\n else if (expr.type == \"plus\") {\n let loop = node();\n connect(compile(expr.expr, from), loop);\n connect(compile(expr.expr, loop), loop);\n return [edge(loop)];\n }\n else if (expr.type == \"opt\") {\n return [edge(from)].concat(compile(expr.expr, from));\n }\n else if (expr.type == \"range\") {\n let cur = from;\n for (let i = 0; i < expr.min; i++) {\n let next = node();\n connect(compile(expr.expr, cur), next);\n cur = next;\n }\n if (expr.max == -1) {\n connect(compile(expr.expr, cur), cur);\n }\n else {\n for (let i = expr.min; i < expr.max; i++) {\n let next = node();\n edge(cur, next);\n connect(compile(expr.expr, cur), next);\n cur = next;\n }\n }\n return [edge(cur)];\n }\n else if (expr.type == \"name\") {\n return [edge(from, undefined, expr.value)];\n }\n else {\n throw new Error(\"Unknown expr type\");\n }\n }\n}\nfunction cmp(a, b) { return b - a; }\n// Get the set of nodes reachable by null edges from `node`. Omit\n// nodes with only a single null-out-edge, since they may lead to\n// needless duplicated nodes.\nfunction nullFrom(nfa, node) {\n let result = [];\n scan(node);\n return result.sort(cmp);\n function scan(node) {\n let edges = nfa[node];\n if (edges.length == 1 && !edges[0].term)\n return scan(edges[0].to);\n result.push(node);\n for (let i = 0; i < edges.length; i++) {\n let { term, to } = edges[i];\n if (!term && result.indexOf(to) == -1)\n scan(to);\n }\n }\n}\n// Compiles an NFA as produced by `nfa` into a DFA, modeled as a set\n// of state objects (`ContentMatch` instances) with transitions\n// between them.\nfunction dfa(nfa) {\n let labeled = Object.create(null);\n return explore(nullFrom(nfa, 0));\n function explore(states) {\n let out = [];\n states.forEach(node => {\n nfa[node].forEach(({ term, to }) => {\n if (!term)\n return;\n let set;\n for (let i = 0; i < out.length; i++)\n if (out[i][0] == term)\n set = out[i][1];\n nullFrom(nfa, to).forEach(node => {\n if (!set)\n out.push([term, set = []]);\n if (set.indexOf(node) == -1)\n set.push(node);\n });\n });\n });\n let state = labeled[states.join(\",\")] = new ContentMatch(states.indexOf(nfa.length - 1) > -1);\n for (let i = 0; i < out.length; i++) {\n let states = out[i][1].sort(cmp);\n state.next.push({ type: out[i][0], next: labeled[states.join(\",\")] || explore(states) });\n }\n return state;\n }\n}\nfunction checkForDeadEnds(match, stream) {\n for (let i = 0, work = [match]; i < work.length; i++) {\n let state = work[i], dead = !state.validEnd, nodes = [];\n for (let j = 0; j < state.next.length; j++) {\n let { type, next } = state.next[j];\n nodes.push(type.name);\n if (dead && !(type.isText || type.hasRequiredAttrs()))\n dead = false;\n if (work.indexOf(next) == -1)\n work.push(next);\n }\n if (dead)\n stream.err(\"Only non-generatable nodes (\" + nodes.join(\", \") + \") in a required position (see https://prosemirror.net/docs/guide/#generatable)\");\n }\n}\n\n// For node types where all attrs have a default value (or which don't\n// have any attributes), build up a single reusable default attribute\n// object, and use it for all nodes that don't specify specific\n// attributes.\nfunction defaultAttrs(attrs) {\n let defaults = Object.create(null);\n for (let attrName in attrs) {\n let attr = attrs[attrName];\n if (!attr.hasDefault)\n return null;\n defaults[attrName] = attr.default;\n }\n return defaults;\n}\nfunction computeAttrs(attrs, value) {\n let built = Object.create(null);\n for (let name in attrs) {\n let given = value && value[name];\n if (given === undefined) {\n let attr = attrs[name];\n if (attr.hasDefault)\n given = attr.default;\n else\n throw new RangeError(\"No value supplied for attribute \" + name);\n }\n built[name] = given;\n }\n return built;\n}\nfunction checkAttrs(attrs, values, type, name) {\n for (let name in values)\n if (!(name in attrs))\n throw new RangeError(`Unsupported attribute ${name} for ${type} of type ${name}`);\n for (let name in attrs) {\n let attr = attrs[name];\n if (attr.validate)\n attr.validate(values[name]);\n }\n}\nfunction initAttrs(typeName, attrs) {\n let result = Object.create(null);\n if (attrs)\n for (let name in attrs)\n result[name] = new Attribute(typeName, name, attrs[name]);\n return result;\n}\n/**\nNode types are objects allocated once per `Schema` and used to\n[tag](https://prosemirror.net/docs/ref/#model.Node.type) `Node` instances. They contain information\nabout the node type, such as its name and what kind of node it\nrepresents.\n*/\nclass NodeType {\n /**\n @internal\n */\n constructor(\n /**\n The name the node type has in this schema.\n */\n name, \n /**\n A link back to the `Schema` the node type belongs to.\n */\n schema, \n /**\n The spec that this type is based on\n */\n spec) {\n this.name = name;\n this.schema = schema;\n this.spec = spec;\n /**\n The set of marks allowed in this node. `null` means all marks\n are allowed.\n */\n this.markSet = null;\n this.groups = spec.group ? spec.group.split(\" \") : [];\n this.attrs = initAttrs(name, spec.attrs);\n this.defaultAttrs = defaultAttrs(this.attrs);\n this.contentMatch = null;\n this.inlineContent = null;\n this.isBlock = !(spec.inline || name == \"text\");\n this.isText = name == \"text\";\n }\n /**\n True if this is an inline type.\n */\n get isInline() { return !this.isBlock; }\n /**\n True if this is a textblock type, a block that contains inline\n content.\n */\n get isTextblock() { return this.isBlock && this.inlineContent; }\n /**\n True for node types that allow no content.\n */\n get isLeaf() { return this.contentMatch == ContentMatch.empty; }\n /**\n True when this node is an atom, i.e. when it does not have\n directly editable content.\n */\n get isAtom() { return this.isLeaf || !!this.spec.atom; }\n /**\n Return true when this node type is part of the given\n [group](https://prosemirror.net/docs/ref/#model.NodeSpec.group).\n */\n isInGroup(group) {\n return this.groups.indexOf(group) > -1;\n }\n /**\n The node type's [whitespace](https://prosemirror.net/docs/ref/#model.NodeSpec.whitespace) option.\n */\n get whitespace() {\n return this.spec.whitespace || (this.spec.code ? \"pre\" : \"normal\");\n }\n /**\n Tells you whether this node type has any required attributes.\n */\n hasRequiredAttrs() {\n for (let n in this.attrs)\n if (this.attrs[n].isRequired)\n return true;\n return false;\n }\n /**\n Indicates whether this node allows some of the same content as\n the given node type.\n */\n compatibleContent(other) {\n return this == other || this.contentMatch.compatible(other.contentMatch);\n }\n /**\n @internal\n */\n computeAttrs(attrs) {\n if (!attrs && this.defaultAttrs)\n return this.defaultAttrs;\n else\n return computeAttrs(this.attrs, attrs);\n }\n /**\n Create a `Node` of this type. The given attributes are\n checked and defaulted (you can pass `null` to use the type's\n defaults entirely, if no required attributes exist). `content`\n may be a `Fragment`, a node, an array of nodes, or\n `null`. Similarly `marks` may be `null` to default to the empty\n set of marks.\n */\n create(attrs = null, content, marks) {\n if (this.isText)\n throw new Error(\"NodeType.create can't construct text nodes\");\n return new Node(this, this.computeAttrs(attrs), Fragment.from(content), Mark.setFrom(marks));\n }\n /**\n Like [`create`](https://prosemirror.net/docs/ref/#model.NodeType.create), but check the given content\n against the node type's content restrictions, and throw an error\n if it doesn't match.\n */\n createChecked(attrs = null, content, marks) {\n content = Fragment.from(content);\n this.checkContent(content);\n return new Node(this, this.computeAttrs(attrs), content, Mark.setFrom(marks));\n }\n /**\n Like [`create`](https://prosemirror.net/docs/ref/#model.NodeType.create), but see if it is\n necessary to add nodes to the start or end of the given fragment\n to make it fit the node. If no fitting wrapping can be found,\n return null. Note that, due to the fact that required nodes can\n always be created, this will always succeed if you pass null or\n `Fragment.empty` as content.\n */\n createAndFill(attrs = null, content, marks) {\n attrs = this.computeAttrs(attrs);\n content = Fragment.from(content);\n if (content.size) {\n let before = this.contentMatch.fillBefore(content);\n if (!before)\n return null;\n content = before.append(content);\n }\n let matched = this.contentMatch.matchFragment(content);\n let after = matched && matched.fillBefore(Fragment.empty, true);\n if (!after)\n return null;\n return new Node(this, attrs, content.append(after), Mark.setFrom(marks));\n }\n /**\n Returns true if the given fragment is valid content for this node\n type.\n */\n validContent(content) {\n let result = this.contentMatch.matchFragment(content);\n if (!result || !result.validEnd)\n return false;\n for (let i = 0; i < content.childCount; i++)\n if (!this.allowsMarks(content.child(i).marks))\n return false;\n return true;\n }\n /**\n Throws a RangeError if the given fragment is not valid content for this\n node type.\n @internal\n */\n checkContent(content) {\n if (!this.validContent(content))\n throw new RangeError(`Invalid content for node ${this.name}: ${content.toString().slice(0, 50)}`);\n }\n /**\n @internal\n */\n checkAttrs(attrs) {\n checkAttrs(this.attrs, attrs, \"node\", this.name);\n }\n /**\n Check whether the given mark type is allowed in this node.\n */\n allowsMarkType(markType) {\n return this.markSet == null || this.markSet.indexOf(markType) > -1;\n }\n /**\n Test whether the given set of marks are allowed in this node.\n */\n allowsMarks(marks) {\n if (this.markSet == null)\n return true;\n for (let i = 0; i < marks.length; i++)\n if (!this.allowsMarkType(marks[i].type))\n return false;\n return true;\n }\n /**\n Removes the marks that are not allowed in this node from the given set.\n */\n allowedMarks(marks) {\n if (this.markSet == null)\n return marks;\n let copy;\n for (let i = 0; i < marks.length; i++) {\n if (!this.allowsMarkType(marks[i].type)) {\n if (!copy)\n copy = marks.slice(0, i);\n }\n else if (copy) {\n copy.push(marks[i]);\n }\n }\n return !copy ? marks : copy.length ? copy : Mark.none;\n }\n /**\n @internal\n */\n static compile(nodes, schema) {\n let result = Object.create(null);\n nodes.forEach((name, spec) => result[name] = new NodeType(name, schema, spec));\n let topType = schema.spec.topNode || \"doc\";\n if (!result[topType])\n throw new RangeError(\"Schema is missing its top node type ('\" + topType + \"')\");\n if (!result.text)\n throw new RangeError(\"Every schema needs a 'text' type\");\n for (let _ in result.text.attrs)\n throw new RangeError(\"The text node type should not have attributes\");\n return result;\n }\n}\nfunction validateType(typeName, attrName, type) {\n let types = type.split(\"|\");\n return (value) => {\n let name = value === null ? \"null\" : typeof value;\n if (types.indexOf(name) < 0)\n throw new RangeError(`Expected value of type ${types} for attribute ${attrName} on type ${typeName}, got ${name}`);\n };\n}\n// Attribute descriptors\nclass Attribute {\n constructor(typeName, attrName, options) {\n this.hasDefault = Object.prototype.hasOwnProperty.call(options, \"default\");\n this.default = options.default;\n this.validate = typeof options.validate == \"string\" ? validateType(typeName, attrName, options.validate) : options.validate;\n }\n get isRequired() {\n return !this.hasDefault;\n }\n}\n// Marks\n/**\nLike nodes, marks (which are associated with nodes to signify\nthings like emphasis or being part of a link) are\n[tagged](https://prosemirror.net/docs/ref/#model.Mark.type) with type objects, which are\ninstantiated once per `Schema`.\n*/\nclass MarkType {\n /**\n @internal\n */\n constructor(\n /**\n The name of the mark type.\n */\n name, \n /**\n @internal\n */\n rank, \n /**\n The schema that this mark type instance is part of.\n */\n schema, \n /**\n The spec on which the type is based.\n */\n spec) {\n this.name = name;\n this.rank = rank;\n this.schema = schema;\n this.spec = spec;\n this.attrs = initAttrs(name, spec.attrs);\n this.excluded = null;\n let defaults = defaultAttrs(this.attrs);\n this.instance = defaults ? new Mark(this, defaults) : null;\n }\n /**\n Create a mark of this type. `attrs` may be `null` or an object\n containing only some of the mark's attributes. The others, if\n they have defaults, will be added.\n */\n create(attrs = null) {\n if (!attrs && this.instance)\n return this.instance;\n return new Mark(this, computeAttrs(this.attrs, attrs));\n }\n /**\n @internal\n */\n static compile(marks, schema) {\n let result = Object.create(null), rank = 0;\n marks.forEach((name, spec) => result[name] = new MarkType(name, rank++, schema, spec));\n return result;\n }\n /**\n When there is a mark of this type in the given set, a new set\n without it is returned. Otherwise, the input set is returned.\n */\n removeFromSet(set) {\n for (var i = 0; i < set.length; i++)\n if (set[i].type == this) {\n set = set.slice(0, i).concat(set.slice(i + 1));\n i--;\n }\n return set;\n }\n /**\n Tests whether there is a mark of this type in the given set.\n */\n isInSet(set) {\n for (let i = 0; i < set.length; i++)\n if (set[i].type == this)\n return set[i];\n }\n /**\n @internal\n */\n checkAttrs(attrs) {\n checkAttrs(this.attrs, attrs, \"mark\", this.name);\n }\n /**\n Queries whether a given mark type is\n [excluded](https://prosemirror.net/docs/ref/#model.MarkSpec.excludes) by this one.\n */\n excludes(other) {\n return this.excluded.indexOf(other) > -1;\n }\n}\n/**\nA document schema. Holds [node](https://prosemirror.net/docs/ref/#model.NodeType) and [mark\ntype](https://prosemirror.net/docs/ref/#model.MarkType) objects for the nodes and marks that may\noccur in conforming documents, and provides functionality for\ncreating and deserializing such documents.\n\nWhen given, the type parameters provide the names of the nodes and\nmarks in this schema.\n*/\nclass Schema {\n /**\n Construct a schema from a schema [specification](https://prosemirror.net/docs/ref/#model.SchemaSpec).\n */\n constructor(spec) {\n /**\n The [linebreak\n replacement](https://prosemirror.net/docs/ref/#model.NodeSpec.linebreakReplacement) node defined\n in this schema, if any.\n */\n this.linebreakReplacement = null;\n /**\n An object for storing whatever values modules may want to\n compute and cache per schema. (If you want to store something\n in it, try to use property names unlikely to clash.)\n */\n this.cached = Object.create(null);\n let instanceSpec = this.spec = {};\n for (let prop in spec)\n instanceSpec[prop] = spec[prop];\n instanceSpec.nodes = OrderedMap.from(spec.nodes),\n instanceSpec.marks = OrderedMap.from(spec.marks || {}),\n this.nodes = NodeType.compile(this.spec.nodes, this);\n this.marks = MarkType.compile(this.spec.marks, this);\n let contentExprCache = Object.create(null);\n for (let prop in this.nodes) {\n if (prop in this.marks)\n throw new RangeError(prop + \" can not be both a node and a mark\");\n let type = this.nodes[prop], contentExpr = type.spec.content || \"\", markExpr = type.spec.marks;\n type.contentMatch = contentExprCache[contentExpr] ||\n (contentExprCache[contentExpr] = ContentMatch.parse(contentExpr, this.nodes));\n type.inlineContent = type.contentMatch.inlineContent;\n if (type.spec.linebreakReplacement) {\n if (this.linebreakReplacement)\n throw new RangeError(\"Multiple linebreak nodes defined\");\n if (!type.isInline || !type.isLeaf)\n throw new RangeError(\"Linebreak replacement nodes must be inline leaf nodes\");\n this.linebreakReplacement = type;\n }\n type.markSet = markExpr == \"_\" ? null :\n markExpr ? gatherMarks(this, markExpr.split(\" \")) :\n markExpr == \"\" || !type.inlineContent ? [] : null;\n }\n for (let prop in this.marks) {\n let type = this.marks[prop], excl = type.spec.excludes;\n type.excluded = excl == null ? [type] : excl == \"\" ? [] : gatherMarks(this, excl.split(\" \"));\n }\n this.nodeFromJSON = json => Node.fromJSON(this, json);\n this.markFromJSON = json => Mark.fromJSON(this, json);\n this.topNodeType = this.nodes[this.spec.topNode || \"doc\"];\n this.cached.wrappings = Object.create(null);\n }\n /**\n Create a node in this schema. The `type` may be a string or a\n `NodeType` instance. Attributes will be extended with defaults,\n `content` may be a `Fragment`, `null`, a `Node`, or an array of\n nodes.\n */\n node(type, attrs = null, content, marks) {\n if (typeof type == \"string\")\n type = this.nodeType(type);\n else if (!(type instanceof NodeType))\n throw new RangeError(\"Invalid node type: \" + type);\n else if (type.schema != this)\n throw new RangeError(\"Node type from different schema used (\" + type.name + \")\");\n return type.createChecked(attrs, content, marks);\n }\n /**\n Create a text node in the schema. Empty text nodes are not\n allowed.\n */\n text(text, marks) {\n let type = this.nodes.text;\n return new TextNode(type, type.defaultAttrs, text, Mark.setFrom(marks));\n }\n /**\n Create a mark with the given type and attributes.\n */\n mark(type, attrs) {\n if (typeof type == \"string\")\n type = this.marks[type];\n return type.create(attrs);\n }\n /**\n @internal\n */\n nodeType(name) {\n let found = this.nodes[name];\n if (!found)\n throw new RangeError(\"Unknown node type: \" + name);\n return found;\n }\n}\nfunction gatherMarks(schema, marks) {\n let found = [];\n for (let i = 0; i < marks.length; i++) {\n let name = marks[i], mark = schema.marks[name], ok = mark;\n if (mark) {\n found.push(mark);\n }\n else {\n for (let prop in schema.marks) {\n let mark = schema.marks[prop];\n if (name == \"_\" || (mark.spec.group && mark.spec.group.split(\" \").indexOf(name) > -1))\n found.push(ok = mark);\n }\n }\n if (!ok)\n throw new SyntaxError(\"Unknown mark type: '\" + marks[i] + \"'\");\n }\n return found;\n}\n\nfunction isTagRule(rule) { return rule.tag != null; }\nfunction isStyleRule(rule) { return rule.style != null; }\n/**\nA DOM parser represents a strategy for parsing DOM content into a\nProseMirror document conforming to a given schema. Its behavior is\ndefined by an array of [rules](https://prosemirror.net/docs/ref/#model.ParseRule).\n*/\nclass DOMParser {\n /**\n Create a parser that targets the given schema, using the given\n parsing rules.\n */\n constructor(\n /**\n The schema into which the parser parses.\n */\n schema, \n /**\n The set of [parse rules](https://prosemirror.net/docs/ref/#model.ParseRule) that the parser\n uses, in order of precedence.\n */\n rules) {\n this.schema = schema;\n this.rules = rules;\n /**\n @internal\n */\n this.tags = [];\n /**\n @internal\n */\n this.styles = [];\n let matchedStyles = this.matchedStyles = [];\n rules.forEach(rule => {\n if (isTagRule(rule)) {\n this.tags.push(rule);\n }\n else if (isStyleRule(rule)) {\n let prop = /[^=]*/.exec(rule.style)[0];\n if (matchedStyles.indexOf(prop) < 0)\n matchedStyles.push(prop);\n this.styles.push(rule);\n }\n });\n // Only normalize list elements when lists in the schema can't directly contain themselves\n this.normalizeLists = !this.tags.some(r => {\n if (!/^(ul|ol)\\b/.test(r.tag) || !r.node)\n return false;\n let node = schema.nodes[r.node];\n return node.contentMatch.matchType(node);\n });\n }\n /**\n Parse a document from the content of a DOM node.\n */\n parse(dom, options = {}) {\n let context = new ParseContext(this, options, false);\n context.addAll(dom, Mark.none, options.from, options.to);\n return context.finish();\n }\n /**\n Parses the content of the given DOM node, like\n [`parse`](https://prosemirror.net/docs/ref/#model.DOMParser.parse), and takes the same set of\n options. But unlike that method, which produces a whole node,\n this one returns a slice that is open at the sides, meaning that\n the schema constraints aren't applied to the start of nodes to\n the left of the input and the end of nodes at the end.\n */\n parseSlice(dom, options = {}) {\n let context = new ParseContext(this, options, true);\n context.addAll(dom, Mark.none, options.from, options.to);\n return Slice.maxOpen(context.finish());\n }\n /**\n @internal\n */\n matchTag(dom, context, after) {\n for (let i = after ? this.tags.indexOf(after) + 1 : 0; i < this.tags.length; i++) {\n let rule = this.tags[i];\n if (matches(dom, rule.tag) &&\n (rule.namespace === undefined || dom.namespaceURI == rule.namespace) &&\n (!rule.context || context.matchesContext(rule.context))) {\n if (rule.getAttrs) {\n let result = rule.getAttrs(dom);\n if (result === false)\n continue;\n rule.attrs = result || undefined;\n }\n return rule;\n }\n }\n }\n /**\n @internal\n */\n matchStyle(prop, value, context, after) {\n for (let i = after ? this.styles.indexOf(after) + 1 : 0; i < this.styles.length; i++) {\n let rule = this.styles[i], style = rule.style;\n if (style.indexOf(prop) != 0 ||\n rule.context && !context.matchesContext(rule.context) ||\n // Test that the style string either precisely matches the prop,\n // or has an '=' sign after the prop, followed by the given\n // value.\n style.length > prop.length &&\n (style.charCodeAt(prop.length) != 61 || style.slice(prop.length + 1) != value))\n continue;\n if (rule.getAttrs) {\n let result = rule.getAttrs(value);\n if (result === false)\n continue;\n rule.attrs = result || undefined;\n }\n return rule;\n }\n }\n /**\n @internal\n */\n static schemaRules(schema) {\n let result = [];\n function insert(rule) {\n let priority = rule.priority == null ? 50 : rule.priority, i = 0;\n for (; i < result.length; i++) {\n let next = result[i], nextPriority = next.priority == null ? 50 : next.priority;\n if (nextPriority < priority)\n break;\n }\n result.splice(i, 0, rule);\n }\n for (let name in schema.marks) {\n let rules = schema.marks[name].spec.parseDOM;\n if (rules)\n rules.forEach(rule => {\n insert(rule = copy(rule));\n if (!(rule.mark || rule.ignore || rule.clearMark))\n rule.mark = name;\n });\n }\n for (let name in schema.nodes) {\n let rules = schema.nodes[name].spec.parseDOM;\n if (rules)\n rules.forEach(rule => {\n insert(rule = copy(rule));\n if (!(rule.node || rule.ignore || rule.mark))\n rule.node = name;\n });\n }\n return result;\n }\n /**\n Construct a DOM parser using the parsing rules listed in a\n schema's [node specs](https://prosemirror.net/docs/ref/#model.NodeSpec.parseDOM), reordered by\n [priority](https://prosemirror.net/docs/ref/#model.GenericParseRule.priority).\n */\n static fromSchema(schema) {\n return schema.cached.domParser ||\n (schema.cached.domParser = new DOMParser(schema, DOMParser.schemaRules(schema)));\n }\n}\nconst blockTags = {\n address: true, article: true, aside: true, blockquote: true, canvas: true,\n dd: true, div: true, dl: true, fieldset: true, figcaption: true, figure: true,\n footer: true, form: true, h1: true, h2: true, h3: true, h4: true, h5: true,\n h6: true, header: true, hgroup: true, hr: true, li: true, noscript: true, ol: true,\n output: true, p: true, pre: true, section: true, table: true, tfoot: true, ul: true\n};\nconst ignoreTags = {\n head: true, noscript: true, object: true, script: true, style: true, title: true\n};\nconst listTags = { ol: true, ul: true };\n// Using a bitfield for node context options\nconst OPT_PRESERVE_WS = 1, OPT_PRESERVE_WS_FULL = 2, OPT_OPEN_LEFT = 4;\nfunction wsOptionsFor(type, preserveWhitespace, base) {\n if (preserveWhitespace != null)\n return (preserveWhitespace ? OPT_PRESERVE_WS : 0) |\n (preserveWhitespace === \"full\" ? OPT_PRESERVE_WS_FULL : 0);\n return type && type.whitespace == \"pre\" ? OPT_PRESERVE_WS | OPT_PRESERVE_WS_FULL : base & ~OPT_OPEN_LEFT;\n}\nclass NodeContext {\n constructor(type, attrs, marks, solid, match, options) {\n this.type = type;\n this.attrs = attrs;\n this.marks = marks;\n this.solid = solid;\n this.options = options;\n this.content = [];\n // Marks applied to the node's children\n this.activeMarks = Mark.none;\n this.match = match || (options & OPT_OPEN_LEFT ? null : type.contentMatch);\n }\n findWrapping(node) {\n if (!this.match) {\n if (!this.type)\n return [];\n let fill = this.type.contentMatch.fillBefore(Fragment.from(node));\n if (fill) {\n this.match = this.type.contentMatch.matchFragment(fill);\n }\n else {\n let start = this.type.contentMatch, wrap;\n if (wrap = start.findWrapping(node.type)) {\n this.match = start;\n return wrap;\n }\n else {\n return null;\n }\n }\n }\n return this.match.findWrapping(node.type);\n }\n finish(openEnd) {\n if (!(this.options & OPT_PRESERVE_WS)) { // Strip trailing whitespace\n let last = this.content[this.content.length - 1], m;\n if (last && last.isText && (m = /[ \\t\\r\\n\\u000c]+$/.exec(last.text))) {\n let text = last;\n if (last.text.length == m[0].length)\n this.content.pop();\n else\n this.content[this.content.length - 1] = text.withText(text.text.slice(0, text.text.length - m[0].length));\n }\n }\n let content = Fragment.from(this.content);\n if (!openEnd && this.match)\n content = content.append(this.match.fillBefore(Fragment.empty, true));\n return this.type ? this.type.create(this.attrs, content, this.marks) : content;\n }\n inlineContext(node) {\n if (this.type)\n return this.type.inlineContent;\n if (this.content.length)\n return this.content[0].isInline;\n return node.parentNode && !blockTags.hasOwnProperty(node.parentNode.nodeName.toLowerCase());\n }\n}\nclass ParseContext {\n constructor(\n // The parser we are using.\n parser, \n // The options passed to this parse.\n options, isOpen) {\n this.parser = parser;\n this.options = options;\n this.isOpen = isOpen;\n this.open = 0;\n this.localPreserveWS = false;\n let topNode = options.topNode, topContext;\n let topOptions = wsOptionsFor(null, options.preserveWhitespace, 0) | (isOpen ? OPT_OPEN_LEFT : 0);\n if (topNode)\n topContext = new NodeContext(topNode.type, topNode.attrs, Mark.none, true, options.topMatch || topNode.type.contentMatch, topOptions);\n else if (isOpen)\n topContext = new NodeContext(null, null, Mark.none, true, null, topOptions);\n else\n topContext = new NodeContext(parser.schema.topNodeType, null, Mark.none, true, null, topOptions);\n this.nodes = [topContext];\n this.find = options.findPositions;\n this.needsBlock = false;\n }\n get top() {\n return this.nodes[this.open];\n }\n // Add a DOM node to the content. Text is inserted as text node,\n // otherwise, the node is passed to `addElement` or, if it has a\n // `style` attribute, `addElementWithStyles`.\n addDOM(dom, marks) {\n if (dom.nodeType == 3)\n this.addTextNode(dom, marks);\n else if (dom.nodeType == 1)\n this.addElement(dom, marks);\n }\n addTextNode(dom, marks) {\n let value = dom.nodeValue;\n let top = this.top, preserveWS = (top.options & OPT_PRESERVE_WS_FULL) ? \"full\"\n : this.localPreserveWS || (top.options & OPT_PRESERVE_WS) > 0;\n let { schema } = this.parser;\n if (preserveWS === \"full\" ||\n top.inlineContext(dom) ||\n /[^ \\t\\r\\n\\u000c]/.test(value)) {\n if (!preserveWS) {\n value = value.replace(/[ \\t\\r\\n\\u000c]+/g, \" \");\n // If this starts with whitespace, and there is no node before it, or\n // a hard break, or a text node that ends with whitespace, strip the\n // leading space.\n if (/^[ \\t\\r\\n\\u000c]/.test(value) && this.open == this.nodes.length - 1) {\n let nodeBefore = top.content[top.content.length - 1];\n let domNodeBefore = dom.previousSibling;\n if (!nodeBefore ||\n (domNodeBefore && domNodeBefore.nodeName == 'BR') ||\n (nodeBefore.isText && /[ \\t\\r\\n\\u000c]$/.test(nodeBefore.text)))\n value = value.slice(1);\n }\n }\n else if (preserveWS === \"full\") {\n value = value.replace(/\\r\\n?/g, \"\\n\");\n }\n else if (schema.linebreakReplacement && /[\\r\\n]/.test(value) && this.top.findWrapping(schema.linebreakReplacement.create())) {\n let lines = value.split(/\\r?\\n|\\r/);\n for (let i = 0; i < lines.length; i++) {\n if (i)\n this.insertNode(schema.linebreakReplacement.create(), marks, true);\n if (lines[i])\n this.insertNode(schema.text(lines[i]), marks, !/\\S/.test(lines[i]));\n }\n value = \"\";\n }\n else {\n value = value.replace(/\\r?\\n|\\r/g, \" \");\n }\n if (value)\n this.insertNode(schema.text(value), marks, !/\\S/.test(value));\n this.findInText(dom);\n }\n else {\n this.findInside(dom);\n }\n }\n // Try to find a handler for the given tag and use that to parse. If\n // none is found, the element's content nodes are added directly.\n addElement(dom, marks, matchAfter) {\n let outerWS = this.localPreserveWS, top = this.top;\n if (dom.tagName == \"PRE\" || /pre/.test(dom.style && dom.style.whiteSpace))\n this.localPreserveWS = true;\n let name = dom.nodeName.toLowerCase(), ruleID;\n if (listTags.hasOwnProperty(name) && this.parser.normalizeLists)\n normalizeList(dom);\n let rule = (this.options.ruleFromNode && this.options.ruleFromNode(dom)) ||\n (ruleID = this.parser.matchTag(dom, this, matchAfter));\n out: if (rule ? rule.ignore : ignoreTags.hasOwnProperty(name)) {\n this.findInside(dom);\n this.ignoreFallback(dom, marks);\n }\n else if (!rule || rule.skip || rule.closeParent) {\n if (rule && rule.closeParent)\n this.open = Math.max(0, this.open - 1);\n else if (rule && rule.skip.nodeType)\n dom = rule.skip;\n let sync, oldNeedsBlock = this.needsBlock;\n if (blockTags.hasOwnProperty(name)) {\n if (top.content.length && top.content[0].isInline && this.open) {\n this.open--;\n top = this.top;\n }\n sync = true;\n if (!top.type)\n this.needsBlock = true;\n }\n else if (!dom.firstChild) {\n this.leafFallback(dom, marks);\n break out;\n }\n let innerMarks = rule && rule.skip ? marks : this.readStyles(dom, marks);\n if (innerMarks)\n this.addAll(dom, innerMarks);\n if (sync)\n this.sync(top);\n this.needsBlock = oldNeedsBlock;\n }\n else {\n let innerMarks = this.readStyles(dom, marks);\n if (innerMarks)\n this.addElementByRule(dom, rule, innerMarks, rule.consuming === false ? ruleID : undefined);\n }\n this.localPreserveWS = outerWS;\n }\n // Called for leaf DOM nodes that would otherwise be ignored\n leafFallback(dom, marks) {\n if (dom.nodeName == \"BR\" && this.top.type && this.top.type.inlineContent)\n this.addTextNode(dom.ownerDocument.createTextNode(\"\\n\"), marks);\n }\n // Called for ignored nodes\n ignoreFallback(dom, marks) {\n // Ignored BR nodes should at least create an inline context\n if (dom.nodeName == \"BR\" && (!this.top.type || !this.top.type.inlineContent))\n this.findPlace(this.parser.schema.text(\"-\"), marks, true);\n }\n // Run any style parser associated with the node's styles. Either\n // return an updated array of marks, or null to indicate some of the\n // styles had a rule with `ignore` set.\n readStyles(dom, marks) {\n let styles = dom.style;\n // Because many properties will only show up in 'normalized' form\n // in `style.item` (i.e. text-decoration becomes\n // text-decoration-line, text-decoration-color, etc), we directly\n // query the styles mentioned in our rules instead of iterating\n // over the items.\n if (styles && styles.length)\n for (let i = 0; i < this.parser.matchedStyles.length; i++) {\n let name = this.parser.matchedStyles[i], value = styles.getPropertyValue(name);\n if (value)\n for (let after = undefined;;) {\n let rule = this.parser.matchStyle(name, value, this, after);\n if (!rule)\n break;\n if (rule.ignore)\n return null;\n if (rule.clearMark)\n marks = marks.filter(m => !rule.clearMark(m));\n else\n marks = marks.concat(this.parser.schema.marks[rule.mark].create(rule.attrs));\n if (rule.consuming === false)\n after = rule;\n else\n break;\n }\n }\n return marks;\n }\n // Look up a handler for the given node. If none are found, return\n // false. Otherwise, apply it, use its return value to drive the way\n // the node's content is wrapped, and return true.\n addElementByRule(dom, rule, marks, continueAfter) {\n let sync, nodeType;\n if (rule.node) {\n nodeType = this.parser.schema.nodes[rule.node];\n if (!nodeType.isLeaf) {\n let inner = this.enter(nodeType, rule.attrs || null, marks, rule.preserveWhitespace);\n if (inner) {\n sync = true;\n marks = inner;\n }\n }\n else if (!this.insertNode(nodeType.create(rule.attrs), marks, dom.nodeName == \"BR\")) {\n this.leafFallback(dom, marks);\n }\n }\n else {\n let markType = this.parser.schema.marks[rule.mark];\n marks = marks.concat(markType.create(rule.attrs));\n }\n let startIn = this.top;\n if (nodeType && nodeType.isLeaf) {\n this.findInside(dom);\n }\n else if (continueAfter) {\n this.addElement(dom, marks, continueAfter);\n }\n else if (rule.getContent) {\n this.findInside(dom);\n rule.getContent(dom, this.parser.schema).forEach(node => this.insertNode(node, marks, false));\n }\n else {\n let contentDOM = dom;\n if (typeof rule.contentElement == \"string\")\n contentDOM = dom.querySelector(rule.contentElement);\n else if (typeof rule.contentElement == \"function\")\n contentDOM = rule.contentElement(dom);\n else if (rule.contentElement)\n contentDOM = rule.contentElement;\n this.findAround(dom, contentDOM, true);\n this.addAll(contentDOM, marks);\n this.findAround(dom, contentDOM, false);\n }\n if (sync && this.sync(startIn))\n this.open--;\n }\n // Add all child nodes between `startIndex` and `endIndex` (or the\n // whole node, if not given). If `sync` is passed, use it to\n // synchronize after every block element.\n addAll(parent, marks, startIndex, endIndex) {\n let index = startIndex || 0;\n for (let dom = startIndex ? parent.childNodes[startIndex] : parent.firstChild, end = endIndex == null ? null : parent.childNodes[endIndex]; dom != end; dom = dom.nextSibling, ++index) {\n this.findAtPoint(parent, index);\n this.addDOM(dom, marks);\n }\n this.findAtPoint(parent, index);\n }\n // Try to find a way to fit the given node type into the current\n // context. May add intermediate wrappers and/or leave non-solid\n // nodes that we're in.\n findPlace(node, marks, cautious) {\n let route, sync;\n for (let depth = this.open, penalty = 0; depth >= 0; depth--) {\n let cx = this.nodes[depth];\n let found = cx.findWrapping(node);\n if (found && (!route || route.length > found.length + penalty)) {\n route = found;\n sync = cx;\n if (!found.length)\n break;\n }\n if (cx.solid) {\n if (cautious)\n break;\n penalty += 2;\n }\n }\n if (!route)\n return null;\n this.sync(sync);\n for (let i = 0; i < route.length; i++)\n marks = this.enterInner(route[i], null, marks, false);\n return marks;\n }\n // Try to insert the given node, adjusting the context when needed.\n insertNode(node, marks, cautious) {\n if (node.isInline && this.needsBlock && !this.top.type) {\n let block = this.textblockFromContext();\n if (block)\n marks = this.enterInner(block, null, marks);\n }\n let innerMarks = this.findPlace(node, marks, cautious);\n if (innerMarks) {\n this.closeExtra();\n let top = this.top;\n if (top.match)\n top.match = top.match.matchType(node.type);\n let nodeMarks = Mark.none;\n for (let m of innerMarks.concat(node.marks))\n if (top.type ? top.type.allowsMarkType(m.type) : markMayApply(m.type, node.type))\n nodeMarks = m.addToSet(nodeMarks);\n top.content.push(node.mark(nodeMarks));\n return true;\n }\n return false;\n }\n // Try to start a node of the given type, adjusting the context when\n // necessary.\n enter(type, attrs, marks, preserveWS) {\n let innerMarks = this.findPlace(type.create(attrs), marks, false);\n if (innerMarks)\n innerMarks = this.enterInner(type, attrs, marks, true, preserveWS);\n return innerMarks;\n }\n // Open a node of the given type\n enterInner(type, attrs, marks, solid = false, preserveWS) {\n this.closeExtra();\n let top = this.top;\n top.match = top.match && top.match.matchType(type);\n let options = wsOptionsFor(type, preserveWS, top.options);\n if ((top.options & OPT_OPEN_LEFT) && top.content.length == 0)\n options |= OPT_OPEN_LEFT;\n let applyMarks = Mark.none;\n marks = marks.filter(m => {\n if (top.type ? top.type.allowsMarkType(m.type) : markMayApply(m.type, type)) {\n applyMarks = m.addToSet(applyMarks);\n return false;\n }\n return true;\n });\n this.nodes.push(new NodeContext(type, attrs, applyMarks, solid, null, options));\n this.open++;\n return marks;\n }\n // Make sure all nodes above this.open are finished and added to\n // their parents\n closeExtra(openEnd = false) {\n let i = this.nodes.length - 1;\n if (i > this.open) {\n for (; i > this.open; i--)\n this.nodes[i - 1].content.push(this.nodes[i].finish(openEnd));\n this.nodes.length = this.open + 1;\n }\n }\n finish() {\n this.open = 0;\n this.closeExtra(this.isOpen);\n return this.nodes[0].finish(!!(this.isOpen || this.options.topOpen));\n }\n sync(to) {\n for (let i = this.open; i >= 0; i--) {\n if (this.nodes[i] == to) {\n this.open = i;\n return true;\n }\n else if (this.localPreserveWS) {\n this.nodes[i].options |= OPT_PRESERVE_WS;\n }\n }\n return false;\n }\n get currentPos() {\n this.closeExtra();\n let pos = 0;\n for (let i = this.open; i >= 0; i--) {\n let content = this.nodes[i].content;\n for (let j = content.length - 1; j >= 0; j--)\n pos += content[j].nodeSize;\n if (i)\n pos++;\n }\n return pos;\n }\n findAtPoint(parent, offset) {\n if (this.find)\n for (let i = 0; i < this.find.length; i++) {\n if (this.find[i].node == parent && this.find[i].offset == offset)\n this.find[i].pos = this.currentPos;\n }\n }\n findInside(parent) {\n if (this.find)\n for (let i = 0; i < this.find.length; i++) {\n if (this.find[i].pos == null && parent.nodeType == 1 && parent.contains(this.find[i].node))\n this.find[i].pos = this.currentPos;\n }\n }\n findAround(parent, content, before) {\n if (parent != content && this.find)\n for (let i = 0; i < this.find.length; i++) {\n if (this.find[i].pos == null && parent.nodeType == 1 && parent.contains(this.find[i].node)) {\n let pos = content.compareDocumentPosition(this.find[i].node);\n if (pos & (before ? 2 : 4))\n this.find[i].pos = this.currentPos;\n }\n }\n }\n findInText(textNode) {\n if (this.find)\n for (let i = 0; i < this.find.length; i++) {\n if (this.find[i].node == textNode)\n this.find[i].pos = this.currentPos - (textNode.nodeValue.length - this.find[i].offset);\n }\n }\n // Determines whether the given context string matches this context.\n matchesContext(context) {\n if (context.indexOf(\"|\") > -1)\n return context.split(/\\s*\\|\\s*/).some(this.matchesContext, this);\n let parts = context.split(\"/\");\n let option = this.options.context;\n let useRoot = !this.isOpen && (!option || option.parent.type == this.nodes[0].type);\n let minDepth = -(option ? option.depth + 1 : 0) + (useRoot ? 0 : 1);\n let match = (i, depth) => {\n for (; i >= 0; i--) {\n let part = parts[i];\n if (part == \"\") {\n if (i == parts.length - 1 || i == 0)\n continue;\n for (; depth >= minDepth; depth--)\n if (match(i - 1, depth))\n return true;\n return false;\n }\n else {\n let next = depth > 0 || (depth == 0 && useRoot) ? this.nodes[depth].type\n : option && depth >= minDepth ? option.node(depth - minDepth).type\n : null;\n if (!next || (next.name != part && !next.isInGroup(part)))\n return false;\n depth--;\n }\n }\n return true;\n };\n return match(parts.length - 1, this.open);\n }\n textblockFromContext() {\n let $context = this.options.context;\n if ($context)\n for (let d = $context.depth; d >= 0; d--) {\n let deflt = $context.node(d).contentMatchAt($context.indexAfter(d)).defaultType;\n if (deflt && deflt.isTextblock && deflt.defaultAttrs)\n return deflt;\n }\n for (let name in this.parser.schema.nodes) {\n let type = this.parser.schema.nodes[name];\n if (type.isTextblock && type.defaultAttrs)\n return type;\n }\n }\n}\n// Kludge to work around directly nested list nodes produced by some\n// tools and allowed by browsers to mean that the nested list is\n// actually part of the list item above it.\nfunction normalizeList(dom) {\n for (let child = dom.firstChild, prevItem = null; child; child = child.nextSibling) {\n let name = child.nodeType == 1 ? child.nodeName.toLowerCase() : null;\n if (name && listTags.hasOwnProperty(name) && prevItem) {\n prevItem.appendChild(child);\n child = prevItem;\n }\n else if (name == \"li\") {\n prevItem = child;\n }\n else if (name) {\n prevItem = null;\n }\n }\n}\n// Apply a CSS selector.\nfunction matches(dom, selector) {\n return (dom.matches || dom.msMatchesSelector || dom.webkitMatchesSelector || dom.mozMatchesSelector).call(dom, selector);\n}\nfunction copy(obj) {\n let copy = {};\n for (let prop in obj)\n copy[prop] = obj[prop];\n return copy;\n}\n// Used when finding a mark at the top level of a fragment parse.\n// Checks whether it would be reasonable to apply a given mark type to\n// a given node, by looking at the way the mark occurs in the schema.\nfunction markMayApply(markType, nodeType) {\n let nodes = nodeType.schema.nodes;\n for (let name in nodes) {\n let parent = nodes[name];\n if (!parent.allowsMarkType(markType))\n continue;\n let seen = [], scan = (match) => {\n seen.push(match);\n for (let i = 0; i < match.edgeCount; i++) {\n let { type, next } = match.edge(i);\n if (type == nodeType)\n return true;\n if (seen.indexOf(next) < 0 && scan(next))\n return true;\n }\n };\n if (scan(parent.contentMatch))\n return true;\n }\n}\n\n/**\nA DOM serializer knows how to convert ProseMirror nodes and\nmarks of various types to DOM nodes.\n*/\nclass DOMSerializer {\n /**\n Create a serializer. `nodes` should map node names to functions\n that take a node and return a description of the corresponding\n DOM. `marks` does the same for mark names, but also gets an\n argument that tells it whether the mark's content is block or\n inline content (for typical use, it'll always be inline). A mark\n serializer may be `null` to indicate that marks of that type\n should not be serialized.\n */\n constructor(\n /**\n The node serialization functions.\n */\n nodes, \n /**\n The mark serialization functions.\n */\n marks) {\n this.nodes = nodes;\n this.marks = marks;\n }\n /**\n Serialize the content of this fragment to a DOM fragment. When\n not in the browser, the `document` option, containing a DOM\n document, should be passed so that the serializer can create\n nodes.\n */\n serializeFragment(fragment, options = {}, target) {\n if (!target)\n target = doc(options).createDocumentFragment();\n let top = target, active = [];\n fragment.forEach(node => {\n if (active.length || node.marks.length) {\n let keep = 0, rendered = 0;\n while (keep < active.length && rendered < node.marks.length) {\n let next = node.marks[rendered];\n if (!this.marks[next.type.name]) {\n rendered++;\n continue;\n }\n if (!next.eq(active[keep][0]) || next.type.spec.spanning === false)\n break;\n keep++;\n rendered++;\n }\n while (keep < active.length)\n top = active.pop()[1];\n while (rendered < node.marks.length) {\n let add = node.marks[rendered++];\n let markDOM = this.serializeMark(add, node.isInline, options);\n if (markDOM) {\n active.push([add, top]);\n top.appendChild(markDOM.dom);\n top = markDOM.contentDOM || markDOM.dom;\n }\n }\n }\n top.appendChild(this.serializeNodeInner(node, options));\n });\n return target;\n }\n /**\n @internal\n */\n serializeNodeInner(node, options) {\n let { dom, contentDOM } = renderSpec(doc(options), this.nodes[node.type.name](node), null, node.attrs);\n if (contentDOM) {\n if (node.isLeaf)\n throw new RangeError(\"Content hole not allowed in a leaf node spec\");\n this.serializeFragment(node.content, options, contentDOM);\n }\n return dom;\n }\n /**\n Serialize this node to a DOM node. This can be useful when you\n need to serialize a part of a document, as opposed to the whole\n document. To serialize a whole document, use\n [`serializeFragment`](https://prosemirror.net/docs/ref/#model.DOMSerializer.serializeFragment) on\n its [content](https://prosemirror.net/docs/ref/#model.Node.content).\n */\n serializeNode(node, options = {}) {\n let dom = this.serializeNodeInner(node, options);\n for (let i = node.marks.length - 1; i >= 0; i--) {\n let wrap = this.serializeMark(node.marks[i], node.isInline, options);\n if (wrap) {\n (wrap.contentDOM || wrap.dom).appendChild(dom);\n dom = wrap.dom;\n }\n }\n return dom;\n }\n /**\n @internal\n */\n serializeMark(mark, inline, options = {}) {\n let toDOM = this.marks[mark.type.name];\n return toDOM && renderSpec(doc(options), toDOM(mark, inline), null, mark.attrs);\n }\n static renderSpec(doc, structure, xmlNS = null, blockArraysIn) {\n return renderSpec(doc, structure, xmlNS, blockArraysIn);\n }\n /**\n Build a serializer using the [`toDOM`](https://prosemirror.net/docs/ref/#model.NodeSpec.toDOM)\n properties in a schema's node and mark specs.\n */\n static fromSchema(schema) {\n return schema.cached.domSerializer ||\n (schema.cached.domSerializer = new DOMSerializer(this.nodesFromSchema(schema), this.marksFromSchema(schema)));\n }\n /**\n Gather the serializers in a schema's node specs into an object.\n This can be useful as a base to build a custom serializer from.\n */\n static nodesFromSchema(schema) {\n let result = gatherToDOM(schema.nodes);\n if (!result.text)\n result.text = node => node.text;\n return result;\n }\n /**\n Gather the serializers in a schema's mark specs into an object.\n */\n static marksFromSchema(schema) {\n return gatherToDOM(schema.marks);\n }\n}\nfunction gatherToDOM(obj) {\n let result = {};\n for (let name in obj) {\n let toDOM = obj[name].spec.toDOM;\n if (toDOM)\n result[name] = toDOM;\n }\n return result;\n}\nfunction doc(options) {\n return options.document || window.document;\n}\nconst suspiciousAttributeCache = new WeakMap();\nfunction suspiciousAttributes(attrs) {\n let value = suspiciousAttributeCache.get(attrs);\n if (value === undefined)\n suspiciousAttributeCache.set(attrs, value = suspiciousAttributesInner(attrs));\n return value;\n}\nfunction suspiciousAttributesInner(attrs) {\n let result = null;\n function scan(value) {\n if (value && typeof value == \"object\") {\n if (Array.isArray(value)) {\n if (typeof value[0] == \"string\") {\n if (!result)\n result = [];\n result.push(value);\n }\n else {\n for (let i = 0; i < value.length; i++)\n scan(value[i]);\n }\n }\n else {\n for (let prop in value)\n scan(value[prop]);\n }\n }\n }\n scan(attrs);\n return result;\n}\nfunction renderSpec(doc, structure, xmlNS, blockArraysIn) {\n if (typeof structure == \"string\")\n return { dom: doc.createTextNode(structure) };\n if (structure.nodeType != null)\n return { dom: structure };\n if (structure.dom && structure.dom.nodeType != null)\n return structure;\n let tagName = structure[0], suspicious;\n if (typeof tagName != \"string\")\n throw new RangeError(\"Invalid array passed to renderSpec\");\n if (blockArraysIn && (suspicious = suspiciousAttributes(blockArraysIn)) &&\n suspicious.indexOf(structure) > -1)\n throw new RangeError(\"Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.\");\n let space = tagName.indexOf(\" \");\n if (space > 0) {\n xmlNS = tagName.slice(0, space);\n tagName = tagName.slice(space + 1);\n }\n let contentDOM;\n let dom = (xmlNS ? doc.createElementNS(xmlNS, tagName) : doc.createElement(tagName));\n let attrs = structure[1], start = 1;\n if (attrs && typeof attrs == \"object\" && attrs.nodeType == null && !Array.isArray(attrs)) {\n start = 2;\n for (let name in attrs)\n if (attrs[name] != null) {\n let space = name.indexOf(\" \");\n if (space > 0)\n dom.setAttributeNS(name.slice(0, space), name.slice(space + 1), attrs[name]);\n else if (name == \"style\" && dom.style)\n dom.style.cssText = attrs[name];\n else\n dom.setAttribute(name, attrs[name]);\n }\n }\n for (let i = start; i < structure.length; i++) {\n let child = structure[i];\n if (child === 0) {\n if (i < structure.length - 1 || i > start)\n throw new RangeError(\"Content hole must be the only child of its parent node\");\n return { dom, contentDOM: dom };\n }\n else {\n let { dom: inner, contentDOM: innerContent } = renderSpec(doc, child, xmlNS, blockArraysIn);\n dom.appendChild(inner);\n if (innerContent) {\n if (contentDOM)\n throw new RangeError(\"Multiple content holes\");\n contentDOM = innerContent;\n }\n }\n }\n return { dom, contentDOM };\n}\n\nexport { ContentMatch, DOMParser, DOMSerializer, Fragment, Mark, MarkType, Node, NodeRange, NodeType, ReplaceError, ResolvedPos, Schema, Slice };\n", "// Utilities\n//\n\nimport * as mdurl from 'mdurl'\nimport * as ucmicro from 'uc.micro'\nimport { decodeHTML } from 'entities'\n\nfunction _class (obj) { return Object.prototype.toString.call(obj) }\n\nfunction isString (obj) { return _class(obj) === '[object String]' }\n\nconst _hasOwnProperty = Object.prototype.hasOwnProperty\n\nfunction has (object, key) {\n return _hasOwnProperty.call(object, key)\n}\n\n// Merge objects\n//\nfunction assign (obj /* from1, from2, from3, ... */) {\n const sources = Array.prototype.slice.call(arguments, 1)\n\n sources.forEach(function (source) {\n if (!source) { return }\n\n if (typeof source !== 'object') {\n throw new TypeError(source + 'must be object')\n }\n\n Object.keys(source).forEach(function (key) {\n obj[key] = source[key]\n })\n })\n\n return obj\n}\n\n// Remove element from array and put another array at those position.\n// Useful for some operations with tokens\nfunction arrayReplaceAt (src, pos, newElements) {\n return [].concat(src.slice(0, pos), newElements, src.slice(pos + 1))\n}\n\nfunction isValidEntityCode (c) {\n /* eslint no-bitwise:0 */\n // broken sequence\n if (c >= 0xD800 && c <= 0xDFFF) { return false }\n // never used\n if (c >= 0xFDD0 && c <= 0xFDEF) { return false }\n if ((c & 0xFFFF) === 0xFFFF || (c & 0xFFFF) === 0xFFFE) { return false }\n // control codes\n if (c >= 0x00 && c <= 0x08) { return false }\n if (c === 0x0B) { return false }\n if (c >= 0x0E && c <= 0x1F) { return false }\n if (c >= 0x7F && c <= 0x9F) { return false }\n // out of range\n if (c > 0x10FFFF) { return false }\n return true\n}\n\nfunction fromCodePoint (c) {\n /* eslint no-bitwise:0 */\n if (c > 0xffff) {\n c -= 0x10000\n const surrogate1 = 0xd800 + (c >> 10)\n const surrogate2 = 0xdc00 + (c & 0x3ff)\n\n return String.fromCharCode(surrogate1, surrogate2)\n }\n return String.fromCharCode(c)\n}\n\nconst UNESCAPE_MD_RE = /\\\\([!\"#$%&'()*+,\\-./:;<=>?@[\\\\\\]^_`{|}~])/g\nconst ENTITY_RE = /&([a-z#][a-z0-9]{1,31});/gi\nconst UNESCAPE_ALL_RE = new RegExp(UNESCAPE_MD_RE.source + '|' + ENTITY_RE.source, 'gi')\n\nconst DIGITAL_ENTITY_TEST_RE = /^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i\n\nfunction replaceEntityPattern (match, name) {\n if (name.charCodeAt(0) === 0x23/* # */ && DIGITAL_ENTITY_TEST_RE.test(name)) {\n const code = name[1].toLowerCase() === 'x'\n ? parseInt(name.slice(2), 16)\n : parseInt(name.slice(1), 10)\n\n if (isValidEntityCode(code)) {\n return fromCodePoint(code)\n }\n\n return match\n }\n\n const decoded = decodeHTML(match)\n if (decoded !== match) {\n return decoded\n }\n\n return match\n}\n\n/* function replaceEntities(str) {\n if (str.indexOf('&') < 0) { return str; }\n\n return str.replace(ENTITY_RE, replaceEntityPattern);\n} */\n\nfunction unescapeMd (str) {\n if (str.indexOf('\\\\') < 0) { return str }\n return str.replace(UNESCAPE_MD_RE, '$1')\n}\n\nfunction unescapeAll (str) {\n if (str.indexOf('\\\\') < 0 && str.indexOf('&') < 0) { return str }\n\n return str.replace(UNESCAPE_ALL_RE, function (match, escaped, entity) {\n if (escaped) { return escaped }\n return replaceEntityPattern(match, entity)\n })\n}\n\nconst HTML_ESCAPE_TEST_RE = /[&<>\"]/\nconst HTML_ESCAPE_REPLACE_RE = /[&<>\"]/g\nconst HTML_REPLACEMENTS = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"'\n}\n\nfunction replaceUnsafeChar (ch) {\n return HTML_REPLACEMENTS[ch]\n}\n\nfunction escapeHtml (str) {\n if (HTML_ESCAPE_TEST_RE.test(str)) {\n return str.replace(HTML_ESCAPE_REPLACE_RE, replaceUnsafeChar)\n }\n return str\n}\n\nconst REGEXP_ESCAPE_RE = /[.?*+^$[\\]\\\\(){}|-]/g\n\nfunction escapeRE (str) {\n return str.replace(REGEXP_ESCAPE_RE, '\\\\$&')\n}\n\nfunction isSpace (code) {\n switch (code) {\n case 0x09:\n case 0x20:\n return true\n }\n return false\n}\n\n// Zs (unicode class) || [\\t\\f\\v\\r\\n]\nfunction isWhiteSpace (code) {\n if (code >= 0x2000 && code <= 0x200A) { return true }\n switch (code) {\n case 0x09: // \\t\n case 0x0A: // \\n\n case 0x0B: // \\v\n case 0x0C: // \\f\n case 0x0D: // \\r\n case 0x20:\n case 0xA0:\n case 0x1680:\n case 0x202F:\n case 0x205F:\n case 0x3000:\n return true\n }\n return false\n}\n\n/* eslint-disable max-len */\n\n// Currently without astral characters support.\nfunction isPunctChar (ch) {\n return ucmicro.P.test(ch) || ucmicro.S.test(ch)\n}\n\n// Markdown ASCII punctuation characters.\n//\n// !, \", #, $, %, &, ', (, ), *, +, ,, -, ., /, :, ;, <, =, >, ?, @, [, \\, ], ^, _, `, {, |, }, or ~\n// http://spec.commonmark.org/0.15/#ascii-punctuation-character\n//\n// Don't confuse with unicode punctuation !!! It lacks some chars in ascii range.\n//\nfunction isMdAsciiPunct (ch) {\n switch (ch) {\n case 0x21/* ! */:\n case 0x22/* \" */:\n case 0x23/* # */:\n case 0x24/* $ */:\n case 0x25/* % */:\n case 0x26/* & */:\n case 0x27/* ' */:\n case 0x28/* ( */:\n case 0x29/* ) */:\n case 0x2A/* * */:\n case 0x2B/* + */:\n case 0x2C/* , */:\n case 0x2D/* - */:\n case 0x2E/* . */:\n case 0x2F/* / */:\n case 0x3A/* : */:\n case 0x3B/* ; */:\n case 0x3C/* < */:\n case 0x3D/* = */:\n case 0x3E/* > */:\n case 0x3F/* ? */:\n case 0x40/* @ */:\n case 0x5B/* [ */:\n case 0x5C/* \\ */:\n case 0x5D/* ] */:\n case 0x5E/* ^ */:\n case 0x5F/* _ */:\n case 0x60/* ` */:\n case 0x7B/* { */:\n case 0x7C/* | */:\n case 0x7D/* } */:\n case 0x7E/* ~ */:\n return true\n default:\n return false\n }\n}\n\n// Hepler to unify [reference labels].\n//\nfunction normalizeReference (str) {\n // Trim and collapse whitespace\n //\n str = str.trim().replace(/\\s+/g, ' ')\n\n // In node v10 '\u1E9E'.toLowerCase() === '\u1E7E', which is presumed to be a bug\n // fixed in v12 (couldn't find any details).\n //\n // So treat this one as a special case\n // (remove this when node v10 is no longer supported).\n //\n if ('\u1E9E'.toLowerCase() === '\u1E7E') {\n str = str.replace(/\u1E9E/g, '\u00DF')\n }\n\n // .toLowerCase().toUpperCase() should get rid of all differences\n // between letter variants.\n //\n // Simple .toLowerCase() doesn't normalize 125 code points correctly,\n // and .toUpperCase doesn't normalize 6 of them (list of exceptions:\n // \u0130, \u03F4, \u1E9E, \u2126, \u212A, \u212B - those are already uppercased, but have differently\n // uppercased versions).\n //\n // Here's an example showing how it happens. Lets take greek letter omega:\n // uppercase U+0398 (\u0398), U+03f4 (\u03F4) and lowercase U+03b8 (\u03B8), U+03d1 (\u03D1)\n //\n // Unicode entries:\n // 0398;GREEK CAPITAL LETTER THETA;Lu;0;L;;;;;N;;;;03B8;\n // 03B8;GREEK SMALL LETTER THETA;Ll;0;L;;;;;N;;;0398;;0398\n // 03D1;GREEK THETA SYMBOL;Ll;0;L;<compat> 03B8;;;;N;GREEK SMALL LETTER SCRIPT THETA;;0398;;0398\n // 03F4;GREEK CAPITAL THETA SYMBOL;Lu;0;L;<compat> 0398;;;;N;;;;03B8;\n //\n // Case-insensitive comparison should treat all of them as equivalent.\n //\n // But .toLowerCase() doesn't change \u03D1 (it's already lowercase),\n // and .toUpperCase() doesn't change \u03F4 (already uppercase).\n //\n // Applying first lower then upper case normalizes any character:\n // '\\u0398\\u03f4\\u03b8\\u03d1'.toLowerCase().toUpperCase() === '\\u0398\\u0398\\u0398\\u0398'\n //\n // Note: this is equivalent to unicode case folding; unicode normalization\n // is a different step that is not required here.\n //\n // Final result should be uppercased, because it's later stored in an object\n // (this avoid a conflict with Object.prototype members,\n // most notably, `__proto__`)\n //\n return str.toLowerCase().toUpperCase()\n}\n\n// Re-export libraries commonly used in both markdown-it and its plugins,\n// so plugins won't have to depend on them explicitly, which reduces their\n// bundled size (e.g. a browser build).\n//\nconst lib = { mdurl, ucmicro }\n\nexport {\n lib,\n assign,\n isString,\n has,\n unescapeMd,\n unescapeAll,\n isValidEntityCode,\n fromCodePoint,\n escapeHtml,\n arrayReplaceAt,\n isSpace,\n isWhiteSpace,\n isMdAsciiPunct,\n isPunctChar,\n escapeRE,\n normalizeReference\n}\n", "import decode from './lib/decode.mjs'\nimport encode from './lib/encode.mjs'\nimport format from './lib/format.mjs'\nimport parse from './lib/parse.mjs'\n\nexport {\n decode,\n encode,\n format,\n parse\n}\n", "/* eslint-disable no-bitwise */\n\nconst decodeCache = {}\n\nfunction getDecodeCache (exclude) {\n let cache = decodeCache[exclude]\n if (cache) { return cache }\n\n cache = decodeCache[exclude] = []\n\n for (let i = 0; i < 128; i++) {\n const ch = String.fromCharCode(i)\n cache.push(ch)\n }\n\n for (let i = 0; i < exclude.length; i++) {\n const ch = exclude.charCodeAt(i)\n cache[ch] = '%' + ('0' + ch.toString(16).toUpperCase()).slice(-2)\n }\n\n return cache\n}\n\n// Decode percent-encoded string.\n//\nfunction decode (string, exclude) {\n if (typeof exclude !== 'string') {\n exclude = decode.defaultChars\n }\n\n const cache = getDecodeCache(exclude)\n\n return string.replace(/(%[a-f0-9]{2})+/gi, function (seq) {\n let result = ''\n\n for (let i = 0, l = seq.length; i < l; i += 3) {\n const b1 = parseInt(seq.slice(i + 1, i + 3), 16)\n\n if (b1 < 0x80) {\n result += cache[b1]\n continue\n }\n\n if ((b1 & 0xE0) === 0xC0 && (i + 3 < l)) {\n // 110xxxxx 10xxxxxx\n const b2 = parseInt(seq.slice(i + 4, i + 6), 16)\n\n if ((b2 & 0xC0) === 0x80) {\n const chr = ((b1 << 6) & 0x7C0) | (b2 & 0x3F)\n\n if (chr < 0x80) {\n result += '\\ufffd\\ufffd'\n } else {\n result += String.fromCharCode(chr)\n }\n\n i += 3\n continue\n }\n }\n\n if ((b1 & 0xF0) === 0xE0 && (i + 6 < l)) {\n // 1110xxxx 10xxxxxx 10xxxxxx\n const b2 = parseInt(seq.slice(i + 4, i + 6), 16)\n const b3 = parseInt(seq.slice(i + 7, i + 9), 16)\n\n if ((b2 & 0xC0) === 0x80 && (b3 & 0xC0) === 0x80) {\n const chr = ((b1 << 12) & 0xF000) | ((b2 << 6) & 0xFC0) | (b3 & 0x3F)\n\n if (chr < 0x800 || (chr >= 0xD800 && chr <= 0xDFFF)) {\n result += '\\ufffd\\ufffd\\ufffd'\n } else {\n result += String.fromCharCode(chr)\n }\n\n i += 6\n continue\n }\n }\n\n if ((b1 & 0xF8) === 0xF0 && (i + 9 < l)) {\n // 111110xx 10xxxxxx 10xxxxxx 10xxxxxx\n const b2 = parseInt(seq.slice(i + 4, i + 6), 16)\n const b3 = parseInt(seq.slice(i + 7, i + 9), 16)\n const b4 = parseInt(seq.slice(i + 10, i + 12), 16)\n\n if ((b2 & 0xC0) === 0x80 && (b3 & 0xC0) === 0x80 && (b4 & 0xC0) === 0x80) {\n let chr = ((b1 << 18) & 0x1C0000) | ((b2 << 12) & 0x3F000) | ((b3 << 6) & 0xFC0) | (b4 & 0x3F)\n\n if (chr < 0x10000 || chr > 0x10FFFF) {\n result += '\\ufffd\\ufffd\\ufffd\\ufffd'\n } else {\n chr -= 0x10000\n result += String.fromCharCode(0xD800 + (chr >> 10), 0xDC00 + (chr & 0x3FF))\n }\n\n i += 9\n continue\n }\n }\n\n result += '\\ufffd'\n }\n\n return result\n })\n}\n\ndecode.defaultChars = ';/?:@&=+$,#'\ndecode.componentChars = ''\n\nexport default decode\n", "const encodeCache = {}\n\n// Create a lookup array where anything but characters in `chars` string\n// and alphanumeric chars is percent-encoded.\n//\nfunction getEncodeCache (exclude) {\n let cache = encodeCache[exclude]\n if (cache) { return cache }\n\n cache = encodeCache[exclude] = []\n\n for (let i = 0; i < 128; i++) {\n const ch = String.fromCharCode(i)\n\n if (/^[0-9a-z]$/i.test(ch)) {\n // always allow unencoded alphanumeric characters\n cache.push(ch)\n } else {\n cache.push('%' + ('0' + i.toString(16).toUpperCase()).slice(-2))\n }\n }\n\n for (let i = 0; i < exclude.length; i++) {\n cache[exclude.charCodeAt(i)] = exclude[i]\n }\n\n return cache\n}\n\n// Encode unsafe characters with percent-encoding, skipping already\n// encoded sequences.\n//\n// - string - string to encode\n// - exclude - list of characters to ignore (in addition to a-zA-Z0-9)\n// - keepEscaped - don't encode '%' in a correct escape sequence (default: true)\n//\nfunction encode (string, exclude, keepEscaped) {\n if (typeof exclude !== 'string') {\n // encode(string, keepEscaped)\n keepEscaped = exclude\n exclude = encode.defaultChars\n }\n\n if (typeof keepEscaped === 'undefined') {\n keepEscaped = true\n }\n\n const cache = getEncodeCache(exclude)\n let result = ''\n\n for (let i = 0, l = string.length; i < l; i++) {\n const code = string.charCodeAt(i)\n\n if (keepEscaped && code === 0x25 /* % */ && i + 2 < l) {\n if (/^[0-9a-f]{2}$/i.test(string.slice(i + 1, i + 3))) {\n result += string.slice(i, i + 3)\n i += 2\n continue\n }\n }\n\n if (code < 128) {\n result += cache[code]\n continue\n }\n\n if (code >= 0xD800 && code <= 0xDFFF) {\n if (code >= 0xD800 && code <= 0xDBFF && i + 1 < l) {\n const nextCode = string.charCodeAt(i + 1)\n if (nextCode >= 0xDC00 && nextCode <= 0xDFFF) {\n result += encodeURIComponent(string[i] + string[i + 1])\n i++\n continue\n }\n }\n result += '%EF%BF%BD'\n continue\n }\n\n result += encodeURIComponent(string[i])\n }\n\n return result\n}\n\nencode.defaultChars = \";/?:@&=+$,-_.!~*'()#\"\nencode.componentChars = \"-_.!~*'()\"\n\nexport default encode\n", "export default function format (url) {\n let result = ''\n\n result += url.protocol || ''\n result += url.slashes ? '//' : ''\n result += url.auth ? url.auth + '@' : ''\n\n if (url.hostname && url.hostname.indexOf(':') !== -1) {\n // ipv6 address\n result += '[' + url.hostname + ']'\n } else {\n result += url.hostname || ''\n }\n\n result += url.port ? ':' + url.port : ''\n result += url.pathname || ''\n result += url.search || ''\n result += url.hash || ''\n\n return result\n};\n", "// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n//\n// Changes from joyent/node:\n//\n// 1. No leading slash in paths,\n// e.g. in `url.parse('http://foo?bar')` pathname is ``, not `/`\n//\n// 2. Backslashes are not replaced with slashes,\n// so `http:\\\\example.org\\` is treated like a relative path\n//\n// 3. Trailing colon is treated like a part of the path,\n// i.e. in `http://example.org:foo` pathname is `:foo`\n//\n// 4. Nothing is URL-encoded in the resulting object,\n// (in joyent/node some chars in auth and paths are encoded)\n//\n// 5. `url.parse()` does not have `parseQueryString` argument\n//\n// 6. Removed extraneous result properties: `host`, `path`, `query`, etc.,\n// which can be constructed using other parts of the url.\n//\n\nfunction Url () {\n this.protocol = null\n this.slashes = null\n this.auth = null\n this.port = null\n this.hostname = null\n this.hash = null\n this.search = null\n this.pathname = null\n}\n\n// Reference: RFC 3986, RFC 1808, RFC 2396\n\n// define these here so at least they only have to be\n// compiled once on the first module load.\nconst protocolPattern = /^([a-z0-9.+-]+:)/i\nconst portPattern = /:[0-9]*$/\n\n// Special case for a simple path URL\n/* eslint-disable-next-line no-useless-escape */\nconst simplePathPattern = /^(\\/\\/?(?!\\/)[^\\?\\s]*)(\\?[^\\s]*)?$/\n\n// RFC 2396: characters reserved for delimiting URLs.\n// We actually just auto-escape these.\nconst delims = ['<', '>', '\"', '`', ' ', '\\r', '\\n', '\\t']\n\n// RFC 2396: characters not allowed for various reasons.\nconst unwise = ['{', '}', '|', '\\\\', '^', '`'].concat(delims)\n\n// Allowed by RFCs, but cause of XSS attacks. Always escape these.\nconst autoEscape = ['\\''].concat(unwise)\n// Characters that are never ever allowed in a hostname.\n// Note that any invalid chars are also handled, but these\n// are the ones that are *expected* to be seen, so we fast-path\n// them.\nconst nonHostChars = ['%', '/', '?', ';', '#'].concat(autoEscape)\nconst hostEndingChars = ['/', '?', '#']\nconst hostnameMaxLen = 255\nconst hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/\nconst hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/\n// protocols that can allow \"unsafe\" and \"unwise\" chars.\n// protocols that never have a hostname.\nconst hostlessProtocol = {\n javascript: true,\n 'javascript:': true\n}\n// protocols that always contain a // bit.\nconst slashedProtocol = {\n http: true,\n https: true,\n ftp: true,\n gopher: true,\n file: true,\n 'http:': true,\n 'https:': true,\n 'ftp:': true,\n 'gopher:': true,\n 'file:': true\n}\n\nfunction urlParse (url, slashesDenoteHost) {\n if (url && url instanceof Url) return url\n\n const u = new Url()\n u.parse(url, slashesDenoteHost)\n return u\n}\n\nUrl.prototype.parse = function (url, slashesDenoteHost) {\n let lowerProto, hec, slashes\n let rest = url\n\n // trim before proceeding.\n // This is to support parse stuff like \" http://foo.com \\n\"\n rest = rest.trim()\n\n if (!slashesDenoteHost && url.split('#').length === 1) {\n // Try fast path regexp\n const simplePath = simplePathPattern.exec(rest)\n if (simplePath) {\n this.pathname = simplePath[1]\n if (simplePath[2]) {\n this.search = simplePath[2]\n }\n return this\n }\n }\n\n let proto = protocolPattern.exec(rest)\n if (proto) {\n proto = proto[0]\n lowerProto = proto.toLowerCase()\n this.protocol = proto\n rest = rest.substr(proto.length)\n }\n\n // figure out if it's got a host\n // user@server is *always* interpreted as a hostname, and url\n // resolution will treat //foo/bar as host=foo,path=bar because that's\n // how the browser resolves relative URLs.\n /* eslint-disable-next-line no-useless-escape */\n if (slashesDenoteHost || proto || rest.match(/^\\/\\/[^@\\/]+@[^@\\/]+/)) {\n slashes = rest.substr(0, 2) === '//'\n if (slashes && !(proto && hostlessProtocol[proto])) {\n rest = rest.substr(2)\n this.slashes = true\n }\n }\n\n if (!hostlessProtocol[proto] &&\n (slashes || (proto && !slashedProtocol[proto]))) {\n // there's a hostname.\n // the first instance of /, ?, ;, or # ends the host.\n //\n // If there is an @ in the hostname, then non-host chars *are* allowed\n // to the left of the last @ sign, unless some host-ending character\n // comes *before* the @-sign.\n // URLs are obnoxious.\n //\n // ex:\n // http://a@b@c/ => user:a@b host:c\n // http://a@b?@c => user:a host:c path:/?@c\n\n // v0.12 TODO(isaacs): This is not quite how Chrome does things.\n // Review our test case against browsers more comprehensively.\n\n // find the first instance of any hostEndingChars\n let hostEnd = -1\n for (let i = 0; i < hostEndingChars.length; i++) {\n hec = rest.indexOf(hostEndingChars[i])\n if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) {\n hostEnd = hec\n }\n }\n\n // at this point, either we have an explicit point where the\n // auth portion cannot go past, or the last @ char is the decider.\n let auth, atSign\n if (hostEnd === -1) {\n // atSign can be anywhere.\n atSign = rest.lastIndexOf('@')\n } else {\n // atSign must be in auth portion.\n // http://a@b/c@d => host:b auth:a path:/c@d\n atSign = rest.lastIndexOf('@', hostEnd)\n }\n\n // Now we have a portion which is definitely the auth.\n // Pull that off.\n if (atSign !== -1) {\n auth = rest.slice(0, atSign)\n rest = rest.slice(atSign + 1)\n this.auth = auth\n }\n\n // the host is the remaining to the left of the first non-host char\n hostEnd = -1\n for (let i = 0; i < nonHostChars.length; i++) {\n hec = rest.indexOf(nonHostChars[i])\n if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) {\n hostEnd = hec\n }\n }\n // if we still have not hit it, then the entire thing is a host.\n if (hostEnd === -1) {\n hostEnd = rest.length\n }\n\n if (rest[hostEnd - 1] === ':') { hostEnd-- }\n const host = rest.slice(0, hostEnd)\n rest = rest.slice(hostEnd)\n\n // pull out port.\n this.parseHost(host)\n\n // we've indicated that there is a hostname,\n // so even if it's empty, it has to be present.\n this.hostname = this.hostname || ''\n\n // if hostname begins with [ and ends with ]\n // assume that it's an IPv6 address.\n const ipv6Hostname = this.hostname[0] === '[' &&\n this.hostname[this.hostname.length - 1] === ']'\n\n // validate a little.\n if (!ipv6Hostname) {\n const hostparts = this.hostname.split(/\\./)\n for (let i = 0, l = hostparts.length; i < l; i++) {\n const part = hostparts[i]\n if (!part) { continue }\n if (!part.match(hostnamePartPattern)) {\n let newpart = ''\n for (let j = 0, k = part.length; j < k; j++) {\n if (part.charCodeAt(j) > 127) {\n // we replace non-ASCII char with a temporary placeholder\n // we need this to make sure size of hostname is not\n // broken by replacing non-ASCII by nothing\n newpart += 'x'\n } else {\n newpart += part[j]\n }\n }\n // we test again with ASCII char only\n if (!newpart.match(hostnamePartPattern)) {\n const validParts = hostparts.slice(0, i)\n const notHost = hostparts.slice(i + 1)\n const bit = part.match(hostnamePartStart)\n if (bit) {\n validParts.push(bit[1])\n notHost.unshift(bit[2])\n }\n if (notHost.length) {\n rest = notHost.join('.') + rest\n }\n this.hostname = validParts.join('.')\n break\n }\n }\n }\n }\n\n if (this.hostname.length > hostnameMaxLen) {\n this.hostname = ''\n }\n\n // strip [ and ] from the hostname\n // the host field still retains them, though\n if (ipv6Hostname) {\n this.hostname = this.hostname.substr(1, this.hostname.length - 2)\n }\n }\n\n // chop off from the tail first.\n const hash = rest.indexOf('#')\n if (hash !== -1) {\n // got a fragment string.\n this.hash = rest.substr(hash)\n rest = rest.slice(0, hash)\n }\n const qm = rest.indexOf('?')\n if (qm !== -1) {\n this.search = rest.substr(qm)\n rest = rest.slice(0, qm)\n }\n if (rest) { this.pathname = rest }\n if (slashedProtocol[lowerProto] &&\n this.hostname && !this.pathname) {\n this.pathname = ''\n }\n\n return this\n}\n\nUrl.prototype.parseHost = function (host) {\n let port = portPattern.exec(host)\n if (port) {\n port = port[0]\n if (port !== ':') {\n this.port = port.substr(1)\n }\n host = host.substr(0, host.length - port.length)\n }\n if (host) { this.hostname = host }\n}\n\nexport default urlParse\n", "import Any from './properties/Any/regex.mjs';\nimport Cc from './categories/Cc/regex.mjs';\nimport Cf from './categories/Cf/regex.mjs';\nimport P from './categories/P/regex.mjs';\nimport S from './categories/S/regex.mjs';\nimport Z from './categories/Z/regex.mjs';\n\nexport { Any, Cc, Cf, P, S, Z };\n", "export default /[\\0-\\uD7FF\\uE000-\\uFFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF]/", "export default /[\\0-\\x1F\\x7F-\\x9F]/", "export default /[\\xAD\\u0600-\\u0605\\u061C\\u06DD\\u070F\\u0890\\u0891\\u08E2\\u180E\\u200B-\\u200F\\u202A-\\u202E\\u2060-\\u2064\\u2066-\\u206F\\uFEFF\\uFFF9-\\uFFFB]|\\uD804[\\uDCBD\\uDCCD]|\\uD80D[\\uDC30-\\uDC3F]|\\uD82F[\\uDCA0-\\uDCA3]|\\uD834[\\uDD73-\\uDD7A]|\\uDB40[\\uDC01\\uDC20-\\uDC7F]/", "export default /[!-#%-\\*,-\\/:;\\?@\\[-\\]_\\{\\}\\xA1\\xA7\\xAB\\xB6\\xB7\\xBB\\xBF\\u037E\\u0387\\u055A-\\u055F\\u0589\\u058A\\u05BE\\u05C0\\u05C3\\u05C6\\u05F3\\u05F4\\u0609\\u060A\\u060C\\u060D\\u061B\\u061D-\\u061F\\u066A-\\u066D\\u06D4\\u0700-\\u070D\\u07F7-\\u07F9\\u0830-\\u083E\\u085E\\u0964\\u0965\\u0970\\u09FD\\u0A76\\u0AF0\\u0C77\\u0C84\\u0DF4\\u0E4F\\u0E5A\\u0E5B\\u0F04-\\u0F12\\u0F14\\u0F3A-\\u0F3D\\u0F85\\u0FD0-\\u0FD4\\u0FD9\\u0FDA\\u104A-\\u104F\\u10FB\\u1360-\\u1368\\u1400\\u166E\\u169B\\u169C\\u16EB-\\u16ED\\u1735\\u1736\\u17D4-\\u17D6\\u17D8-\\u17DA\\u1800-\\u180A\\u1944\\u1945\\u1A1E\\u1A1F\\u1AA0-\\u1AA6\\u1AA8-\\u1AAD\\u1B5A-\\u1B60\\u1B7D\\u1B7E\\u1BFC-\\u1BFF\\u1C3B-\\u1C3F\\u1C7E\\u1C7F\\u1CC0-\\u1CC7\\u1CD3\\u2010-\\u2027\\u2030-\\u2043\\u2045-\\u2051\\u2053-\\u205E\\u207D\\u207E\\u208D\\u208E\\u2308-\\u230B\\u2329\\u232A\\u2768-\\u2775\\u27C5\\u27C6\\u27E6-\\u27EF\\u2983-\\u2998\\u29D8-\\u29DB\\u29FC\\u29FD\\u2CF9-\\u2CFC\\u2CFE\\u2CFF\\u2D70\\u2E00-\\u2E2E\\u2E30-\\u2E4F\\u2E52-\\u2E5D\\u3001-\\u3003\\u3008-\\u3011\\u3014-\\u301F\\u3030\\u303D\\u30A0\\u30FB\\uA4FE\\uA4FF\\uA60D-\\uA60F\\uA673\\uA67E\\uA6F2-\\uA6F7\\uA874-\\uA877\\uA8CE\\uA8CF\\uA8F8-\\uA8FA\\uA8FC\\uA92E\\uA92F\\uA95F\\uA9C1-\\uA9CD\\uA9DE\\uA9DF\\uAA5C-\\uAA5F\\uAADE\\uAADF\\uAAF0\\uAAF1\\uABEB\\uFD3E\\uFD3F\\uFE10-\\uFE19\\uFE30-\\uFE52\\uFE54-\\uFE61\\uFE63\\uFE68\\uFE6A\\uFE6B\\uFF01-\\uFF03\\uFF05-\\uFF0A\\uFF0C-\\uFF0F\\uFF1A\\uFF1B\\uFF1F\\uFF20\\uFF3B-\\uFF3D\\uFF3F\\uFF5B\\uFF5D\\uFF5F-\\uFF65]|\\uD800[\\uDD00-\\uDD02\\uDF9F\\uDFD0]|\\uD801\\uDD6F|\\uD802[\\uDC57\\uDD1F\\uDD3F\\uDE50-\\uDE58\\uDE7F\\uDEF0-\\uDEF6\\uDF39-\\uDF3F\\uDF99-\\uDF9C]|\\uD803[\\uDEAD\\uDF55-\\uDF59\\uDF86-\\uDF89]|\\uD804[\\uDC47-\\uDC4D\\uDCBB\\uDCBC\\uDCBE-\\uDCC1\\uDD40-\\uDD43\\uDD74\\uDD75\\uDDC5-\\uDDC8\\uDDCD\\uDDDB\\uDDDD-\\uDDDF\\uDE38-\\uDE3D\\uDEA9]|\\uD805[\\uDC4B-\\uDC4F\\uDC5A\\uDC5B\\uDC5D\\uDCC6\\uDDC1-\\uDDD7\\uDE41-\\uDE43\\uDE60-\\uDE6C\\uDEB9\\uDF3C-\\uDF3E]|\\uD806[\\uDC3B\\uDD44-\\uDD46\\uDDE2\\uDE3F-\\uDE46\\uDE9A-\\uDE9C\\uDE9E-\\uDEA2\\uDF00-\\uDF09]|\\uD807[\\uDC41-\\uDC45\\uDC70\\uDC71\\uDEF7\\uDEF8\\uDF43-\\uDF4F\\uDFFF]|\\uD809[\\uDC70-\\uDC74]|\\uD80B[\\uDFF1\\uDFF2]|\\uD81A[\\uDE6E\\uDE6F\\uDEF5\\uDF37-\\uDF3B\\uDF44]|\\uD81B[\\uDE97-\\uDE9A\\uDFE2]|\\uD82F\\uDC9F|\\uD836[\\uDE87-\\uDE8B]|\\uD83A[\\uDD5E\\uDD5F]/", "export default /[\\$\\+<->\\^`\\|~\\xA2-\\xA6\\xA8\\xA9\\xAC\\xAE-\\xB1\\xB4\\xB8\\xD7\\xF7\\u02C2-\\u02C5\\u02D2-\\u02DF\\u02E5-\\u02EB\\u02ED\\u02EF-\\u02FF\\u0375\\u0384\\u0385\\u03F6\\u0482\\u058D-\\u058F\\u0606-\\u0608\\u060B\\u060E\\u060F\\u06DE\\u06E9\\u06FD\\u06FE\\u07F6\\u07FE\\u07FF\\u0888\\u09F2\\u09F3\\u09FA\\u09FB\\u0AF1\\u0B70\\u0BF3-\\u0BFA\\u0C7F\\u0D4F\\u0D79\\u0E3F\\u0F01-\\u0F03\\u0F13\\u0F15-\\u0F17\\u0F1A-\\u0F1F\\u0F34\\u0F36\\u0F38\\u0FBE-\\u0FC5\\u0FC7-\\u0FCC\\u0FCE\\u0FCF\\u0FD5-\\u0FD8\\u109E\\u109F\\u1390-\\u1399\\u166D\\u17DB\\u1940\\u19DE-\\u19FF\\u1B61-\\u1B6A\\u1B74-\\u1B7C\\u1FBD\\u1FBF-\\u1FC1\\u1FCD-\\u1FCF\\u1FDD-\\u1FDF\\u1FED-\\u1FEF\\u1FFD\\u1FFE\\u2044\\u2052\\u207A-\\u207C\\u208A-\\u208C\\u20A0-\\u20C0\\u2100\\u2101\\u2103-\\u2106\\u2108\\u2109\\u2114\\u2116-\\u2118\\u211E-\\u2123\\u2125\\u2127\\u2129\\u212E\\u213A\\u213B\\u2140-\\u2144\\u214A-\\u214D\\u214F\\u218A\\u218B\\u2190-\\u2307\\u230C-\\u2328\\u232B-\\u2426\\u2440-\\u244A\\u249C-\\u24E9\\u2500-\\u2767\\u2794-\\u27C4\\u27C7-\\u27E5\\u27F0-\\u2982\\u2999-\\u29D7\\u29DC-\\u29FB\\u29FE-\\u2B73\\u2B76-\\u2B95\\u2B97-\\u2BFF\\u2CE5-\\u2CEA\\u2E50\\u2E51\\u2E80-\\u2E99\\u2E9B-\\u2EF3\\u2F00-\\u2FD5\\u2FF0-\\u2FFF\\u3004\\u3012\\u3013\\u3020\\u3036\\u3037\\u303E\\u303F\\u309B\\u309C\\u3190\\u3191\\u3196-\\u319F\\u31C0-\\u31E3\\u31EF\\u3200-\\u321E\\u322A-\\u3247\\u3250\\u3260-\\u327F\\u328A-\\u32B0\\u32C0-\\u33FF\\u4DC0-\\u4DFF\\uA490-\\uA4C6\\uA700-\\uA716\\uA720\\uA721\\uA789\\uA78A\\uA828-\\uA82B\\uA836-\\uA839\\uAA77-\\uAA79\\uAB5B\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B-\\uDFD9\\uDFE0-\\uDFEB\\uDFF0]|\\uD83E[\\uDC00-\\uDC0B\\uDC10-\\uDC47\\uDC50-\\uDC59\\uDC60-\\uDC87\\uDC90-\\uDCAD\\uDCB0\\uDCB1\\uDD00-\\uDE53\\uDE60-\\uDE6D\\uDE70-\\uDE7C\\uDE80-\\uDE88\\uDE90-\\uDEBD\\uDEBF-\\uDEC5\\uDECE-\\uDEDB\\uDEE0-\\uDEE8\\uDEF0-\\uDEF8\\uDF00-\\uDF92\\uDF94-\\uDFCA]/", "export default /[ \\xA0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000]/", null, null, null, null, null, null, null, "// Just a shortcut for bulk export\n\nimport parseLinkLabel from './parse_link_label.mjs'\nimport parseLinkDestination from './parse_link_destination.mjs'\nimport parseLinkTitle from './parse_link_title.mjs'\n\nexport {\n parseLinkLabel,\n parseLinkDestination,\n parseLinkTitle\n}\n", "// Parse link label\n//\n// this function assumes that first character (\"[\") already matches;\n// returns the end of the label\n//\n\nexport default function parseLinkLabel (state, start, disableNested) {\n let level, found, marker, prevPos\n\n const max = state.posMax\n const oldPos = state.pos\n\n state.pos = start + 1\n level = 1\n\n while (state.pos < max) {\n marker = state.src.charCodeAt(state.pos)\n if (marker === 0x5D /* ] */) {\n level--\n if (level === 0) {\n found = true\n break\n }\n }\n\n prevPos = state.pos\n state.md.inline.skipToken(state)\n if (marker === 0x5B /* [ */) {\n if (prevPos === state.pos - 1) {\n // increase level if we find text `[`, which is not a part of any token\n level++\n } else if (disableNested) {\n state.pos = oldPos\n return -1\n }\n }\n }\n\n let labelEnd = -1\n\n if (found) {\n labelEnd = state.pos\n }\n\n // restore old state\n state.pos = oldPos\n\n return labelEnd\n}\n", "// Parse link destination\n//\n\nimport { unescapeAll } from '../common/utils.mjs'\n\nexport default function parseLinkDestination (str, start, max) {\n let code\n let pos = start\n\n const result = {\n ok: false,\n pos: 0,\n str: ''\n }\n\n if (str.charCodeAt(pos) === 0x3C /* < */) {\n pos++\n while (pos < max) {\n code = str.charCodeAt(pos)\n if (code === 0x0A /* \\n */) { return result }\n if (code === 0x3C /* < */) { return result }\n if (code === 0x3E /* > */) {\n result.pos = pos + 1\n result.str = unescapeAll(str.slice(start + 1, pos))\n result.ok = true\n return result\n }\n if (code === 0x5C /* \\ */ && pos + 1 < max) {\n pos += 2\n continue\n }\n\n pos++\n }\n\n // no closing '>'\n return result\n }\n\n // this should be ... } else { ... branch\n\n let level = 0\n while (pos < max) {\n code = str.charCodeAt(pos)\n\n if (code === 0x20) { break }\n\n // ascii control characters\n if (code < 0x20 || code === 0x7F) { break }\n\n if (code === 0x5C /* \\ */ && pos + 1 < max) {\n if (str.charCodeAt(pos + 1) === 0x20) { break }\n pos += 2\n continue\n }\n\n if (code === 0x28 /* ( */) {\n level++\n if (level > 32) { return result }\n }\n\n if (code === 0x29 /* ) */) {\n if (level === 0) { break }\n level--\n }\n\n pos++\n }\n\n if (start === pos) { return result }\n if (level !== 0) { return result }\n\n result.str = unescapeAll(str.slice(start, pos))\n result.pos = pos\n result.ok = true\n return result\n}\n", "// Parse link title\n//\n\nimport { unescapeAll } from '../common/utils.mjs'\n\n// Parse link title within `str` in [start, max] range,\n// or continue previous parsing if `prev_state` is defined (equal to result of last execution).\n//\nexport default function parseLinkTitle (str, start, max, prev_state) {\n let code\n let pos = start\n\n const state = {\n // if `true`, this is a valid link title\n ok: false,\n // if `true`, this link can be continued on the next line\n can_continue: false,\n // if `ok`, it's the position of the first character after the closing marker\n pos: 0,\n // if `ok`, it's the unescaped title\n str: '',\n // expected closing marker character code\n marker: 0\n }\n\n if (prev_state) {\n // this is a continuation of a previous parseLinkTitle call on the next line,\n // used in reference links only\n state.str = prev_state.str\n state.marker = prev_state.marker\n } else {\n if (pos >= max) { return state }\n\n let marker = str.charCodeAt(pos)\n if (marker !== 0x22 /* \" */ && marker !== 0x27 /* ' */ && marker !== 0x28 /* ( */) { return state }\n\n start++\n pos++\n\n // if opening marker is \"(\", switch it to closing marker \")\"\n if (marker === 0x28) { marker = 0x29 }\n\n state.marker = marker\n }\n\n while (pos < max) {\n code = str.charCodeAt(pos)\n if (code === state.marker) {\n state.pos = pos + 1\n state.str += unescapeAll(str.slice(start, pos))\n state.ok = true\n return state\n } else if (code === 0x28 /* ( */ && state.marker === 0x29 /* ) */) {\n return state\n } else if (code === 0x5C /* \\ */ && pos + 1 < max) {\n pos++\n }\n\n pos++\n }\n\n // no closing marker found, but this link title may continue on the next line (for references)\n state.can_continue = true\n state.str += unescapeAll(str.slice(start, pos))\n return state\n}\n", "/**\n * class Renderer\n *\n * Generates HTML from parsed token stream. Each instance has independent\n * copy of rules. Those can be rewritten with ease. Also, you can add new\n * rules if you create plugin and adds new token types.\n **/\n\nimport { assign, unescapeAll, escapeHtml } from './common/utils.mjs'\n\nconst default_rules = {}\n\ndefault_rules.code_inline = function (tokens, idx, options, env, slf) {\n const token = tokens[idx]\n\n return '<code' + slf.renderAttrs(token) + '>' +\n escapeHtml(token.content) +\n '</code>'\n}\n\ndefault_rules.code_block = function (tokens, idx, options, env, slf) {\n const token = tokens[idx]\n\n return '<pre' + slf.renderAttrs(token) + '><code>' +\n escapeHtml(tokens[idx].content) +\n '</code></pre>\\n'\n}\n\ndefault_rules.fence = function (tokens, idx, options, env, slf) {\n const token = tokens[idx]\n const info = token.info ? unescapeAll(token.info).trim() : ''\n let langName = ''\n let langAttrs = ''\n\n if (info) {\n const arr = info.split(/(\\s+)/g)\n langName = arr[0]\n langAttrs = arr.slice(2).join('')\n }\n\n let highlighted\n if (options.highlight) {\n highlighted = options.highlight(token.content, langName, langAttrs) || escapeHtml(token.content)\n } else {\n highlighted = escapeHtml(token.content)\n }\n\n if (highlighted.indexOf('<pre') === 0) {\n return highlighted + '\\n'\n }\n\n // If language exists, inject class gently, without modifying original token.\n // May be, one day we will add .deepClone() for token and simplify this part, but\n // now we prefer to keep things local.\n if (info) {\n const i = token.attrIndex('class')\n const tmpAttrs = token.attrs ? token.attrs.slice() : []\n\n if (i < 0) {\n tmpAttrs.push(['class', options.langPrefix + langName])\n } else {\n tmpAttrs[i] = tmpAttrs[i].slice()\n tmpAttrs[i][1] += ' ' + options.langPrefix + langName\n }\n\n // Fake token just to render attributes\n const tmpToken = {\n attrs: tmpAttrs\n }\n\n return `<pre><code${slf.renderAttrs(tmpToken)}>${highlighted}</code></pre>\\n`\n }\n\n return `<pre><code${slf.renderAttrs(token)}>${highlighted}</code></pre>\\n`\n}\n\ndefault_rules.image = function (tokens, idx, options, env, slf) {\n const token = tokens[idx]\n\n // \"alt\" attr MUST be set, even if empty. Because it's mandatory and\n // should be placed on proper position for tests.\n //\n // Replace content with actual value\n\n token.attrs[token.attrIndex('alt')][1] =\n slf.renderInlineAsText(token.children, options, env)\n\n return slf.renderToken(tokens, idx, options)\n}\n\ndefault_rules.hardbreak = function (tokens, idx, options /*, env */) {\n return options.xhtmlOut ? '<br />\\n' : '<br>\\n'\n}\ndefault_rules.softbreak = function (tokens, idx, options /*, env */) {\n return options.breaks ? (options.xhtmlOut ? '<br />\\n' : '<br>\\n') : '\\n'\n}\n\ndefault_rules.text = function (tokens, idx /*, options, env */) {\n return escapeHtml(tokens[idx].content)\n}\n\ndefault_rules.html_block = function (tokens, idx /*, options, env */) {\n return tokens[idx].content\n}\ndefault_rules.html_inline = function (tokens, idx /*, options, env */) {\n return tokens[idx].content\n}\n\n/**\n * new Renderer()\n *\n * Creates new [[Renderer]] instance and fill [[Renderer#rules]] with defaults.\n **/\nfunction Renderer () {\n /**\n * Renderer#rules -> Object\n *\n * Contains render rules for tokens. Can be updated and extended.\n *\n * ##### Example\n *\n * ```javascript\n * var md = require('markdown-it')();\n *\n * md.renderer.rules.strong_open = function () { return '<b>'; };\n * md.renderer.rules.strong_close = function () { return '</b>'; };\n *\n * var result = md.renderInline(...);\n * ```\n *\n * Each rule is called as independent static function with fixed signature:\n *\n * ```javascript\n * function my_token_render(tokens, idx, options, env, renderer) {\n * // ...\n * return renderedHTML;\n * }\n * ```\n *\n * See [source code](https://github.com/markdown-it/markdown-it/blob/master/lib/renderer.mjs)\n * for more details and examples.\n **/\n this.rules = assign({}, default_rules)\n}\n\n/**\n * Renderer.renderAttrs(token) -> String\n *\n * Render token attributes to string.\n **/\nRenderer.prototype.renderAttrs = function renderAttrs (token) {\n let i, l, result\n\n if (!token.attrs) { return '' }\n\n result = ''\n\n for (i = 0, l = token.attrs.length; i < l; i++) {\n result += ' ' + escapeHtml(token.attrs[i][0]) + '=\"' + escapeHtml(token.attrs[i][1]) + '\"'\n }\n\n return result\n}\n\n/**\n * Renderer.renderToken(tokens, idx, options) -> String\n * - tokens (Array): list of tokens\n * - idx (Numbed): token index to render\n * - options (Object): params of parser instance\n *\n * Default token renderer. Can be overriden by custom function\n * in [[Renderer#rules]].\n **/\nRenderer.prototype.renderToken = function renderToken (tokens, idx, options) {\n const token = tokens[idx]\n let result = ''\n\n // Tight list paragraphs\n if (token.hidden) {\n return ''\n }\n\n // Insert a newline between hidden paragraph and subsequent opening\n // block-level tag.\n //\n // For example, here we should insert a newline before blockquote:\n // - a\n // >\n //\n if (token.block && token.nesting !== -1 && idx && tokens[idx - 1].hidden) {\n result += '\\n'\n }\n\n // Add token name, e.g. `<img`\n result += (token.nesting === -1 ? '</' : '<') + token.tag\n\n // Encode attributes, e.g. `<img src=\"foo\"`\n result += this.renderAttrs(token)\n\n // Add a slash for self-closing tags, e.g. `<img src=\"foo\" /`\n if (token.nesting === 0 && options.xhtmlOut) {\n result += ' /'\n }\n\n // Check if we need to add a newline after this tag\n let needLf = false\n if (token.block) {\n needLf = true\n\n if (token.nesting === 1) {\n if (idx + 1 < tokens.length) {\n const nextToken = tokens[idx + 1]\n\n if (nextToken.type === 'inline' || nextToken.hidden) {\n // Block-level tag containing an inline tag.\n //\n needLf = false\n } else if (nextToken.nesting === -1 && nextToken.tag === token.tag) {\n // Opening tag + closing tag of the same type. E.g. `<li></li>`.\n //\n needLf = false\n }\n }\n }\n }\n\n result += needLf ? '>\\n' : '>'\n\n return result\n}\n\n/**\n * Renderer.renderInline(tokens, options, env) -> String\n * - tokens (Array): list on block tokens to render\n * - options (Object): params of parser instance\n * - env (Object): additional data from parsed input (references, for example)\n *\n * The same as [[Renderer.render]], but for single token of `inline` type.\n **/\nRenderer.prototype.renderInline = function (tokens, options, env) {\n let result = ''\n const rules = this.rules\n\n for (let i = 0, len = tokens.length; i < len; i++) {\n const type = tokens[i].type\n\n if (typeof rules[type] !== 'undefined') {\n result += rules[type](tokens, i, options, env, this)\n } else {\n result += this.renderToken(tokens, i, options)\n }\n }\n\n return result\n}\n\n/** internal\n * Renderer.renderInlineAsText(tokens, options, env) -> String\n * - tokens (Array): list on block tokens to render\n * - options (Object): params of parser instance\n * - env (Object): additional data from parsed input (references, for example)\n *\n * Special kludge for image `alt` attributes to conform CommonMark spec.\n * Don't try to use it! Spec requires to show `alt` content with stripped markup,\n * instead of simple escaping.\n **/\nRenderer.prototype.renderInlineAsText = function (tokens, options, env) {\n let result = ''\n\n for (let i = 0, len = tokens.length; i < len; i++) {\n switch (tokens[i].type) {\n case 'text':\n result += tokens[i].content\n break\n case 'image':\n result += this.renderInlineAsText(tokens[i].children, options, env)\n break\n case 'html_inline':\n case 'html_block':\n result += tokens[i].content\n break\n case 'softbreak':\n case 'hardbreak':\n result += '\\n'\n break\n default:\n // all other tokens are skipped\n }\n }\n\n return result\n}\n\n/**\n * Renderer.render(tokens, options, env) -> String\n * - tokens (Array): list on block tokens to render\n * - options (Object): params of parser instance\n * - env (Object): additional data from parsed input (references, for example)\n *\n * Takes token stream and generates HTML. Probably, you will never need to call\n * this method directly.\n **/\nRenderer.prototype.render = function (tokens, options, env) {\n let result = ''\n const rules = this.rules\n\n for (let i = 0, len = tokens.length; i < len; i++) {\n const type = tokens[i].type\n\n if (type === 'inline') {\n result += this.renderInline(tokens[i].children, options, env)\n } else if (typeof rules[type] !== 'undefined') {\n result += rules[type](tokens, i, options, env, this)\n } else {\n result += this.renderToken(tokens, i, options, env)\n }\n }\n\n return result\n}\n\nexport default Renderer\n", "/**\n * class Ruler\n *\n * Helper class, used by [[MarkdownIt#core]], [[MarkdownIt#block]] and\n * [[MarkdownIt#inline]] to manage sequences of functions (rules):\n *\n * - keep rules in defined order\n * - assign the name to each rule\n * - enable/disable rules\n * - add/replace rules\n * - allow assign rules to additional named chains (in the same)\n * - cacheing lists of active rules\n *\n * You will not need use this class directly until write plugins. For simple\n * rules control use [[MarkdownIt.disable]], [[MarkdownIt.enable]] and\n * [[MarkdownIt.use]].\n **/\n\n/**\n * new Ruler()\n **/\nfunction Ruler () {\n // List of added rules. Each element is:\n //\n // {\n // name: XXX,\n // enabled: Boolean,\n // fn: Function(),\n // alt: [ name2, name3 ]\n // }\n //\n this.__rules__ = []\n\n // Cached rule chains.\n //\n // First level - chain name, '' for default.\n // Second level - diginal anchor for fast filtering by charcodes.\n //\n this.__cache__ = null\n}\n\n// Helper methods, should not be used directly\n\n// Find rule index by name\n//\nRuler.prototype.__find__ = function (name) {\n for (let i = 0; i < this.__rules__.length; i++) {\n if (this.__rules__[i].name === name) {\n return i\n }\n }\n return -1\n}\n\n// Build rules lookup cache\n//\nRuler.prototype.__compile__ = function () {\n const self = this\n const chains = ['']\n\n // collect unique names\n self.__rules__.forEach(function (rule) {\n if (!rule.enabled) { return }\n\n rule.alt.forEach(function (altName) {\n if (chains.indexOf(altName) < 0) {\n chains.push(altName)\n }\n })\n })\n\n self.__cache__ = {}\n\n chains.forEach(function (chain) {\n self.__cache__[chain] = []\n self.__rules__.forEach(function (rule) {\n if (!rule.enabled) { return }\n\n if (chain && rule.alt.indexOf(chain) < 0) { return }\n\n self.__cache__[chain].push(rule.fn)\n })\n })\n}\n\n/**\n * Ruler.at(name, fn [, options])\n * - name (String): rule name to replace.\n * - fn (Function): new rule function.\n * - options (Object): new rule options (not mandatory).\n *\n * Replace rule by name with new function & options. Throws error if name not\n * found.\n *\n * ##### Options:\n *\n * - __alt__ - array with names of \"alternate\" chains.\n *\n * ##### Example\n *\n * Replace existing typographer replacement rule with new one:\n *\n * ```javascript\n * var md = require('markdown-it')();\n *\n * md.core.ruler.at('replacements', function replace(state) {\n * //...\n * });\n * ```\n **/\nRuler.prototype.at = function (name, fn, options) {\n const index = this.__find__(name)\n const opt = options || {}\n\n if (index === -1) { throw new Error('Parser rule not found: ' + name) }\n\n this.__rules__[index].fn = fn\n this.__rules__[index].alt = opt.alt || []\n this.__cache__ = null\n}\n\n/**\n * Ruler.before(beforeName, ruleName, fn [, options])\n * - beforeName (String): new rule will be added before this one.\n * - ruleName (String): name of added rule.\n * - fn (Function): rule function.\n * - options (Object): rule options (not mandatory).\n *\n * Add new rule to chain before one with given name. See also\n * [[Ruler.after]], [[Ruler.push]].\n *\n * ##### Options:\n *\n * - __alt__ - array with names of \"alternate\" chains.\n *\n * ##### Example\n *\n * ```javascript\n * var md = require('markdown-it')();\n *\n * md.block.ruler.before('paragraph', 'my_rule', function replace(state) {\n * //...\n * });\n * ```\n **/\nRuler.prototype.before = function (beforeName, ruleName, fn, options) {\n const index = this.__find__(beforeName)\n const opt = options || {}\n\n if (index === -1) { throw new Error('Parser rule not found: ' + beforeName) }\n\n this.__rules__.splice(index, 0, {\n name: ruleName,\n enabled: true,\n fn,\n alt: opt.alt || []\n })\n\n this.__cache__ = null\n}\n\n/**\n * Ruler.after(afterName, ruleName, fn [, options])\n * - afterName (String): new rule will be added after this one.\n * - ruleName (String): name of added rule.\n * - fn (Function): rule function.\n * - options (Object): rule options (not mandatory).\n *\n * Add new rule to chain after one with given name. See also\n * [[Ruler.before]], [[Ruler.push]].\n *\n * ##### Options:\n *\n * - __alt__ - array with names of \"alternate\" chains.\n *\n * ##### Example\n *\n * ```javascript\n * var md = require('markdown-it')();\n *\n * md.inline.ruler.after('text', 'my_rule', function replace(state) {\n * //...\n * });\n * ```\n **/\nRuler.prototype.after = function (afterName, ruleName, fn, options) {\n const index = this.__find__(afterName)\n const opt = options || {}\n\n if (index === -1) { throw new Error('Parser rule not found: ' + afterName) }\n\n this.__rules__.splice(index + 1, 0, {\n name: ruleName,\n enabled: true,\n fn,\n alt: opt.alt || []\n })\n\n this.__cache__ = null\n}\n\n/**\n * Ruler.push(ruleName, fn [, options])\n * - ruleName (String): name of added rule.\n * - fn (Function): rule function.\n * - options (Object): rule options (not mandatory).\n *\n * Push new rule to the end of chain. See also\n * [[Ruler.before]], [[Ruler.after]].\n *\n * ##### Options:\n *\n * - __alt__ - array with names of \"alternate\" chains.\n *\n * ##### Example\n *\n * ```javascript\n * var md = require('markdown-it')();\n *\n * md.core.ruler.push('my_rule', function replace(state) {\n * //...\n * });\n * ```\n **/\nRuler.prototype.push = function (ruleName, fn, options) {\n const opt = options || {}\n\n this.__rules__.push({\n name: ruleName,\n enabled: true,\n fn,\n alt: opt.alt || []\n })\n\n this.__cache__ = null\n}\n\n/**\n * Ruler.enable(list [, ignoreInvalid]) -> Array\n * - list (String|Array): list of rule names to enable.\n * - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found.\n *\n * Enable rules with given names. If any rule name not found - throw Error.\n * Errors can be disabled by second param.\n *\n * Returns list of found rule names (if no exception happened).\n *\n * See also [[Ruler.disable]], [[Ruler.enableOnly]].\n **/\nRuler.prototype.enable = function (list, ignoreInvalid) {\n if (!Array.isArray(list)) { list = [list] }\n\n const result = []\n\n // Search by name and enable\n list.forEach(function (name) {\n const idx = this.__find__(name)\n\n if (idx < 0) {\n if (ignoreInvalid) { return }\n throw new Error('Rules manager: invalid rule name ' + name)\n }\n this.__rules__[idx].enabled = true\n result.push(name)\n }, this)\n\n this.__cache__ = null\n return result\n}\n\n/**\n * Ruler.enableOnly(list [, ignoreInvalid])\n * - list (String|Array): list of rule names to enable (whitelist).\n * - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found.\n *\n * Enable rules with given names, and disable everything else. If any rule name\n * not found - throw Error. Errors can be disabled by second param.\n *\n * See also [[Ruler.disable]], [[Ruler.enable]].\n **/\nRuler.prototype.enableOnly = function (list, ignoreInvalid) {\n if (!Array.isArray(list)) { list = [list] }\n\n this.__rules__.forEach(function (rule) { rule.enabled = false })\n\n this.enable(list, ignoreInvalid)\n}\n\n/**\n * Ruler.disable(list [, ignoreInvalid]) -> Array\n * - list (String|Array): list of rule names to disable.\n * - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found.\n *\n * Disable rules with given names. If any rule name not found - throw Error.\n * Errors can be disabled by second param.\n *\n * Returns list of found rule names (if no exception happened).\n *\n * See also [[Ruler.enable]], [[Ruler.enableOnly]].\n **/\nRuler.prototype.disable = function (list, ignoreInvalid) {\n if (!Array.isArray(list)) { list = [list] }\n\n const result = []\n\n // Search by name and disable\n list.forEach(function (name) {\n const idx = this.__find__(name)\n\n if (idx < 0) {\n if (ignoreInvalid) { return }\n throw new Error('Rules manager: invalid rule name ' + name)\n }\n this.__rules__[idx].enabled = false\n result.push(name)\n }, this)\n\n this.__cache__ = null\n return result\n}\n\n/**\n * Ruler.getRules(chainName) -> Array\n *\n * Return array of active functions (rules) for given chain name. It analyzes\n * rules configuration, compiles caches if not exists and returns result.\n *\n * Default chain name is `''` (empty string). It can't be skipped. That's\n * done intentionally, to keep signature monomorphic for high speed.\n **/\nRuler.prototype.getRules = function (chainName) {\n if (this.__cache__ === null) {\n this.__compile__()\n }\n\n // Chain can be empty, if rules disabled. But we still have to return Array.\n return this.__cache__[chainName] || []\n}\n\nexport default Ruler\n", "// Token class\n\n/**\n * class Token\n **/\n\n/**\n * new Token(type, tag, nesting)\n *\n * Create new token and fill passed properties.\n **/\nfunction Token (type, tag, nesting) {\n /**\n * Token#type -> String\n *\n * Type of the token (string, e.g. \"paragraph_open\")\n **/\n this.type = type\n\n /**\n * Token#tag -> String\n *\n * html tag name, e.g. \"p\"\n **/\n this.tag = tag\n\n /**\n * Token#attrs -> Array\n *\n * Html attributes. Format: `[ [ name1, value1 ], [ name2, value2 ] ]`\n **/\n this.attrs = null\n\n /**\n * Token#map -> Array\n *\n * Source map info. Format: `[ line_begin, line_end ]`\n **/\n this.map = null\n\n /**\n * Token#nesting -> Number\n *\n * Level change (number in {-1, 0, 1} set), where:\n *\n * - `1` means the tag is opening\n * - `0` means the tag is self-closing\n * - `-1` means the tag is closing\n **/\n this.nesting = nesting\n\n /**\n * Token#level -> Number\n *\n * nesting level, the same as `state.level`\n **/\n this.level = 0\n\n /**\n * Token#children -> Array\n *\n * An array of child nodes (inline and img tokens)\n **/\n this.children = null\n\n /**\n * Token#content -> String\n *\n * In a case of self-closing tag (code, html, fence, etc.),\n * it has contents of this tag.\n **/\n this.content = ''\n\n /**\n * Token#markup -> String\n *\n * '*' or '_' for emphasis, fence string for fence, etc.\n **/\n this.markup = ''\n\n /**\n * Token#info -> String\n *\n * Additional information:\n *\n * - Info string for \"fence\" tokens\n * - The value \"auto\" for autolink \"link_open\" and \"link_close\" tokens\n * - The string value of the item marker for ordered-list \"list_item_open\" tokens\n **/\n this.info = ''\n\n /**\n * Token#meta -> Object\n *\n * A place for plugins to store an arbitrary data\n **/\n this.meta = null\n\n /**\n * Token#block -> Boolean\n *\n * True for block-level tokens, false for inline tokens.\n * Used in renderer to calculate line breaks\n **/\n this.block = false\n\n /**\n * Token#hidden -> Boolean\n *\n * If it's true, ignore this element when rendering. Used for tight lists\n * to hide paragraphs.\n **/\n this.hidden = false\n}\n\n/**\n * Token.attrIndex(name) -> Number\n *\n * Search attribute index by name.\n **/\nToken.prototype.attrIndex = function attrIndex (name) {\n if (!this.attrs) { return -1 }\n\n const attrs = this.attrs\n\n for (let i = 0, len = attrs.length; i < len; i++) {\n if (attrs[i][0] === name) { return i }\n }\n return -1\n}\n\n/**\n * Token.attrPush(attrData)\n *\n * Add `[ name, value ]` attribute to list. Init attrs if necessary\n **/\nToken.prototype.attrPush = function attrPush (attrData) {\n if (this.attrs) {\n this.attrs.push(attrData)\n } else {\n this.attrs = [attrData]\n }\n}\n\n/**\n * Token.attrSet(name, value)\n *\n * Set `name` attribute to `value`. Override old value if exists.\n **/\nToken.prototype.attrSet = function attrSet (name, value) {\n const idx = this.attrIndex(name)\n const attrData = [name, value]\n\n if (idx < 0) {\n this.attrPush(attrData)\n } else {\n this.attrs[idx] = attrData\n }\n}\n\n/**\n * Token.attrGet(name)\n *\n * Get the value of attribute `name`, or null if it does not exist.\n **/\nToken.prototype.attrGet = function attrGet (name) {\n const idx = this.attrIndex(name)\n let value = null\n if (idx >= 0) {\n value = this.attrs[idx][1]\n }\n return value\n}\n\n/**\n * Token.attrJoin(name, value)\n *\n * Join value to existing attribute via space. Or create new attribute if not\n * exists. Useful to operate with token classes.\n **/\nToken.prototype.attrJoin = function attrJoin (name, value) {\n const idx = this.attrIndex(name)\n\n if (idx < 0) {\n this.attrPush([name, value])\n } else {\n this.attrs[idx][1] = this.attrs[idx][1] + ' ' + value\n }\n}\n\nexport default Token\n", "// Core state object\n//\n\nimport Token from '../token.mjs'\n\nfunction StateCore (src, md, env) {\n this.src = src\n this.env = env\n this.tokens = []\n this.inlineMode = false\n this.md = md // link to parser instance\n}\n\n// re-export Token class to use in core rules\nStateCore.prototype.Token = Token\n\nexport default StateCore\n", "// Normalize input string\n\n// https://spec.commonmark.org/0.29/#line-ending\nconst NEWLINES_RE = /\\r\\n?|\\n/g\nconst NULL_RE = /\\0/g\n\nexport default function normalize (state) {\n let str\n\n // Normalize newlines\n str = state.src.replace(NEWLINES_RE, '\\n')\n\n // Replace NULL characters\n str = str.replace(NULL_RE, '\\uFFFD')\n\n state.src = str\n}\n", "export default function block (state) {\n let token\n\n if (state.inlineMode) {\n token = new state.Token('inline', '', 0)\n token.content = state.src\n token.map = [0, 1]\n token.children = []\n state.tokens.push(token)\n } else {\n state.md.block.parse(state.src, state.md, state.env, state.tokens)\n }\n}\n", "export default function inline (state) {\n const tokens = state.tokens\n\n // Parse inlines\n for (let i = 0, l = tokens.length; i < l; i++) {\n const tok = tokens[i]\n if (tok.type === 'inline') {\n state.md.inline.parse(tok.content, state.md, state.env, tok.children)\n }\n }\n}\n", "// Replace link-like texts with link nodes.\n//\n// Currently restricted by `md.validateLink()` to http/https/ftp\n//\n\nimport { arrayReplaceAt } from '../common/utils.mjs'\n\nfunction isLinkOpen (str) {\n return /^<a[>\\s]/i.test(str)\n}\nfunction isLinkClose (str) {\n return /^<\\/a\\s*>/i.test(str)\n}\n\nexport default function linkify (state) {\n const blockTokens = state.tokens\n\n if (!state.md.options.linkify) { return }\n\n for (let j = 0, l = blockTokens.length; j < l; j++) {\n if (blockTokens[j].type !== 'inline' ||\n !state.md.linkify.pretest(blockTokens[j].content)) {\n continue\n }\n\n let tokens = blockTokens[j].children\n\n let htmlLinkLevel = 0\n\n // We scan from the end, to keep position when new tags added.\n // Use reversed logic in links start/end match\n for (let i = tokens.length - 1; i >= 0; i--) {\n const currentToken = tokens[i]\n\n // Skip content of markdown links\n if (currentToken.type === 'link_close') {\n i--\n while (tokens[i].level !== currentToken.level && tokens[i].type !== 'link_open') {\n i--\n }\n continue\n }\n\n // Skip content of html tag links\n if (currentToken.type === 'html_inline') {\n if (isLinkOpen(currentToken.content) && htmlLinkLevel > 0) {\n htmlLinkLevel--\n }\n if (isLinkClose(currentToken.content)) {\n htmlLinkLevel++\n }\n }\n if (htmlLinkLevel > 0) { continue }\n\n if (currentToken.type === 'text' && state.md.linkify.test(currentToken.content)) {\n const text = currentToken.content\n let links = state.md.linkify.match(text)\n\n // Now split string to nodes\n const nodes = []\n let level = currentToken.level\n let lastPos = 0\n\n // forbid escape sequence at the start of the string,\n // this avoids http\\://example.com/ from being linkified as\n // http:<a href=\"//example.com/\">//example.com/</a>\n if (links.length > 0 &&\n links[0].index === 0 &&\n i > 0 &&\n tokens[i - 1].type === 'text_special') {\n links = links.slice(1)\n }\n\n for (let ln = 0; ln < links.length; ln++) {\n const url = links[ln].url\n const fullUrl = state.md.normalizeLink(url)\n if (!state.md.validateLink(fullUrl)) { continue }\n\n let urlText = links[ln].text\n\n // Linkifier might send raw hostnames like \"example.com\", where url\n // starts with domain name. So we prepend http:// in those cases,\n // and remove it afterwards.\n //\n if (!links[ln].schema) {\n urlText = state.md.normalizeLinkText('http://' + urlText).replace(/^http:\\/\\//, '')\n } else if (links[ln].schema === 'mailto:' && !/^mailto:/i.test(urlText)) {\n urlText = state.md.normalizeLinkText('mailto:' + urlText).replace(/^mailto:/, '')\n } else {\n urlText = state.md.normalizeLinkText(urlText)\n }\n\n const pos = links[ln].index\n\n if (pos > lastPos) {\n const token = new state.Token('text', '', 0)\n token.content = text.slice(lastPos, pos)\n token.level = level\n nodes.push(token)\n }\n\n const token_o = new state.Token('link_open', 'a', 1)\n token_o.attrs = [['href', fullUrl]]\n token_o.level = level++\n token_o.markup = 'linkify'\n token_o.info = 'auto'\n nodes.push(token_o)\n\n const token_t = new state.Token('text', '', 0)\n token_t.content = urlText\n token_t.level = level\n nodes.push(token_t)\n\n const token_c = new state.Token('link_close', 'a', -1)\n token_c.level = --level\n token_c.markup = 'linkify'\n token_c.info = 'auto'\n nodes.push(token_c)\n\n lastPos = links[ln].lastIndex\n }\n if (lastPos < text.length) {\n const token = new state.Token('text', '', 0)\n token.content = text.slice(lastPos)\n token.level = level\n nodes.push(token)\n }\n\n // replace current node\n blockTokens[j].children = tokens = arrayReplaceAt(tokens, i, nodes)\n }\n }\n }\n}\n", "// Simple typographic replacements\n//\n// (c) (C) \u2192 \u00A9\n// (tm) (TM) \u2192 \u2122\n// (r) (R) \u2192 \u00AE\n// +- \u2192 \u00B1\n// ... \u2192 \u2026 (also ?.... \u2192 ?.., !.... \u2192 !..)\n// ???????? \u2192 ???, !!!!! \u2192 !!!, `,,` \u2192 `,`\n// -- \u2192 –, --- \u2192 —\n//\n\n// TODO:\n// - fractionals 1/2, 1/4, 3/4 -> \u00BD, \u00BC, \u00BE\n// - multiplications 2 x 4 -> 2 \u00D7 4\n\nconst RARE_RE = /\\+-|\\.\\.|\\?\\?\\?\\?|!!!!|,,|--/\n\n// Workaround for phantomjs - need regex without /g flag,\n// or root check will fail every second time\nconst SCOPED_ABBR_TEST_RE = /\\((c|tm|r)\\)/i\n\nconst SCOPED_ABBR_RE = /\\((c|tm|r)\\)/ig\nconst SCOPED_ABBR = {\n c: '\u00A9',\n r: '\u00AE',\n tm: '\u2122'\n}\n\nfunction replaceFn (match, name) {\n return SCOPED_ABBR[name.toLowerCase()]\n}\n\nfunction replace_scoped (inlineTokens) {\n let inside_autolink = 0\n\n for (let i = inlineTokens.length - 1; i >= 0; i--) {\n const token = inlineTokens[i]\n\n if (token.type === 'text' && !inside_autolink) {\n token.content = token.content.replace(SCOPED_ABBR_RE, replaceFn)\n }\n\n if (token.type === 'link_open' && token.info === 'auto') {\n inside_autolink--\n }\n\n if (token.type === 'link_close' && token.info === 'auto') {\n inside_autolink++\n }\n }\n}\n\nfunction replace_rare (inlineTokens) {\n let inside_autolink = 0\n\n for (let i = inlineTokens.length - 1; i >= 0; i--) {\n const token = inlineTokens[i]\n\n if (token.type === 'text' && !inside_autolink) {\n if (RARE_RE.test(token.content)) {\n token.content = token.content\n .replace(/\\+-/g, '\u00B1')\n // .., ..., ....... -> \u2026\n // but ?..... & !..... -> ?.. & !..\n .replace(/\\.{2,}/g, '\u2026').replace(/([?!])\u2026/g, '$1..')\n .replace(/([?!]){4,}/g, '$1$1$1').replace(/,{2,}/g, ',')\n // em-dash\n .replace(/(^|[^-])---(?=[^-]|$)/mg, '$1\\u2014')\n // en-dash\n .replace(/(^|\\s)--(?=\\s|$)/mg, '$1\\u2013')\n .replace(/(^|[^-\\s])--(?=[^-\\s]|$)/mg, '$1\\u2013')\n }\n }\n\n if (token.type === 'link_open' && token.info === 'auto') {\n inside_autolink--\n }\n\n if (token.type === 'link_close' && token.info === 'auto') {\n inside_autolink++\n }\n }\n}\n\nexport default function replace (state) {\n let blkIdx\n\n if (!state.md.options.typographer) { return }\n\n for (blkIdx = state.tokens.length - 1; blkIdx >= 0; blkIdx--) {\n if (state.tokens[blkIdx].type !== 'inline') { continue }\n\n if (SCOPED_ABBR_TEST_RE.test(state.tokens[blkIdx].content)) {\n replace_scoped(state.tokens[blkIdx].children)\n }\n\n if (RARE_RE.test(state.tokens[blkIdx].content)) {\n replace_rare(state.tokens[blkIdx].children)\n }\n }\n}\n", "// Convert straight quotation marks to typographic ones\n//\n\nimport { isWhiteSpace, isPunctChar, isMdAsciiPunct } from '../common/utils.mjs'\n\nconst QUOTE_TEST_RE = /['\"]/\nconst QUOTE_RE = /['\"]/g\nconst APOSTROPHE = '\\u2019' /* \u2019 */\n\nfunction replaceAt (str, index, ch) {\n return str.slice(0, index) + ch + str.slice(index + 1)\n}\n\nfunction process_inlines (tokens, state) {\n let j\n\n const stack = []\n\n for (let i = 0; i < tokens.length; i++) {\n const token = tokens[i]\n\n const thisLevel = tokens[i].level\n\n for (j = stack.length - 1; j >= 0; j--) {\n if (stack[j].level <= thisLevel) { break }\n }\n stack.length = j + 1\n\n if (token.type !== 'text') { continue }\n\n let text = token.content\n let pos = 0\n let max = text.length\n\n /* eslint no-labels:0,block-scoped-var:0 */\n OUTER:\n while (pos < max) {\n QUOTE_RE.lastIndex = pos\n const t = QUOTE_RE.exec(text)\n if (!t) { break }\n\n let canOpen = true\n let canClose = true\n pos = t.index + 1\n const isSingle = (t[0] === \"'\")\n\n // Find previous character,\n // default to space if it's the beginning of the line\n //\n let lastChar = 0x20\n\n if (t.index - 1 >= 0) {\n lastChar = text.charCodeAt(t.index - 1)\n } else {\n for (j = i - 1; j >= 0; j--) {\n if (tokens[j].type === 'softbreak' || tokens[j].type === 'hardbreak') break // lastChar defaults to 0x20\n if (!tokens[j].content) continue // should skip all tokens except 'text', 'html_inline' or 'code_inline'\n\n lastChar = tokens[j].content.charCodeAt(tokens[j].content.length - 1)\n break\n }\n }\n\n // Find next character,\n // default to space if it's the end of the line\n //\n let nextChar = 0x20\n\n if (pos < max) {\n nextChar = text.charCodeAt(pos)\n } else {\n for (j = i + 1; j < tokens.length; j++) {\n if (tokens[j].type === 'softbreak' || tokens[j].type === 'hardbreak') break // nextChar defaults to 0x20\n if (!tokens[j].content) continue // should skip all tokens except 'text', 'html_inline' or 'code_inline'\n\n nextChar = tokens[j].content.charCodeAt(0)\n break\n }\n }\n\n const isLastPunctChar = isMdAsciiPunct(lastChar) || isPunctChar(String.fromCharCode(lastChar))\n const isNextPunctChar = isMdAsciiPunct(nextChar) || isPunctChar(String.fromCharCode(nextChar))\n\n const isLastWhiteSpace = isWhiteSpace(lastChar)\n const isNextWhiteSpace = isWhiteSpace(nextChar)\n\n if (isNextWhiteSpace) {\n canOpen = false\n } else if (isNextPunctChar) {\n if (!(isLastWhiteSpace || isLastPunctChar)) {\n canOpen = false\n }\n }\n\n if (isLastWhiteSpace) {\n canClose = false\n } else if (isLastPunctChar) {\n if (!(isNextWhiteSpace || isNextPunctChar)) {\n canClose = false\n }\n }\n\n if (nextChar === 0x22 /* \" */ && t[0] === '\"') {\n if (lastChar >= 0x30 /* 0 */ && lastChar <= 0x39 /* 9 */) {\n // special case: 1\"\" - count first quote as an inch\n canClose = canOpen = false\n }\n }\n\n if (canOpen && canClose) {\n // Replace quotes in the middle of punctuation sequence, but not\n // in the middle of the words, i.e.:\n //\n // 1. foo \" bar \" baz - not replaced\n // 2. foo-\"-bar-\"-baz - replaced\n // 3. foo\"bar\"baz - not replaced\n //\n canOpen = isLastPunctChar\n canClose = isNextPunctChar\n }\n\n if (!canOpen && !canClose) {\n // middle of word\n if (isSingle) {\n token.content = replaceAt(token.content, t.index, APOSTROPHE)\n }\n continue\n }\n\n if (canClose) {\n // this could be a closing quote, rewind the stack to get a match\n for (j = stack.length - 1; j >= 0; j--) {\n let item = stack[j]\n if (stack[j].level < thisLevel) { break }\n if (item.single === isSingle && stack[j].level === thisLevel) {\n item = stack[j]\n\n let openQuote\n let closeQuote\n if (isSingle) {\n openQuote = state.md.options.quotes[2]\n closeQuote = state.md.options.quotes[3]\n } else {\n openQuote = state.md.options.quotes[0]\n closeQuote = state.md.options.quotes[1]\n }\n\n // replace token.content *before* tokens[item.token].content,\n // because, if they are pointing at the same token, replaceAt\n // could mess up indices when quote length != 1\n token.content = replaceAt(token.content, t.index, closeQuote)\n tokens[item.token].content = replaceAt(\n tokens[item.token].content, item.pos, openQuote)\n\n pos += closeQuote.length - 1\n if (item.token === i) { pos += openQuote.length - 1 }\n\n text = token.content\n max = text.length\n\n stack.length = j\n continue OUTER\n }\n }\n }\n\n if (canOpen) {\n stack.push({\n token: i,\n pos: t.index,\n single: isSingle,\n level: thisLevel\n })\n } else if (canClose && isSingle) {\n token.content = replaceAt(token.content, t.index, APOSTROPHE)\n }\n }\n }\n}\n\nexport default function smartquotes (state) {\n /* eslint max-depth:0 */\n if (!state.md.options.typographer) { return }\n\n for (let blkIdx = state.tokens.length - 1; blkIdx >= 0; blkIdx--) {\n if (state.tokens[blkIdx].type !== 'inline' ||\n !QUOTE_TEST_RE.test(state.tokens[blkIdx].content)) {\n continue\n }\n\n process_inlines(state.tokens[blkIdx].children, state)\n }\n}\n", "// Join raw text tokens with the rest of the text\n//\n// This is set as a separate rule to provide an opportunity for plugins\n// to run text replacements after text join, but before escape join.\n//\n// For example, `\\:)` shouldn't be replaced with an emoji.\n//\n\nexport default function text_join (state) {\n let curr, last\n const blockTokens = state.tokens\n const l = blockTokens.length\n\n for (let j = 0; j < l; j++) {\n if (blockTokens[j].type !== 'inline') continue\n\n const tokens = blockTokens[j].children\n const max = tokens.length\n\n for (curr = 0; curr < max; curr++) {\n if (tokens[curr].type === 'text_special') {\n tokens[curr].type = 'text'\n }\n }\n\n for (curr = last = 0; curr < max; curr++) {\n if (tokens[curr].type === 'text' &&\n curr + 1 < max &&\n tokens[curr + 1].type === 'text') {\n // collapse two adjacent text nodes\n tokens[curr + 1].content = tokens[curr].content + tokens[curr + 1].content\n } else {\n if (curr !== last) { tokens[last] = tokens[curr] }\n\n last++\n }\n }\n\n if (curr !== last) {\n tokens.length = last\n }\n }\n}\n", "/** internal\n * class Core\n *\n * Top-level rules executor. Glues block/inline parsers and does intermediate\n * transformations.\n **/\n\nimport Ruler from './ruler.mjs'\nimport StateCore from './rules_core/state_core.mjs'\n\nimport r_normalize from './rules_core/normalize.mjs'\nimport r_block from './rules_core/block.mjs'\nimport r_inline from './rules_core/inline.mjs'\nimport r_linkify from './rules_core/linkify.mjs'\nimport r_replacements from './rules_core/replacements.mjs'\nimport r_smartquotes from './rules_core/smartquotes.mjs'\nimport r_text_join from './rules_core/text_join.mjs'\n\nconst _rules = [\n ['normalize', r_normalize],\n ['block', r_block],\n ['inline', r_inline],\n ['linkify', r_linkify],\n ['replacements', r_replacements],\n ['smartquotes', r_smartquotes],\n // `text_join` finds `text_special` tokens (for escape sequences)\n // and joins them with the rest of the text\n ['text_join', r_text_join]\n]\n\n/**\n * new Core()\n **/\nfunction Core () {\n /**\n * Core#ruler -> Ruler\n *\n * [[Ruler]] instance. Keep configuration of core rules.\n **/\n this.ruler = new Ruler()\n\n for (let i = 0; i < _rules.length; i++) {\n this.ruler.push(_rules[i][0], _rules[i][1])\n }\n}\n\n/**\n * Core.process(state)\n *\n * Executes core chain rules.\n **/\nCore.prototype.process = function (state) {\n const rules = this.ruler.getRules('')\n\n for (let i = 0, l = rules.length; i < l; i++) {\n rules[i](state)\n }\n}\n\nCore.prototype.State = StateCore\n\nexport default Core\n", "// Parser state class\n\nimport Token from '../token.mjs'\nimport { isSpace } from '../common/utils.mjs'\n\nfunction StateBlock (src, md, env, tokens) {\n this.src = src\n\n // link to parser instance\n this.md = md\n\n this.env = env\n\n //\n // Internal state vartiables\n //\n\n this.tokens = tokens\n\n this.bMarks = [] // line begin offsets for fast jumps\n this.eMarks = [] // line end offsets for fast jumps\n this.tShift = [] // offsets of the first non-space characters (tabs not expanded)\n this.sCount = [] // indents for each line (tabs expanded)\n\n // An amount of virtual spaces (tabs expanded) between beginning\n // of each line (bMarks) and real beginning of that line.\n //\n // It exists only as a hack because blockquotes override bMarks\n // losing information in the process.\n //\n // It's used only when expanding tabs, you can think about it as\n // an initial tab length, e.g. bsCount=21 applied to string `\\t123`\n // means first tab should be expanded to 4-21%4 === 3 spaces.\n //\n this.bsCount = []\n\n // block parser variables\n\n // required block content indent (for example, if we are\n // inside a list, it would be positioned after list marker)\n this.blkIndent = 0\n this.line = 0 // line index in src\n this.lineMax = 0 // lines count\n this.tight = false // loose/tight mode for lists\n this.ddIndent = -1 // indent of the current dd block (-1 if there isn't any)\n this.listIndent = -1 // indent of the current list block (-1 if there isn't any)\n\n // can be 'blockquote', 'list', 'root', 'paragraph' or 'reference'\n // used in lists to determine if they interrupt a paragraph\n this.parentType = 'root'\n\n this.level = 0\n\n // Create caches\n // Generate markers.\n const s = this.src\n\n for (let start = 0, pos = 0, indent = 0, offset = 0, len = s.length, indent_found = false; pos < len; pos++) {\n const ch = s.charCodeAt(pos)\n\n if (!indent_found) {\n if (isSpace(ch)) {\n indent++\n\n if (ch === 0x09) {\n offset += 4 - offset % 4\n } else {\n offset++\n }\n continue\n } else {\n indent_found = true\n }\n }\n\n if (ch === 0x0A || pos === len - 1) {\n if (ch !== 0x0A) { pos++ }\n this.bMarks.push(start)\n this.eMarks.push(pos)\n this.tShift.push(indent)\n this.sCount.push(offset)\n this.bsCount.push(0)\n\n indent_found = false\n indent = 0\n offset = 0\n start = pos + 1\n }\n }\n\n // Push fake entry to simplify cache bounds checks\n this.bMarks.push(s.length)\n this.eMarks.push(s.length)\n this.tShift.push(0)\n this.sCount.push(0)\n this.bsCount.push(0)\n\n this.lineMax = this.bMarks.length - 1 // don't count last fake line\n}\n\n// Push new token to \"stream\".\n//\nStateBlock.prototype.push = function (type, tag, nesting) {\n const token = new Token(type, tag, nesting)\n token.block = true\n\n if (nesting < 0) this.level-- // closing tag\n token.level = this.level\n if (nesting > 0) this.level++ // opening tag\n\n this.tokens.push(token)\n return token\n}\n\nStateBlock.prototype.isEmpty = function isEmpty (line) {\n return this.bMarks[line] + this.tShift[line] >= this.eMarks[line]\n}\n\nStateBlock.prototype.skipEmptyLines = function skipEmptyLines (from) {\n for (let max = this.lineMax; from < max; from++) {\n if (this.bMarks[from] + this.tShift[from] < this.eMarks[from]) {\n break\n }\n }\n return from\n}\n\n// Skip spaces from given position.\nStateBlock.prototype.skipSpaces = function skipSpaces (pos) {\n for (let max = this.src.length; pos < max; pos++) {\n const ch = this.src.charCodeAt(pos)\n if (!isSpace(ch)) { break }\n }\n return pos\n}\n\n// Skip spaces from given position in reverse.\nStateBlock.prototype.skipSpacesBack = function skipSpacesBack (pos, min) {\n if (pos <= min) { return pos }\n\n while (pos > min) {\n if (!isSpace(this.src.charCodeAt(--pos))) { return pos + 1 }\n }\n return pos\n}\n\n// Skip char codes from given position\nStateBlock.prototype.skipChars = function skipChars (pos, code) {\n for (let max = this.src.length; pos < max; pos++) {\n if (this.src.charCodeAt(pos) !== code) { break }\n }\n return pos\n}\n\n// Skip char codes reverse from given position - 1\nStateBlock.prototype.skipCharsBack = function skipCharsBack (pos, code, min) {\n if (pos <= min) { return pos }\n\n while (pos > min) {\n if (code !== this.src.charCodeAt(--pos)) { return pos + 1 }\n }\n return pos\n}\n\n// cut lines range from source.\nStateBlock.prototype.getLines = function getLines (begin, end, indent, keepLastLF) {\n if (begin >= end) {\n return ''\n }\n\n const queue = new Array(end - begin)\n\n for (let i = 0, line = begin; line < end; line++, i++) {\n let lineIndent = 0\n const lineStart = this.bMarks[line]\n let first = lineStart\n let last\n\n if (line + 1 < end || keepLastLF) {\n // No need for bounds check because we have fake entry on tail.\n last = this.eMarks[line] + 1\n } else {\n last = this.eMarks[line]\n }\n\n while (first < last && lineIndent < indent) {\n const ch = this.src.charCodeAt(first)\n\n if (isSpace(ch)) {\n if (ch === 0x09) {\n lineIndent += 4 - (lineIndent + this.bsCount[line]) % 4\n } else {\n lineIndent++\n }\n } else if (first - lineStart < this.tShift[line]) {\n // patched tShift masked characters to look like spaces (blockquotes, list markers)\n lineIndent++\n } else {\n break\n }\n\n first++\n }\n\n if (lineIndent > indent) {\n // partially expanding tabs in code blocks, e.g '\\t\\tfoobar'\n // with indent=2 becomes ' \\tfoobar'\n queue[i] = new Array(lineIndent - indent + 1).join(' ') + this.src.slice(first, last)\n } else {\n queue[i] = this.src.slice(first, last)\n }\n }\n\n return queue.join('')\n}\n\n// re-export Token class to use in block rules\nStateBlock.prototype.Token = Token\n\nexport default StateBlock\n", "// GFM table, https://github.github.com/gfm/#tables-extension-\n\nimport { isSpace } from '../common/utils.mjs'\n\n// Limit the amount of empty autocompleted cells in a table,\n// see https://github.com/markdown-it/markdown-it/issues/1000,\n//\n// Both pulldown-cmark and commonmark-hs limit the number of cells this way to ~200k.\n// We set it to 65k, which can expand user input by a factor of x370\n// (256x256 square is 1.8kB expanded into 650kB).\nconst MAX_AUTOCOMPLETED_CELLS = 0x10000\n\nfunction getLine (state, line) {\n const pos = state.bMarks[line] + state.tShift[line]\n const max = state.eMarks[line]\n\n return state.src.slice(pos, max)\n}\n\nfunction escapedSplit (str) {\n const result = []\n const max = str.length\n\n let pos = 0\n let ch = str.charCodeAt(pos)\n let isEscaped = false\n let lastPos = 0\n let current = ''\n\n while (pos < max) {\n if (ch === 0x7c/* | */) {\n if (!isEscaped) {\n // pipe separating cells, '|'\n result.push(current + str.substring(lastPos, pos))\n current = ''\n lastPos = pos + 1\n } else {\n // escaped pipe, '\\|'\n current += str.substring(lastPos, pos - 1)\n lastPos = pos\n }\n }\n\n isEscaped = (ch === 0x5c/* \\ */)\n pos++\n\n ch = str.charCodeAt(pos)\n }\n\n result.push(current + str.substring(lastPos))\n\n return result\n}\n\nexport default function table (state, startLine, endLine, silent) {\n // should have at least two lines\n if (startLine + 2 > endLine) { return false }\n\n let nextLine = startLine + 1\n\n if (state.sCount[nextLine] < state.blkIndent) { return false }\n\n // if it's indented more than 3 spaces, it should be a code block\n if (state.sCount[nextLine] - state.blkIndent >= 4) { return false }\n\n // first character of the second line should be '|', '-', ':',\n // and no other characters are allowed but spaces;\n // basically, this is the equivalent of /^[-:|][-:|\\s]*$/ regexp\n\n let pos = state.bMarks[nextLine] + state.tShift[nextLine]\n if (pos >= state.eMarks[nextLine]) { return false }\n\n const firstCh = state.src.charCodeAt(pos++)\n if (firstCh !== 0x7C/* | */ && firstCh !== 0x2D/* - */ && firstCh !== 0x3A/* : */) { return false }\n\n if (pos >= state.eMarks[nextLine]) { return false }\n\n const secondCh = state.src.charCodeAt(pos++)\n if (secondCh !== 0x7C/* | */ && secondCh !== 0x2D/* - */ && secondCh !== 0x3A/* : */ && !isSpace(secondCh)) {\n return false\n }\n\n // if first character is '-', then second character must not be a space\n // (due to parsing ambiguity with list)\n if (firstCh === 0x2D/* - */ && isSpace(secondCh)) { return false }\n\n while (pos < state.eMarks[nextLine]) {\n const ch = state.src.charCodeAt(pos)\n\n if (ch !== 0x7C/* | */ && ch !== 0x2D/* - */ && ch !== 0x3A/* : */ && !isSpace(ch)) { return false }\n\n pos++\n }\n\n let lineText = getLine(state, startLine + 1)\n let columns = lineText.split('|')\n const aligns = []\n for (let i = 0; i < columns.length; i++) {\n const t = columns[i].trim()\n if (!t) {\n // allow empty columns before and after table, but not in between columns;\n // e.g. allow ` |---| `, disallow ` ---||--- `\n if (i === 0 || i === columns.length - 1) {\n continue\n } else {\n return false\n }\n }\n\n if (!/^:?-+:?$/.test(t)) { return false }\n if (t.charCodeAt(t.length - 1) === 0x3A/* : */) {\n aligns.push(t.charCodeAt(0) === 0x3A/* : */ ? 'center' : 'right')\n } else if (t.charCodeAt(0) === 0x3A/* : */) {\n aligns.push('left')\n } else {\n aligns.push('')\n }\n }\n\n lineText = getLine(state, startLine).trim()\n if (lineText.indexOf('|') === -1) { return false }\n if (state.sCount[startLine] - state.blkIndent >= 4) { return false }\n columns = escapedSplit(lineText)\n if (columns.length && columns[0] === '') columns.shift()\n if (columns.length && columns[columns.length - 1] === '') columns.pop()\n\n // header row will define an amount of columns in the entire table,\n // and align row should be exactly the same (the rest of the rows can differ)\n const columnCount = columns.length\n if (columnCount === 0 || columnCount !== aligns.length) { return false }\n\n if (silent) { return true }\n\n const oldParentType = state.parentType\n state.parentType = 'table'\n\n // use 'blockquote' lists for termination because it's\n // the most similar to tables\n const terminatorRules = state.md.block.ruler.getRules('blockquote')\n\n const token_to = state.push('table_open', 'table', 1)\n const tableLines = [startLine, 0]\n token_to.map = tableLines\n\n const token_tho = state.push('thead_open', 'thead', 1)\n token_tho.map = [startLine, startLine + 1]\n\n const token_htro = state.push('tr_open', 'tr', 1)\n token_htro.map = [startLine, startLine + 1]\n\n for (let i = 0; i < columns.length; i++) {\n const token_ho = state.push('th_open', 'th', 1)\n if (aligns[i]) {\n token_ho.attrs = [['style', 'text-align:' + aligns[i]]]\n }\n\n const token_il = state.push('inline', '', 0)\n token_il.content = columns[i].trim()\n token_il.children = []\n\n state.push('th_close', 'th', -1)\n }\n\n state.push('tr_close', 'tr', -1)\n state.push('thead_close', 'thead', -1)\n\n let tbodyLines\n let autocompletedCells = 0\n\n for (nextLine = startLine + 2; nextLine < endLine; nextLine++) {\n if (state.sCount[nextLine] < state.blkIndent) { break }\n\n let terminate = false\n for (let i = 0, l = terminatorRules.length; i < l; i++) {\n if (terminatorRules[i](state, nextLine, endLine, true)) {\n terminate = true\n break\n }\n }\n\n if (terminate) { break }\n lineText = getLine(state, nextLine).trim()\n if (!lineText) { break }\n if (state.sCount[nextLine] - state.blkIndent >= 4) { break }\n columns = escapedSplit(lineText)\n if (columns.length && columns[0] === '') columns.shift()\n if (columns.length && columns[columns.length - 1] === '') columns.pop()\n\n // note: autocomplete count can be negative if user specifies more columns than header,\n // but that does not affect intended use (which is limiting expansion)\n autocompletedCells += columnCount - columns.length\n if (autocompletedCells > MAX_AUTOCOMPLETED_CELLS) { break }\n\n if (nextLine === startLine + 2) {\n const token_tbo = state.push('tbody_open', 'tbody', 1)\n token_tbo.map = tbodyLines = [startLine + 2, 0]\n }\n\n const token_tro = state.push('tr_open', 'tr', 1)\n token_tro.map = [nextLine, nextLine + 1]\n\n for (let i = 0; i < columnCount; i++) {\n const token_tdo = state.push('td_open', 'td', 1)\n if (aligns[i]) {\n token_tdo.attrs = [['style', 'text-align:' + aligns[i]]]\n }\n\n const token_il = state.push('inline', '', 0)\n token_il.content = columns[i] ? columns[i].trim() : ''\n token_il.children = []\n\n state.push('td_close', 'td', -1)\n }\n state.push('tr_close', 'tr', -1)\n }\n\n if (tbodyLines) {\n state.push('tbody_close', 'tbody', -1)\n tbodyLines[1] = nextLine\n }\n\n state.push('table_close', 'table', -1)\n tableLines[1] = nextLine\n\n state.parentType = oldParentType\n state.line = nextLine\n return true\n}\n", "// Code block (4 spaces padded)\n\nexport default function code (state, startLine, endLine/*, silent */) {\n if (state.sCount[startLine] - state.blkIndent < 4) { return false }\n\n let nextLine = startLine + 1\n let last = nextLine\n\n while (nextLine < endLine) {\n if (state.isEmpty(nextLine)) {\n nextLine++\n continue\n }\n\n if (state.sCount[nextLine] - state.blkIndent >= 4) {\n nextLine++\n last = nextLine\n continue\n }\n break\n }\n\n state.line = last\n\n const token = state.push('code_block', 'code', 0)\n token.content = state.getLines(startLine, last, 4 + state.blkIndent, false) + '\\n'\n token.map = [startLine, state.line]\n\n return true\n}\n", "// fences (``` lang, ~~~ lang)\n\nexport default function fence (state, startLine, endLine, silent) {\n let pos = state.bMarks[startLine] + state.tShift[startLine]\n let max = state.eMarks[startLine]\n\n // if it's indented more than 3 spaces, it should be a code block\n if (state.sCount[startLine] - state.blkIndent >= 4) { return false }\n\n if (pos + 3 > max) { return false }\n\n const marker = state.src.charCodeAt(pos)\n\n if (marker !== 0x7E/* ~ */ && marker !== 0x60 /* ` */) {\n return false\n }\n\n // scan marker length\n let mem = pos\n pos = state.skipChars(pos, marker)\n\n let len = pos - mem\n\n if (len < 3) { return false }\n\n const markup = state.src.slice(mem, pos)\n const params = state.src.slice(pos, max)\n\n if (marker === 0x60 /* ` */) {\n if (params.indexOf(String.fromCharCode(marker)) >= 0) {\n return false\n }\n }\n\n // Since start is found, we can report success here in validation mode\n if (silent) { return true }\n\n // search end of block\n let nextLine = startLine\n let haveEndMarker = false\n\n for (;;) {\n nextLine++\n if (nextLine >= endLine) {\n // unclosed block should be autoclosed by end of document.\n // also block seems to be autoclosed by end of parent\n break\n }\n\n pos = mem = state.bMarks[nextLine] + state.tShift[nextLine]\n max = state.eMarks[nextLine]\n\n if (pos < max && state.sCount[nextLine] < state.blkIndent) {\n // non-empty line with negative indent should stop the list:\n // - ```\n // test\n break\n }\n\n if (state.src.charCodeAt(pos) !== marker) { continue }\n\n if (state.sCount[nextLine] - state.blkIndent >= 4) {\n // closing fence should be indented less than 4 spaces\n continue\n }\n\n pos = state.skipChars(pos, marker)\n\n // closing code fence must be at least as long as the opening one\n if (pos - mem < len) { continue }\n\n // make sure tail has spaces only\n pos = state.skipSpaces(pos)\n\n if (pos < max) { continue }\n\n haveEndMarker = true\n // found!\n break\n }\n\n // If a fence has heading spaces, they should be removed from its inner block\n len = state.sCount[startLine]\n\n state.line = nextLine + (haveEndMarker ? 1 : 0)\n\n const token = state.push('fence', 'code', 0)\n token.info = params\n token.content = state.getLines(startLine + 1, nextLine, len, true)\n token.markup = markup\n token.map = [startLine, state.line]\n\n return true\n}\n", "// Block quotes\n\nimport { isSpace } from '../common/utils.mjs'\n\nexport default function blockquote (state, startLine, endLine, silent) {\n let pos = state.bMarks[startLine] + state.tShift[startLine]\n let max = state.eMarks[startLine]\n\n const oldLineMax = state.lineMax\n\n // if it's indented more than 3 spaces, it should be a code block\n if (state.sCount[startLine] - state.blkIndent >= 4) { return false }\n\n // check the block quote marker\n if (state.src.charCodeAt(pos) !== 0x3E/* > */) { return false }\n\n // we know that it's going to be a valid blockquote,\n // so no point trying to find the end of it in silent mode\n if (silent) { return true }\n\n const oldBMarks = []\n const oldBSCount = []\n const oldSCount = []\n const oldTShift = []\n\n const terminatorRules = state.md.block.ruler.getRules('blockquote')\n\n const oldParentType = state.parentType\n state.parentType = 'blockquote'\n let lastLineEmpty = false\n let nextLine\n\n // Search the end of the block\n //\n // Block ends with either:\n // 1. an empty line outside:\n // ```\n // > test\n //\n // ```\n // 2. an empty line inside:\n // ```\n // >\n // test\n // ```\n // 3. another tag:\n // ```\n // > test\n // - - -\n // ```\n for (nextLine = startLine; nextLine < endLine; nextLine++) {\n // check if it's outdented, i.e. it's inside list item and indented\n // less than said list item:\n //\n // ```\n // 1. anything\n // > current blockquote\n // 2. checking this line\n // ```\n const isOutdented = state.sCount[nextLine] < state.blkIndent\n\n pos = state.bMarks[nextLine] + state.tShift[nextLine]\n max = state.eMarks[nextLine]\n\n if (pos >= max) {\n // Case 1: line is not inside the blockquote, and this line is empty.\n break\n }\n\n if (state.src.charCodeAt(pos++) === 0x3E/* > */ && !isOutdented) {\n // This line is inside the blockquote.\n\n // set offset past spaces and \">\"\n let initial = state.sCount[nextLine] + 1\n let spaceAfterMarker\n let adjustTab\n\n // skip one optional space after '>'\n if (state.src.charCodeAt(pos) === 0x20 /* space */) {\n // ' > test '\n // ^ -- position start of line here:\n pos++\n initial++\n adjustTab = false\n spaceAfterMarker = true\n } else if (state.src.charCodeAt(pos) === 0x09 /* tab */) {\n spaceAfterMarker = true\n\n if ((state.bsCount[nextLine] + initial) % 4 === 3) {\n // ' >\\t test '\n // ^ -- position start of line here (tab has width===1)\n pos++\n initial++\n adjustTab = false\n } else {\n // ' >\\t test '\n // ^ -- position start of line here + shift bsCount slightly\n // to make extra space appear\n adjustTab = true\n }\n } else {\n spaceAfterMarker = false\n }\n\n let offset = initial\n oldBMarks.push(state.bMarks[nextLine])\n state.bMarks[nextLine] = pos\n\n while (pos < max) {\n const ch = state.src.charCodeAt(pos)\n\n if (isSpace(ch)) {\n if (ch === 0x09) {\n offset += 4 - (offset + state.bsCount[nextLine] + (adjustTab ? 1 : 0)) % 4\n } else {\n offset++\n }\n } else {\n break\n }\n\n pos++\n }\n\n lastLineEmpty = pos >= max\n\n oldBSCount.push(state.bsCount[nextLine])\n state.bsCount[nextLine] = state.sCount[nextLine] + 1 + (spaceAfterMarker ? 1 : 0)\n\n oldSCount.push(state.sCount[nextLine])\n state.sCount[nextLine] = offset - initial\n\n oldTShift.push(state.tShift[nextLine])\n state.tShift[nextLine] = pos - state.bMarks[nextLine]\n continue\n }\n\n // Case 2: line is not inside the blockquote, and the last line was empty.\n if (lastLineEmpty) { break }\n\n // Case 3: another tag found.\n let terminate = false\n for (let i = 0, l = terminatorRules.length; i < l; i++) {\n if (terminatorRules[i](state, nextLine, endLine, true)) {\n terminate = true\n break\n }\n }\n\n if (terminate) {\n // Quirk to enforce \"hard termination mode\" for paragraphs;\n // normally if you call `tokenize(state, startLine, nextLine)`,\n // paragraphs will look below nextLine for paragraph continuation,\n // but if blockquote is terminated by another tag, they shouldn't\n state.lineMax = nextLine\n\n if (state.blkIndent !== 0) {\n // state.blkIndent was non-zero, we now set it to zero,\n // so we need to re-calculate all offsets to appear as\n // if indent wasn't changed\n oldBMarks.push(state.bMarks[nextLine])\n oldBSCount.push(state.bsCount[nextLine])\n oldTShift.push(state.tShift[nextLine])\n oldSCount.push(state.sCount[nextLine])\n state.sCount[nextLine] -= state.blkIndent\n }\n\n break\n }\n\n oldBMarks.push(state.bMarks[nextLine])\n oldBSCount.push(state.bsCount[nextLine])\n oldTShift.push(state.tShift[nextLine])\n oldSCount.push(state.sCount[nextLine])\n\n // A negative indentation means that this is a paragraph continuation\n //\n state.sCount[nextLine] = -1\n }\n\n const oldIndent = state.blkIndent\n state.blkIndent = 0\n\n const token_o = state.push('blockquote_open', 'blockquote', 1)\n token_o.markup = '>'\n const lines = [startLine, 0]\n token_o.map = lines\n\n state.md.block.tokenize(state, startLine, nextLine)\n\n const token_c = state.push('blockquote_close', 'blockquote', -1)\n token_c.markup = '>'\n\n state.lineMax = oldLineMax\n state.parentType = oldParentType\n lines[1] = state.line\n\n // Restore original tShift; this might not be necessary since the parser\n // has already been here, but just to make sure we can do that.\n for (let i = 0; i < oldTShift.length; i++) {\n state.bMarks[i + startLine] = oldBMarks[i]\n state.tShift[i + startLine] = oldTShift[i]\n state.sCount[i + startLine] = oldSCount[i]\n state.bsCount[i + startLine] = oldBSCount[i]\n }\n state.blkIndent = oldIndent\n\n return true\n}\n", "// Horizontal rule\n\nimport { isSpace } from '../common/utils.mjs'\n\nexport default function hr (state, startLine, endLine, silent) {\n const max = state.eMarks[startLine]\n // if it's indented more than 3 spaces, it should be a code block\n if (state.sCount[startLine] - state.blkIndent >= 4) { return false }\n\n let pos = state.bMarks[startLine] + state.tShift[startLine]\n const marker = state.src.charCodeAt(pos++)\n\n // Check hr marker\n if (marker !== 0x2A/* * */ &&\n marker !== 0x2D/* - */ &&\n marker !== 0x5F/* _ */) {\n return false\n }\n\n // markers can be mixed with spaces, but there should be at least 3 of them\n\n let cnt = 1\n while (pos < max) {\n const ch = state.src.charCodeAt(pos++)\n if (ch !== marker && !isSpace(ch)) { return false }\n if (ch === marker) { cnt++ }\n }\n\n if (cnt < 3) { return false }\n\n if (silent) { return true }\n\n state.line = startLine + 1\n\n const token = state.push('hr', 'hr', 0)\n token.map = [startLine, state.line]\n token.markup = Array(cnt + 1).join(String.fromCharCode(marker))\n\n return true\n}\n", "// Lists\n\nimport { isSpace } from '../common/utils.mjs'\n\n// Search `[-+*][\\n ]`, returns next pos after marker on success\n// or -1 on fail.\nfunction skipBulletListMarker (state, startLine) {\n const max = state.eMarks[startLine]\n let pos = state.bMarks[startLine] + state.tShift[startLine]\n\n const marker = state.src.charCodeAt(pos++)\n // Check bullet\n if (marker !== 0x2A/* * */ &&\n marker !== 0x2D/* - */ &&\n marker !== 0x2B/* + */) {\n return -1\n }\n\n if (pos < max) {\n const ch = state.src.charCodeAt(pos)\n\n if (!isSpace(ch)) {\n // \" -test \" - is not a list item\n return -1\n }\n }\n\n return pos\n}\n\n// Search `\\d+[.)][\\n ]`, returns next pos after marker on success\n// or -1 on fail.\nfunction skipOrderedListMarker (state, startLine) {\n const start = state.bMarks[startLine] + state.tShift[startLine]\n const max = state.eMarks[startLine]\n let pos = start\n\n // List marker should have at least 2 chars (digit + dot)\n if (pos + 1 >= max) { return -1 }\n\n let ch = state.src.charCodeAt(pos++)\n\n if (ch < 0x30/* 0 */ || ch > 0x39/* 9 */) { return -1 }\n\n for (;;) {\n // EOL -> fail\n if (pos >= max) { return -1 }\n\n ch = state.src.charCodeAt(pos++)\n\n if (ch >= 0x30/* 0 */ && ch <= 0x39/* 9 */) {\n // List marker should have no more than 9 digits\n // (prevents integer overflow in browsers)\n if (pos - start >= 10) { return -1 }\n\n continue\n }\n\n // found valid marker\n if (ch === 0x29/* ) */ || ch === 0x2e/* . */) {\n break\n }\n\n return -1\n }\n\n if (pos < max) {\n ch = state.src.charCodeAt(pos)\n\n if (!isSpace(ch)) {\n // \" 1.test \" - is not a list item\n return -1\n }\n }\n return pos\n}\n\nfunction markTightParagraphs (state, idx) {\n const level = state.level + 2\n\n for (let i = idx + 2, l = state.tokens.length - 2; i < l; i++) {\n if (state.tokens[i].level === level && state.tokens[i].type === 'paragraph_open') {\n state.tokens[i + 2].hidden = true\n state.tokens[i].hidden = true\n i += 2\n }\n }\n}\n\nexport default function list (state, startLine, endLine, silent) {\n let max, pos, start, token\n let nextLine = startLine\n let tight = true\n\n // if it's indented more than 3 spaces, it should be a code block\n if (state.sCount[nextLine] - state.blkIndent >= 4) { return false }\n\n // Special case:\n // - item 1\n // - item 2\n // - item 3\n // - item 4\n // - this one is a paragraph continuation\n if (state.listIndent >= 0 &&\n state.sCount[nextLine] - state.listIndent >= 4 &&\n state.sCount[nextLine] < state.blkIndent) {\n return false\n }\n\n let isTerminatingParagraph = false\n\n // limit conditions when list can interrupt\n // a paragraph (validation mode only)\n if (silent && state.parentType === 'paragraph') {\n // Next list item should still terminate previous list item;\n //\n // This code can fail if plugins use blkIndent as well as lists,\n // but I hope the spec gets fixed long before that happens.\n //\n if (state.sCount[nextLine] >= state.blkIndent) {\n isTerminatingParagraph = true\n }\n }\n\n // Detect list type and position after marker\n let isOrdered\n let markerValue\n let posAfterMarker\n if ((posAfterMarker = skipOrderedListMarker(state, nextLine)) >= 0) {\n isOrdered = true\n start = state.bMarks[nextLine] + state.tShift[nextLine]\n markerValue = Number(state.src.slice(start, posAfterMarker - 1))\n\n // If we're starting a new ordered list right after\n // a paragraph, it should start with 1.\n if (isTerminatingParagraph && markerValue !== 1) return false\n } else if ((posAfterMarker = skipBulletListMarker(state, nextLine)) >= 0) {\n isOrdered = false\n } else {\n return false\n }\n\n // If we're starting a new unordered list right after\n // a paragraph, first line should not be empty.\n if (isTerminatingParagraph) {\n if (state.skipSpaces(posAfterMarker) >= state.eMarks[nextLine]) return false\n }\n\n // For validation mode we can terminate immediately\n if (silent) { return true }\n\n // We should terminate list on style change. Remember first one to compare.\n const markerCharCode = state.src.charCodeAt(posAfterMarker - 1)\n\n // Start list\n const listTokIdx = state.tokens.length\n\n if (isOrdered) {\n token = state.push('ordered_list_open', 'ol', 1)\n if (markerValue !== 1) {\n token.attrs = [['start', markerValue]]\n }\n } else {\n token = state.push('bullet_list_open', 'ul', 1)\n }\n\n const listLines = [nextLine, 0]\n token.map = listLines\n token.markup = String.fromCharCode(markerCharCode)\n\n //\n // Iterate list items\n //\n\n let prevEmptyEnd = false\n const terminatorRules = state.md.block.ruler.getRules('list')\n\n const oldParentType = state.parentType\n state.parentType = 'list'\n\n while (nextLine < endLine) {\n pos = posAfterMarker\n max = state.eMarks[nextLine]\n\n const initial = state.sCount[nextLine] + posAfterMarker - (state.bMarks[nextLine] + state.tShift[nextLine])\n let offset = initial\n\n while (pos < max) {\n const ch = state.src.charCodeAt(pos)\n\n if (ch === 0x09) {\n offset += 4 - (offset + state.bsCount[nextLine]) % 4\n } else if (ch === 0x20) {\n offset++\n } else {\n break\n }\n\n pos++\n }\n\n const contentStart = pos\n let indentAfterMarker\n\n if (contentStart >= max) {\n // trimming space in \"- \\n 3\" case, indent is 1 here\n indentAfterMarker = 1\n } else {\n indentAfterMarker = offset - initial\n }\n\n // If we have more than 4 spaces, the indent is 1\n // (the rest is just indented code block)\n if (indentAfterMarker > 4) { indentAfterMarker = 1 }\n\n // \" - test\"\n // ^^^^^ - calculating total length of this thing\n const indent = initial + indentAfterMarker\n\n // Run subparser & write tokens\n token = state.push('list_item_open', 'li', 1)\n token.markup = String.fromCharCode(markerCharCode)\n const itemLines = [nextLine, 0]\n token.map = itemLines\n if (isOrdered) {\n token.info = state.src.slice(start, posAfterMarker - 1)\n }\n\n // change current state, then restore it after parser subcall\n const oldTight = state.tight\n const oldTShift = state.tShift[nextLine]\n const oldSCount = state.sCount[nextLine]\n\n // - example list\n // ^ listIndent position will be here\n // ^ blkIndent position will be here\n //\n const oldListIndent = state.listIndent\n state.listIndent = state.blkIndent\n state.blkIndent = indent\n\n state.tight = true\n state.tShift[nextLine] = contentStart - state.bMarks[nextLine]\n state.sCount[nextLine] = offset\n\n if (contentStart >= max && state.isEmpty(nextLine + 1)) {\n // workaround for this case\n // (list item is empty, list terminates before \"foo\"):\n // ~~~~~~~~\n // -\n //\n // foo\n // ~~~~~~~~\n state.line = Math.min(state.line + 2, endLine)\n } else {\n state.md.block.tokenize(state, nextLine, endLine, true)\n }\n\n // If any of list item is tight, mark list as tight\n if (!state.tight || prevEmptyEnd) {\n tight = false\n }\n // Item become loose if finish with empty line,\n // but we should filter last element, because it means list finish\n prevEmptyEnd = (state.line - nextLine) > 1 && state.isEmpty(state.line - 1)\n\n state.blkIndent = state.listIndent\n state.listIndent = oldListIndent\n state.tShift[nextLine] = oldTShift\n state.sCount[nextLine] = oldSCount\n state.tight = oldTight\n\n token = state.push('list_item_close', 'li', -1)\n token.markup = String.fromCharCode(markerCharCode)\n\n nextLine = state.line\n itemLines[1] = nextLine\n\n if (nextLine >= endLine) { break }\n\n //\n // Try to check if list is terminated or continued.\n //\n if (state.sCount[nextLine] < state.blkIndent) { break }\n\n // if it's indented more than 3 spaces, it should be a code block\n if (state.sCount[nextLine] - state.blkIndent >= 4) { break }\n\n // fail if terminating block found\n let terminate = false\n for (let i = 0, l = terminatorRules.length; i < l; i++) {\n if (terminatorRules[i](state, nextLine, endLine, true)) {\n terminate = true\n break\n }\n }\n if (terminate) { break }\n\n // fail if list has another type\n if (isOrdered) {\n posAfterMarker = skipOrderedListMarker(state, nextLine)\n if (posAfterMarker < 0) { break }\n start = state.bMarks[nextLine] + state.tShift[nextLine]\n } else {\n posAfterMarker = skipBulletListMarker(state, nextLine)\n if (posAfterMarker < 0) { break }\n }\n\n if (markerCharCode !== state.src.charCodeAt(posAfterMarker - 1)) { break }\n }\n\n // Finalize list\n if (isOrdered) {\n token = state.push('ordered_list_close', 'ol', -1)\n } else {\n token = state.push('bullet_list_close', 'ul', -1)\n }\n token.markup = String.fromCharCode(markerCharCode)\n\n listLines[1] = nextLine\n state.line = nextLine\n\n state.parentType = oldParentType\n\n // mark paragraphs tight if needed\n if (tight) {\n markTightParagraphs(state, listTokIdx)\n }\n\n return true\n}\n", "import { isSpace, normalizeReference } from '../common/utils.mjs'\n\nexport default function reference (state, startLine, _endLine, silent) {\n let pos = state.bMarks[startLine] + state.tShift[startLine]\n let max = state.eMarks[startLine]\n let nextLine = startLine + 1\n\n // if it's indented more than 3 spaces, it should be a code block\n if (state.sCount[startLine] - state.blkIndent >= 4) { return false }\n\n if (state.src.charCodeAt(pos) !== 0x5B/* [ */) { return false }\n\n function getNextLine (nextLine) {\n const endLine = state.lineMax\n\n if (nextLine >= endLine || state.isEmpty(nextLine)) {\n // empty line or end of input\n return null\n }\n\n let isContinuation = false\n\n // this would be a code block normally, but after paragraph\n // it's considered a lazy continuation regardless of what's there\n if (state.sCount[nextLine] - state.blkIndent > 3) { isContinuation = true }\n\n // quirk for blockquotes, this line should already be checked by that rule\n if (state.sCount[nextLine] < 0) { isContinuation = true }\n\n if (!isContinuation) {\n const terminatorRules = state.md.block.ruler.getRules('reference')\n const oldParentType = state.parentType\n state.parentType = 'reference'\n\n // Some tags can terminate paragraph without empty line.\n let terminate = false\n for (let i = 0, l = terminatorRules.length; i < l; i++) {\n if (terminatorRules[i](state, nextLine, endLine, true)) {\n terminate = true\n break\n }\n }\n\n state.parentType = oldParentType\n if (terminate) {\n // terminated by another block\n return null\n }\n }\n\n const pos = state.bMarks[nextLine] + state.tShift[nextLine]\n const max = state.eMarks[nextLine]\n\n // max + 1 explicitly includes the newline\n return state.src.slice(pos, max + 1)\n }\n\n let str = state.src.slice(pos, max + 1)\n\n max = str.length\n let labelEnd = -1\n\n for (pos = 1; pos < max; pos++) {\n const ch = str.charCodeAt(pos)\n if (ch === 0x5B /* [ */) {\n return false\n } else if (ch === 0x5D /* ] */) {\n labelEnd = pos\n break\n } else if (ch === 0x0A /* \\n */) {\n const lineContent = getNextLine(nextLine)\n if (lineContent !== null) {\n str += lineContent\n max = str.length\n nextLine++\n }\n } else if (ch === 0x5C /* \\ */) {\n pos++\n if (pos < max && str.charCodeAt(pos) === 0x0A) {\n const lineContent = getNextLine(nextLine)\n if (lineContent !== null) {\n str += lineContent\n max = str.length\n nextLine++\n }\n }\n }\n }\n\n if (labelEnd < 0 || str.charCodeAt(labelEnd + 1) !== 0x3A/* : */) { return false }\n\n // [label]: destination 'title'\n // ^^^ skip optional whitespace here\n for (pos = labelEnd + 2; pos < max; pos++) {\n const ch = str.charCodeAt(pos)\n if (ch === 0x0A) {\n const lineContent = getNextLine(nextLine)\n if (lineContent !== null) {\n str += lineContent\n max = str.length\n nextLine++\n }\n } else if (isSpace(ch)) {\n /* eslint no-empty:0 */\n } else {\n break\n }\n }\n\n // [label]: destination 'title'\n // ^^^^^^^^^^^ parse this\n const destRes = state.md.helpers.parseLinkDestination(str, pos, max)\n if (!destRes.ok) { return false }\n\n const href = state.md.normalizeLink(destRes.str)\n if (!state.md.validateLink(href)) { return false }\n\n pos = destRes.pos\n\n // save cursor state, we could require to rollback later\n const destEndPos = pos\n const destEndLineNo = nextLine\n\n // [label]: destination 'title'\n // ^^^ skipping those spaces\n const start = pos\n for (; pos < max; pos++) {\n const ch = str.charCodeAt(pos)\n if (ch === 0x0A) {\n const lineContent = getNextLine(nextLine)\n if (lineContent !== null) {\n str += lineContent\n max = str.length\n nextLine++\n }\n } else if (isSpace(ch)) {\n /* eslint no-empty:0 */\n } else {\n break\n }\n }\n\n // [label]: destination 'title'\n // ^^^^^^^ parse this\n let titleRes = state.md.helpers.parseLinkTitle(str, pos, max)\n while (titleRes.can_continue) {\n const lineContent = getNextLine(nextLine)\n if (lineContent === null) break\n str += lineContent\n pos = max\n max = str.length\n nextLine++\n titleRes = state.md.helpers.parseLinkTitle(str, pos, max, titleRes)\n }\n let title\n\n if (pos < max && start !== pos && titleRes.ok) {\n title = titleRes.str\n pos = titleRes.pos\n } else {\n title = ''\n pos = destEndPos\n nextLine = destEndLineNo\n }\n\n // skip trailing spaces until the rest of the line\n while (pos < max) {\n const ch = str.charCodeAt(pos)\n if (!isSpace(ch)) { break }\n pos++\n }\n\n if (pos < max && str.charCodeAt(pos) !== 0x0A) {\n if (title) {\n // garbage at the end of the line after title,\n // but it could still be a valid reference if we roll back\n title = ''\n pos = destEndPos\n nextLine = destEndLineNo\n while (pos < max) {\n const ch = str.charCodeAt(pos)\n if (!isSpace(ch)) { break }\n pos++\n }\n }\n }\n\n if (pos < max && str.charCodeAt(pos) !== 0x0A) {\n // garbage at the end of the line\n return false\n }\n\n const label = normalizeReference(str.slice(1, labelEnd))\n if (!label) {\n // CommonMark 0.20 disallows empty labels\n return false\n }\n\n // Reference can not terminate anything. This check is for safety only.\n /* istanbul ignore if */\n if (silent) { return true }\n\n if (typeof state.env.references === 'undefined') {\n state.env.references = {}\n }\n if (typeof state.env.references[label] === 'undefined') {\n state.env.references[label] = { title, href }\n }\n\n state.line = nextLine\n return true\n}\n", "// List of valid html blocks names, according to commonmark spec\n// https://spec.commonmark.org/0.30/#html-blocks\n\nexport default [\n 'address',\n 'article',\n 'aside',\n 'base',\n 'basefont',\n 'blockquote',\n 'body',\n 'caption',\n 'center',\n 'col',\n 'colgroup',\n 'dd',\n 'details',\n 'dialog',\n 'dir',\n 'div',\n 'dl',\n 'dt',\n 'fieldset',\n 'figcaption',\n 'figure',\n 'footer',\n 'form',\n 'frame',\n 'frameset',\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n 'head',\n 'header',\n 'hr',\n 'html',\n 'iframe',\n 'legend',\n 'li',\n 'link',\n 'main',\n 'menu',\n 'menuitem',\n 'nav',\n 'noframes',\n 'ol',\n 'optgroup',\n 'option',\n 'p',\n 'param',\n 'search',\n 'section',\n 'summary',\n 'table',\n 'tbody',\n 'td',\n 'tfoot',\n 'th',\n 'thead',\n 'title',\n 'tr',\n 'track',\n 'ul'\n]\n", "// Regexps to match html elements\n\nconst attr_name = '[a-zA-Z_:][a-zA-Z0-9:._-]*'\n\nconst unquoted = '[^\"\\'=<>`\\\\x00-\\\\x20]+'\nconst single_quoted = \"'[^']*'\"\nconst double_quoted = '\"[^\"]*\"'\n\nconst attr_value = '(?:' + unquoted + '|' + single_quoted + '|' + double_quoted + ')'\n\nconst attribute = '(?:\\\\s+' + attr_name + '(?:\\\\s*=\\\\s*' + attr_value + ')?)'\n\nconst open_tag = '<[A-Za-z][A-Za-z0-9\\\\-]*' + attribute + '*\\\\s*\\\\/?>'\n\nconst close_tag = '<\\\\/[A-Za-z][A-Za-z0-9\\\\-]*\\\\s*>'\nconst comment = '<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->'\nconst processing = '<[?][\\\\s\\\\S]*?[?]>'\nconst declaration = '<![A-Za-z][^>]*>'\nconst cdata = '<!\\\\[CDATA\\\\[[\\\\s\\\\S]*?\\\\]\\\\]>'\n\nconst HTML_TAG_RE = new RegExp('^(?:' + open_tag + '|' + close_tag + '|' + comment +\n '|' + processing + '|' + declaration + '|' + cdata + ')')\nconst HTML_OPEN_CLOSE_TAG_RE = new RegExp('^(?:' + open_tag + '|' + close_tag + ')')\n\nexport { HTML_TAG_RE, HTML_OPEN_CLOSE_TAG_RE }\n", "// HTML block\n\nimport block_names from '../common/html_blocks.mjs'\nimport { HTML_OPEN_CLOSE_TAG_RE } from '../common/html_re.mjs'\n\n// An array of opening and corresponding closing sequences for html tags,\n// last argument defines whether it can terminate a paragraph or not\n//\nconst HTML_SEQUENCES = [\n [/^<(script|pre|style|textarea)(?=(\\s|>|$))/i, /<\\/(script|pre|style|textarea)>/i, true],\n [/^<!--/, /-->/, true],\n [/^<\\?/, /\\?>/, true],\n [/^<![A-Z]/, />/, true],\n [/^<!\\[CDATA\\[/, /\\]\\]>/, true],\n [new RegExp('^</?(' + block_names.join('|') + ')(?=(\\\\s|/?>|$))', 'i'), /^$/, true],\n [new RegExp(HTML_OPEN_CLOSE_TAG_RE.source + '\\\\s*$'), /^$/, false]\n]\n\nexport default function html_block (state, startLine, endLine, silent) {\n let pos = state.bMarks[startLine] + state.tShift[startLine]\n let max = state.eMarks[startLine]\n\n // if it's indented more than 3 spaces, it should be a code block\n if (state.sCount[startLine] - state.blkIndent >= 4) { return false }\n\n if (!state.md.options.html) { return false }\n\n if (state.src.charCodeAt(pos) !== 0x3C/* < */) { return false }\n\n let lineText = state.src.slice(pos, max)\n\n let i = 0\n for (; i < HTML_SEQUENCES.length; i++) {\n if (HTML_SEQUENCES[i][0].test(lineText)) { break }\n }\n if (i === HTML_SEQUENCES.length) { return false }\n\n if (silent) {\n // true if this sequence can be a terminator, false otherwise\n return HTML_SEQUENCES[i][2]\n }\n\n let nextLine = startLine + 1\n\n // If we are here - we detected HTML block.\n // Let's roll down till block end.\n if (!HTML_SEQUENCES[i][1].test(lineText)) {\n for (; nextLine < endLine; nextLine++) {\n if (state.sCount[nextLine] < state.blkIndent) { break }\n\n pos = state.bMarks[nextLine] + state.tShift[nextLine]\n max = state.eMarks[nextLine]\n lineText = state.src.slice(pos, max)\n\n if (HTML_SEQUENCES[i][1].test(lineText)) {\n if (lineText.length !== 0) { nextLine++ }\n break\n }\n }\n }\n\n state.line = nextLine\n\n const token = state.push('html_block', '', 0)\n token.map = [startLine, nextLine]\n token.content = state.getLines(startLine, nextLine, state.blkIndent, true)\n\n return true\n}\n", "// heading (#, ##, ...)\n\nimport { isSpace } from '../common/utils.mjs'\n\nexport default function heading (state, startLine, endLine, silent) {\n let pos = state.bMarks[startLine] + state.tShift[startLine]\n let max = state.eMarks[startLine]\n\n // if it's indented more than 3 spaces, it should be a code block\n if (state.sCount[startLine] - state.blkIndent >= 4) { return false }\n\n let ch = state.src.charCodeAt(pos)\n\n if (ch !== 0x23/* # */ || pos >= max) { return false }\n\n // count heading level\n let level = 1\n ch = state.src.charCodeAt(++pos)\n while (ch === 0x23/* # */ && pos < max && level <= 6) {\n level++\n ch = state.src.charCodeAt(++pos)\n }\n\n if (level > 6 || (pos < max && !isSpace(ch))) { return false }\n\n if (silent) { return true }\n\n // Let's cut tails like ' ### ' from the end of string\n\n max = state.skipSpacesBack(max, pos)\n const tmp = state.skipCharsBack(max, 0x23, pos) // #\n if (tmp > pos && isSpace(state.src.charCodeAt(tmp - 1))) {\n max = tmp\n }\n\n state.line = startLine + 1\n\n const token_o = state.push('heading_open', 'h' + String(level), 1)\n token_o.markup = '########'.slice(0, level)\n token_o.map = [startLine, state.line]\n\n const token_i = state.push('inline', '', 0)\n token_i.content = state.src.slice(pos, max).trim()\n token_i.map = [startLine, state.line]\n token_i.children = []\n\n const token_c = state.push('heading_close', 'h' + String(level), -1)\n token_c.markup = '########'.slice(0, level)\n\n return true\n}\n", "// lheading (---, ===)\n\nexport default function lheading (state, startLine, endLine/*, silent */) {\n const terminatorRules = state.md.block.ruler.getRules('paragraph')\n\n // if it's indented more than 3 spaces, it should be a code block\n if (state.sCount[startLine] - state.blkIndent >= 4) { return false }\n\n const oldParentType = state.parentType\n state.parentType = 'paragraph' // use paragraph to match terminatorRules\n\n // jump line-by-line until empty one or EOF\n let level = 0\n let marker\n let nextLine = startLine + 1\n\n for (; nextLine < endLine && !state.isEmpty(nextLine); nextLine++) {\n // this would be a code block normally, but after paragraph\n // it's considered a lazy continuation regardless of what's there\n if (state.sCount[nextLine] - state.blkIndent > 3) { continue }\n\n //\n // Check for underline in setext header\n //\n if (state.sCount[nextLine] >= state.blkIndent) {\n let pos = state.bMarks[nextLine] + state.tShift[nextLine]\n const max = state.eMarks[nextLine]\n\n if (pos < max) {\n marker = state.src.charCodeAt(pos)\n\n if (marker === 0x2D/* - */ || marker === 0x3D/* = */) {\n pos = state.skipChars(pos, marker)\n pos = state.skipSpaces(pos)\n\n if (pos >= max) {\n level = (marker === 0x3D/* = */ ? 1 : 2)\n break\n }\n }\n }\n }\n\n // quirk for blockquotes, this line should already be checked by that rule\n if (state.sCount[nextLine] < 0) { continue }\n\n // Some tags can terminate paragraph without empty line.\n let terminate = false\n for (let i = 0, l = terminatorRules.length; i < l; i++) {\n if (terminatorRules[i](state, nextLine, endLine, true)) {\n terminate = true\n break\n }\n }\n if (terminate) { break }\n }\n\n if (!level) {\n // Didn't find valid underline\n return false\n }\n\n const content = state.getLines(startLine, nextLine, state.blkIndent, false).trim()\n\n state.line = nextLine + 1\n\n const token_o = state.push('heading_open', 'h' + String(level), 1)\n token_o.markup = String.fromCharCode(marker)\n token_o.map = [startLine, state.line]\n\n const token_i = state.push('inline', '', 0)\n token_i.content = content\n token_i.map = [startLine, state.line - 1]\n token_i.children = []\n\n const token_c = state.push('heading_close', 'h' + String(level), -1)\n token_c.markup = String.fromCharCode(marker)\n\n state.parentType = oldParentType\n\n return true\n}\n", "// Paragraph\n\nexport default function paragraph (state, startLine, endLine) {\n const terminatorRules = state.md.block.ruler.getRules('paragraph')\n const oldParentType = state.parentType\n let nextLine = startLine + 1\n state.parentType = 'paragraph'\n\n // jump line-by-line until empty one or EOF\n for (; nextLine < endLine && !state.isEmpty(nextLine); nextLine++) {\n // this would be a code block normally, but after paragraph\n // it's considered a lazy continuation regardless of what's there\n if (state.sCount[nextLine] - state.blkIndent > 3) { continue }\n\n // quirk for blockquotes, this line should already be checked by that rule\n if (state.sCount[nextLine] < 0) { continue }\n\n // Some tags can terminate paragraph without empty line.\n let terminate = false\n for (let i = 0, l = terminatorRules.length; i < l; i++) {\n if (terminatorRules[i](state, nextLine, endLine, true)) {\n terminate = true\n break\n }\n }\n if (terminate) { break }\n }\n\n const content = state.getLines(startLine, nextLine, state.blkIndent, false).trim()\n\n state.line = nextLine\n\n const token_o = state.push('paragraph_open', 'p', 1)\n token_o.map = [startLine, state.line]\n\n const token_i = state.push('inline', '', 0)\n token_i.content = content\n token_i.map = [startLine, state.line]\n token_i.children = []\n\n state.push('paragraph_close', 'p', -1)\n\n state.parentType = oldParentType\n\n return true\n}\n", "/** internal\n * class ParserBlock\n *\n * Block-level tokenizer.\n **/\n\nimport Ruler from './ruler.mjs'\nimport StateBlock from './rules_block/state_block.mjs'\n\nimport r_table from './rules_block/table.mjs'\nimport r_code from './rules_block/code.mjs'\nimport r_fence from './rules_block/fence.mjs'\nimport r_blockquote from './rules_block/blockquote.mjs'\nimport r_hr from './rules_block/hr.mjs'\nimport r_list from './rules_block/list.mjs'\nimport r_reference from './rules_block/reference.mjs'\nimport r_html_block from './rules_block/html_block.mjs'\nimport r_heading from './rules_block/heading.mjs'\nimport r_lheading from './rules_block/lheading.mjs'\nimport r_paragraph from './rules_block/paragraph.mjs'\n\nconst _rules = [\n // First 2 params - rule name & source. Secondary array - list of rules,\n // which can be terminated by this one.\n ['table', r_table, ['paragraph', 'reference']],\n ['code', r_code],\n ['fence', r_fence, ['paragraph', 'reference', 'blockquote', 'list']],\n ['blockquote', r_blockquote, ['paragraph', 'reference', 'blockquote', 'list']],\n ['hr', r_hr, ['paragraph', 'reference', 'blockquote', 'list']],\n ['list', r_list, ['paragraph', 'reference', 'blockquote']],\n ['reference', r_reference],\n ['html_block', r_html_block, ['paragraph', 'reference', 'blockquote']],\n ['heading', r_heading, ['paragraph', 'reference', 'blockquote']],\n ['lheading', r_lheading],\n ['paragraph', r_paragraph]\n]\n\n/**\n * new ParserBlock()\n **/\nfunction ParserBlock () {\n /**\n * ParserBlock#ruler -> Ruler\n *\n * [[Ruler]] instance. Keep configuration of block rules.\n **/\n this.ruler = new Ruler()\n\n for (let i = 0; i < _rules.length; i++) {\n this.ruler.push(_rules[i][0], _rules[i][1], { alt: (_rules[i][2] || []).slice() })\n }\n}\n\n// Generate tokens for input range\n//\nParserBlock.prototype.tokenize = function (state, startLine, endLine) {\n const rules = this.ruler.getRules('')\n const len = rules.length\n const maxNesting = state.md.options.maxNesting\n let line = startLine\n let hasEmptyLines = false\n\n while (line < endLine) {\n state.line = line = state.skipEmptyLines(line)\n if (line >= endLine) { break }\n\n // Termination condition for nested calls.\n // Nested calls currently used for blockquotes & lists\n if (state.sCount[line] < state.blkIndent) { break }\n\n // If nesting level exceeded - skip tail to the end. That's not ordinary\n // situation and we should not care about content.\n if (state.level >= maxNesting) {\n state.line = endLine\n break\n }\n\n // Try all possible rules.\n // On success, rule should:\n //\n // - update `state.line`\n // - update `state.tokens`\n // - return true\n const prevLine = state.line\n let ok = false\n\n for (let i = 0; i < len; i++) {\n ok = rules[i](state, line, endLine, false)\n if (ok) {\n if (prevLine >= state.line) {\n throw new Error(\"block rule didn't increment state.line\")\n }\n break\n }\n }\n\n // this can only happen if user disables paragraph rule\n if (!ok) throw new Error('none of the block rules matched')\n\n // set state.tight if we had an empty line before current tag\n // i.e. latest empty line should not count\n state.tight = !hasEmptyLines\n\n // paragraph might \"eat\" one newline after it in nested lists\n if (state.isEmpty(state.line - 1)) {\n hasEmptyLines = true\n }\n\n line = state.line\n\n if (line < endLine && state.isEmpty(line)) {\n hasEmptyLines = true\n line++\n state.line = line\n }\n }\n}\n\n/**\n * ParserBlock.parse(str, md, env, outTokens)\n *\n * Process input string and push block tokens into `outTokens`\n **/\nParserBlock.prototype.parse = function (src, md, env, outTokens) {\n if (!src) { return }\n\n const state = new this.State(src, md, env, outTokens)\n\n this.tokenize(state, state.line, state.lineMax)\n}\n\nParserBlock.prototype.State = StateBlock\n\nexport default ParserBlock\n", "// Inline parser state\n\nimport Token from '../token.mjs'\nimport { isWhiteSpace, isPunctChar, isMdAsciiPunct } from '../common/utils.mjs'\n\nfunction StateInline (src, md, env, outTokens) {\n this.src = src\n this.env = env\n this.md = md\n this.tokens = outTokens\n this.tokens_meta = Array(outTokens.length)\n\n this.pos = 0\n this.posMax = this.src.length\n this.level = 0\n this.pending = ''\n this.pendingLevel = 0\n\n // Stores { start: end } pairs. Useful for backtrack\n // optimization of pairs parse (emphasis, strikes).\n this.cache = {}\n\n // List of emphasis-like delimiters for current tag\n this.delimiters = []\n\n // Stack of delimiter lists for upper level tags\n this._prev_delimiters = []\n\n // backtick length => last seen position\n this.backticks = {}\n this.backticksScanned = false\n\n // Counter used to disable inline linkify-it execution\n // inside <a> and markdown links\n this.linkLevel = 0\n}\n\n// Flush pending text\n//\nStateInline.prototype.pushPending = function () {\n const token = new Token('text', '', 0)\n token.content = this.pending\n token.level = this.pendingLevel\n this.tokens.push(token)\n this.pending = ''\n return token\n}\n\n// Push new token to \"stream\".\n// If pending text exists - flush it as text token\n//\nStateInline.prototype.push = function (type, tag, nesting) {\n if (this.pending) {\n this.pushPending()\n }\n\n const token = new Token(type, tag, nesting)\n let token_meta = null\n\n if (nesting < 0) {\n // closing tag\n this.level--\n this.delimiters = this._prev_delimiters.pop()\n }\n\n token.level = this.level\n\n if (nesting > 0) {\n // opening tag\n this.level++\n this._prev_delimiters.push(this.delimiters)\n this.delimiters = []\n token_meta = { delimiters: this.delimiters }\n }\n\n this.pendingLevel = this.level\n this.tokens.push(token)\n this.tokens_meta.push(token_meta)\n return token\n}\n\n// Scan a sequence of emphasis-like markers, and determine whether\n// it can start an emphasis sequence or end an emphasis sequence.\n//\n// - start - position to scan from (it should point at a valid marker);\n// - canSplitWord - determine if these markers can be found inside a word\n//\nStateInline.prototype.scanDelims = function (start, canSplitWord) {\n const max = this.posMax\n const marker = this.src.charCodeAt(start)\n\n // treat beginning of the line as a whitespace\n const lastChar = start > 0 ? this.src.charCodeAt(start - 1) : 0x20\n\n let pos = start\n while (pos < max && this.src.charCodeAt(pos) === marker) { pos++ }\n\n const count = pos - start\n\n // treat end of the line as a whitespace\n const nextChar = pos < max ? this.src.charCodeAt(pos) : 0x20\n\n const isLastPunctChar = isMdAsciiPunct(lastChar) || isPunctChar(String.fromCharCode(lastChar))\n const isNextPunctChar = isMdAsciiPunct(nextChar) || isPunctChar(String.fromCharCode(nextChar))\n\n const isLastWhiteSpace = isWhiteSpace(lastChar)\n const isNextWhiteSpace = isWhiteSpace(nextChar)\n\n const left_flanking =\n !isNextWhiteSpace && (!isNextPunctChar || isLastWhiteSpace || isLastPunctChar)\n const right_flanking =\n !isLastWhiteSpace && (!isLastPunctChar || isNextWhiteSpace || isNextPunctChar)\n\n const can_open = left_flanking && (canSplitWord || !right_flanking || isLastPunctChar)\n const can_close = right_flanking && (canSplitWord || !left_flanking || isNextPunctChar)\n\n return { can_open, can_close, length: count }\n}\n\n// re-export Token class to use in block rules\nStateInline.prototype.Token = Token\n\nexport default StateInline\n", "// Skip text characters for text token, place those to pending buffer\n// and increment current pos\n\n// Rule to skip pure text\n// '{}$%@~+=:' reserved for extentions\n\n// !, \", #, $, %, &, ', (, ), *, +, ,, -, ., /, :, ;, <, =, >, ?, @, [, \\, ], ^, _, `, {, |, }, or ~\n\n// !!!! Don't confuse with \"Markdown ASCII Punctuation\" chars\n// http://spec.commonmark.org/0.15/#ascii-punctuation-character\nfunction isTerminatorChar (ch) {\n switch (ch) {\n case 0x0A/* \\n */:\n case 0x21/* ! */:\n case 0x23/* # */:\n case 0x24/* $ */:\n case 0x25/* % */:\n case 0x26/* & */:\n case 0x2A/* * */:\n case 0x2B/* + */:\n case 0x2D/* - */:\n case 0x3A/* : */:\n case 0x3C/* < */:\n case 0x3D/* = */:\n case 0x3E/* > */:\n case 0x40/* @ */:\n case 0x5B/* [ */:\n case 0x5C/* \\ */:\n case 0x5D/* ] */:\n case 0x5E/* ^ */:\n case 0x5F/* _ */:\n case 0x60/* ` */:\n case 0x7B/* { */:\n case 0x7D/* } */:\n case 0x7E/* ~ */:\n return true\n default:\n return false\n }\n}\n\nexport default function text (state, silent) {\n let pos = state.pos\n\n while (pos < state.posMax && !isTerminatorChar(state.src.charCodeAt(pos))) {\n pos++\n }\n\n if (pos === state.pos) { return false }\n\n if (!silent) { state.pending += state.src.slice(state.pos, pos) }\n\n state.pos = pos\n\n return true\n}\n\n// Alternative implementation, for memory.\n//\n// It costs 10% of performance, but allows extend terminators list, if place it\n// to `ParserInline` property. Probably, will switch to it sometime, such\n// flexibility required.\n\n/*\nvar TERMINATOR_RE = /[\\n!#$%&*+\\-:<=>@[\\\\\\]^_`{}~]/;\n\nmodule.exports = function text(state, silent) {\n var pos = state.pos,\n idx = state.src.slice(pos).search(TERMINATOR_RE);\n\n // first char is terminator -> empty text\n if (idx === 0) { return false; }\n\n // no terminator -> text till end of string\n if (idx < 0) {\n if (!silent) { state.pending += state.src.slice(pos); }\n state.pos = state.src.length;\n return true;\n }\n\n if (!silent) { state.pending += state.src.slice(pos, pos + idx); }\n\n state.pos += idx;\n\n return true;\n}; */\n", "// Process links like https://example.org/\n\n// RFC3986: scheme = ALPHA *( ALPHA / DIGIT / \"+\" / \"-\" / \".\" )\nconst SCHEME_RE = /(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i\n\nexport default function linkify (state, silent) {\n if (!state.md.options.linkify) return false\n if (state.linkLevel > 0) return false\n\n const pos = state.pos\n const max = state.posMax\n\n if (pos + 3 > max) return false\n if (state.src.charCodeAt(pos) !== 0x3A/* : */) return false\n if (state.src.charCodeAt(pos + 1) !== 0x2F/* / */) return false\n if (state.src.charCodeAt(pos + 2) !== 0x2F/* / */) return false\n\n const match = state.pending.match(SCHEME_RE)\n if (!match) return false\n\n const proto = match[1]\n\n const link = state.md.linkify.matchAtStart(state.src.slice(pos - proto.length))\n if (!link) return false\n\n let url = link.url\n\n // invalid link, but still detected by linkify somehow;\n // need to check to prevent infinite loop below\n if (url.length <= proto.length) return false\n\n // disallow '*' at the end of the link (conflicts with emphasis)\n // do manual backsearch to avoid perf issues with regex /\\*+$/ on \"****...****a\".\n let urlEnd = url.length\n while (urlEnd > 0 && url.charCodeAt(urlEnd - 1) === 0x2A/* * */) {\n urlEnd--\n }\n if (urlEnd !== url.length) {\n url = url.slice(0, urlEnd)\n }\n\n const fullUrl = state.md.normalizeLink(url)\n if (!state.md.validateLink(fullUrl)) return false\n\n if (!silent) {\n state.pending = state.pending.slice(0, -proto.length)\n\n const token_o = state.push('link_open', 'a', 1)\n token_o.attrs = [['href', fullUrl]]\n token_o.markup = 'linkify'\n token_o.info = 'auto'\n\n const token_t = state.push('text', '', 0)\n token_t.content = state.md.normalizeLinkText(url)\n\n const token_c = state.push('link_close', 'a', -1)\n token_c.markup = 'linkify'\n token_c.info = 'auto'\n }\n\n state.pos += url.length - proto.length\n return true\n}\n", "// Proceess '\\n'\n\nimport { isSpace } from '../common/utils.mjs'\n\nexport default function newline (state, silent) {\n let pos = state.pos\n\n if (state.src.charCodeAt(pos) !== 0x0A/* \\n */) { return false }\n\n const pmax = state.pending.length - 1\n const max = state.posMax\n\n // ' \\n' -> hardbreak\n // Lookup in pending chars is bad practice! Don't copy to other rules!\n // Pending string is stored in concat mode, indexed lookups will cause\n // convertion to flat mode.\n if (!silent) {\n if (pmax >= 0 && state.pending.charCodeAt(pmax) === 0x20) {\n if (pmax >= 1 && state.pending.charCodeAt(pmax - 1) === 0x20) {\n // Find whitespaces tail of pending chars.\n let ws = pmax - 1\n while (ws >= 1 && state.pending.charCodeAt(ws - 1) === 0x20) ws--\n\n state.pending = state.pending.slice(0, ws)\n state.push('hardbreak', 'br', 0)\n } else {\n state.pending = state.pending.slice(0, -1)\n state.push('softbreak', 'br', 0)\n }\n } else {\n state.push('softbreak', 'br', 0)\n }\n }\n\n pos++\n\n // skip heading spaces for next line\n while (pos < max && isSpace(state.src.charCodeAt(pos))) { pos++ }\n\n state.pos = pos\n return true\n}\n", "// Process escaped chars and hardbreaks\n\nimport { isSpace } from '../common/utils.mjs'\n\nconst ESCAPED = []\n\nfor (let i = 0; i < 256; i++) { ESCAPED.push(0) }\n\n'\\\\!\"#$%&\\'()*+,./:;<=>?@[]^_`{|}~-'\n .split('').forEach(function (ch) { ESCAPED[ch.charCodeAt(0)] = 1 })\n\nexport default function escape (state, silent) {\n let pos = state.pos\n const max = state.posMax\n\n if (state.src.charCodeAt(pos) !== 0x5C/* \\ */) return false\n pos++\n\n // '\\' at the end of the inline block\n if (pos >= max) return false\n\n let ch1 = state.src.charCodeAt(pos)\n\n if (ch1 === 0x0A) {\n if (!silent) {\n state.push('hardbreak', 'br', 0)\n }\n\n pos++\n // skip leading whitespaces from next line\n while (pos < max) {\n ch1 = state.src.charCodeAt(pos)\n if (!isSpace(ch1)) break\n pos++\n }\n\n state.pos = pos\n return true\n }\n\n let escapedStr = state.src[pos]\n\n if (ch1 >= 0xD800 && ch1 <= 0xDBFF && pos + 1 < max) {\n const ch2 = state.src.charCodeAt(pos + 1)\n\n if (ch2 >= 0xDC00 && ch2 <= 0xDFFF) {\n escapedStr += state.src[pos + 1]\n pos++\n }\n }\n\n const origStr = '\\\\' + escapedStr\n\n if (!silent) {\n const token = state.push('text_special', '', 0)\n\n if (ch1 < 256 && ESCAPED[ch1] !== 0) {\n token.content = escapedStr\n } else {\n token.content = origStr\n }\n\n token.markup = origStr\n token.info = 'escape'\n }\n\n state.pos = pos + 1\n return true\n}\n", "// Parse backticks\n\nexport default function backtick (state, silent) {\n let pos = state.pos\n const ch = state.src.charCodeAt(pos)\n\n if (ch !== 0x60/* ` */) { return false }\n\n const start = pos\n pos++\n const max = state.posMax\n\n // scan marker length\n while (pos < max && state.src.charCodeAt(pos) === 0x60/* ` */) { pos++ }\n\n const marker = state.src.slice(start, pos)\n const openerLength = marker.length\n\n if (state.backticksScanned && (state.backticks[openerLength] || 0) <= start) {\n if (!silent) state.pending += marker\n state.pos += openerLength\n return true\n }\n\n let matchEnd = pos\n let matchStart\n\n // Nothing found in the cache, scan until the end of the line (or until marker is found)\n while ((matchStart = state.src.indexOf('`', matchEnd)) !== -1) {\n matchEnd = matchStart + 1\n\n // scan marker length\n while (matchEnd < max && state.src.charCodeAt(matchEnd) === 0x60/* ` */) { matchEnd++ }\n\n const closerLength = matchEnd - matchStart\n\n if (closerLength === openerLength) {\n // Found matching closer length.\n if (!silent) {\n const token = state.push('code_inline', 'code', 0)\n token.markup = marker\n token.content = state.src.slice(pos, matchStart)\n .replace(/\\n/g, ' ')\n .replace(/^ (.+) $/, '$1')\n }\n state.pos = matchEnd\n return true\n }\n\n // Some different length found, put it in cache as upper limit of where closer can be found\n state.backticks[closerLength] = matchStart\n }\n\n // Scanned through the end, didn't find anything\n state.backticksScanned = true\n\n if (!silent) state.pending += marker\n state.pos += openerLength\n return true\n}\n", "// ~~strike through~~\n//\n\n// Insert each marker as a separate text token, and add it to delimiter list\n//\nfunction strikethrough_tokenize (state, silent) {\n const start = state.pos\n const marker = state.src.charCodeAt(start)\n\n if (silent) { return false }\n\n if (marker !== 0x7E/* ~ */) { return false }\n\n const scanned = state.scanDelims(state.pos, true)\n let len = scanned.length\n const ch = String.fromCharCode(marker)\n\n if (len < 2) { return false }\n\n let token\n\n if (len % 2) {\n token = state.push('text', '', 0)\n token.content = ch\n len--\n }\n\n for (let i = 0; i < len; i += 2) {\n token = state.push('text', '', 0)\n token.content = ch + ch\n\n state.delimiters.push({\n marker,\n length: 0, // disable \"rule of 3\" length checks meant for emphasis\n token: state.tokens.length - 1,\n end: -1,\n open: scanned.can_open,\n close: scanned.can_close\n })\n }\n\n state.pos += scanned.length\n\n return true\n}\n\nfunction postProcess (state, delimiters) {\n let token\n const loneMarkers = []\n const max = delimiters.length\n\n for (let i = 0; i < max; i++) {\n const startDelim = delimiters[i]\n\n if (startDelim.marker !== 0x7E/* ~ */) {\n continue\n }\n\n if (startDelim.end === -1) {\n continue\n }\n\n const endDelim = delimiters[startDelim.end]\n\n token = state.tokens[startDelim.token]\n token.type = 's_open'\n token.tag = 's'\n token.nesting = 1\n token.markup = '~~'\n token.content = ''\n\n token = state.tokens[endDelim.token]\n token.type = 's_close'\n token.tag = 's'\n token.nesting = -1\n token.markup = '~~'\n token.content = ''\n\n if (state.tokens[endDelim.token - 1].type === 'text' &&\n state.tokens[endDelim.token - 1].content === '~') {\n loneMarkers.push(endDelim.token - 1)\n }\n }\n\n // If a marker sequence has an odd number of characters, it's splitted\n // like this: `~~~~~` -> `~` + `~~` + `~~`, leaving one marker at the\n // start of the sequence.\n //\n // So, we have to move all those markers after subsequent s_close tags.\n //\n while (loneMarkers.length) {\n const i = loneMarkers.pop()\n let j = i + 1\n\n while (j < state.tokens.length && state.tokens[j].type === 's_close') {\n j++\n }\n\n j--\n\n if (i !== j) {\n token = state.tokens[j]\n state.tokens[j] = state.tokens[i]\n state.tokens[i] = token\n }\n }\n}\n\n// Walk through delimiter list and replace text tokens with tags\n//\nfunction strikethrough_postProcess (state) {\n const tokens_meta = state.tokens_meta\n const max = state.tokens_meta.length\n\n postProcess(state, state.delimiters)\n\n for (let curr = 0; curr < max; curr++) {\n if (tokens_meta[curr] && tokens_meta[curr].delimiters) {\n postProcess(state, tokens_meta[curr].delimiters)\n }\n }\n}\n\nexport default {\n tokenize: strikethrough_tokenize,\n postProcess: strikethrough_postProcess\n}\n", "// Process *this* and _that_\n//\n\n// Insert each marker as a separate text token, and add it to delimiter list\n//\nfunction emphasis_tokenize (state, silent) {\n const start = state.pos\n const marker = state.src.charCodeAt(start)\n\n if (silent) { return false }\n\n if (marker !== 0x5F /* _ */ && marker !== 0x2A /* * */) { return false }\n\n const scanned = state.scanDelims(state.pos, marker === 0x2A)\n\n for (let i = 0; i < scanned.length; i++) {\n const token = state.push('text', '', 0)\n token.content = String.fromCharCode(marker)\n\n state.delimiters.push({\n // Char code of the starting marker (number).\n //\n marker,\n\n // Total length of these series of delimiters.\n //\n length: scanned.length,\n\n // A position of the token this delimiter corresponds to.\n //\n token: state.tokens.length - 1,\n\n // If this delimiter is matched as a valid opener, `end` will be\n // equal to its position, otherwise it's `-1`.\n //\n end: -1,\n\n // Boolean flags that determine if this delimiter could open or close\n // an emphasis.\n //\n open: scanned.can_open,\n close: scanned.can_close\n })\n }\n\n state.pos += scanned.length\n\n return true\n}\n\nfunction postProcess (state, delimiters) {\n const max = delimiters.length\n\n for (let i = max - 1; i >= 0; i--) {\n const startDelim = delimiters[i]\n\n if (startDelim.marker !== 0x5F/* _ */ && startDelim.marker !== 0x2A/* * */) {\n continue\n }\n\n // Process only opening markers\n if (startDelim.end === -1) {\n continue\n }\n\n const endDelim = delimiters[startDelim.end]\n\n // If the previous delimiter has the same marker and is adjacent to this one,\n // merge those into one strong delimiter.\n //\n // `<em><em>whatever</em></em>` -> `<strong>whatever</strong>`\n //\n const isStrong = i > 0 &&\n delimiters[i - 1].end === startDelim.end + 1 &&\n // check that first two markers match and adjacent\n delimiters[i - 1].marker === startDelim.marker &&\n delimiters[i - 1].token === startDelim.token - 1 &&\n // check that last two markers are adjacent (we can safely assume they match)\n delimiters[startDelim.end + 1].token === endDelim.token + 1\n\n const ch = String.fromCharCode(startDelim.marker)\n\n const token_o = state.tokens[startDelim.token]\n token_o.type = isStrong ? 'strong_open' : 'em_open'\n token_o.tag = isStrong ? 'strong' : 'em'\n token_o.nesting = 1\n token_o.markup = isStrong ? ch + ch : ch\n token_o.content = ''\n\n const token_c = state.tokens[endDelim.token]\n token_c.type = isStrong ? 'strong_close' : 'em_close'\n token_c.tag = isStrong ? 'strong' : 'em'\n token_c.nesting = -1\n token_c.markup = isStrong ? ch + ch : ch\n token_c.content = ''\n\n if (isStrong) {\n state.tokens[delimiters[i - 1].token].content = ''\n state.tokens[delimiters[startDelim.end + 1].token].content = ''\n i--\n }\n }\n}\n\n// Walk through delimiter list and replace text tokens with tags\n//\nfunction emphasis_post_process (state) {\n const tokens_meta = state.tokens_meta\n const max = state.tokens_meta.length\n\n postProcess(state, state.delimiters)\n\n for (let curr = 0; curr < max; curr++) {\n if (tokens_meta[curr] && tokens_meta[curr].delimiters) {\n postProcess(state, tokens_meta[curr].delimiters)\n }\n }\n}\n\nexport default {\n tokenize: emphasis_tokenize,\n postProcess: emphasis_post_process\n}\n", "// Process [link](<to> \"stuff\")\n\nimport { normalizeReference, isSpace } from '../common/utils.mjs'\n\nexport default function link (state, silent) {\n let code, label, res, ref\n let href = ''\n let title = ''\n let start = state.pos\n let parseReference = true\n\n if (state.src.charCodeAt(state.pos) !== 0x5B/* [ */) { return false }\n\n const oldPos = state.pos\n const max = state.posMax\n const labelStart = state.pos + 1\n const labelEnd = state.md.helpers.parseLinkLabel(state, state.pos, true)\n\n // parser failed to find ']', so it's not a valid link\n if (labelEnd < 0) { return false }\n\n let pos = labelEnd + 1\n if (pos < max && state.src.charCodeAt(pos) === 0x28/* ( */) {\n //\n // Inline link\n //\n\n // might have found a valid shortcut link, disable reference parsing\n parseReference = false\n\n // [link]( <href> \"title\" )\n // ^^ skipping these spaces\n pos++\n for (; pos < max; pos++) {\n code = state.src.charCodeAt(pos)\n if (!isSpace(code) && code !== 0x0A) { break }\n }\n if (pos >= max) { return false }\n\n // [link]( <href> \"title\" )\n // ^^^^^^ parsing link destination\n start = pos\n res = state.md.helpers.parseLinkDestination(state.src, pos, state.posMax)\n if (res.ok) {\n href = state.md.normalizeLink(res.str)\n if (state.md.validateLink(href)) {\n pos = res.pos\n } else {\n href = ''\n }\n\n // [link]( <href> \"title\" )\n // ^^ skipping these spaces\n start = pos\n for (; pos < max; pos++) {\n code = state.src.charCodeAt(pos)\n if (!isSpace(code) && code !== 0x0A) { break }\n }\n\n // [link]( <href> \"title\" )\n // ^^^^^^^ parsing link title\n res = state.md.helpers.parseLinkTitle(state.src, pos, state.posMax)\n if (pos < max && start !== pos && res.ok) {\n title = res.str\n pos = res.pos\n\n // [link]( <href> \"title\" )\n // ^^ skipping these spaces\n for (; pos < max; pos++) {\n code = state.src.charCodeAt(pos)\n if (!isSpace(code) && code !== 0x0A) { break }\n }\n }\n }\n\n if (pos >= max || state.src.charCodeAt(pos) !== 0x29/* ) */) {\n // parsing a valid shortcut link failed, fallback to reference\n parseReference = true\n }\n pos++\n }\n\n if (parseReference) {\n //\n // Link reference\n //\n if (typeof state.env.references === 'undefined') { return false }\n\n if (pos < max && state.src.charCodeAt(pos) === 0x5B/* [ */) {\n start = pos + 1\n pos = state.md.helpers.parseLinkLabel(state, pos)\n if (pos >= 0) {\n label = state.src.slice(start, pos++)\n } else {\n pos = labelEnd + 1\n }\n } else {\n pos = labelEnd + 1\n }\n\n // covers label === '' and label === undefined\n // (collapsed reference link and shortcut reference link respectively)\n if (!label) { label = state.src.slice(labelStart, labelEnd) }\n\n ref = state.env.references[normalizeReference(label)]\n if (!ref) {\n state.pos = oldPos\n return false\n }\n href = ref.href\n title = ref.title\n }\n\n //\n // We found the end of the link, and know for a fact it's a valid link;\n // so all that's left to do is to call tokenizer.\n //\n if (!silent) {\n state.pos = labelStart\n state.posMax = labelEnd\n\n const token_o = state.push('link_open', 'a', 1)\n const attrs = [['href', href]]\n token_o.attrs = attrs\n if (title) {\n attrs.push(['title', title])\n }\n\n state.linkLevel++\n state.md.inline.tokenize(state)\n state.linkLevel--\n\n state.push('link_close', 'a', -1)\n }\n\n state.pos = pos\n state.posMax = max\n return true\n}\n", "// Process \n\nimport { normalizeReference, isSpace } from '../common/utils.mjs'\n\nexport default function image (state, silent) {\n let code, content, label, pos, ref, res, title, start\n let href = ''\n const oldPos = state.pos\n const max = state.posMax\n\n if (state.src.charCodeAt(state.pos) !== 0x21/* ! */) { return false }\n if (state.src.charCodeAt(state.pos + 1) !== 0x5B/* [ */) { return false }\n\n const labelStart = state.pos + 2\n const labelEnd = state.md.helpers.parseLinkLabel(state, state.pos + 1, false)\n\n // parser failed to find ']', so it's not a valid link\n if (labelEnd < 0) { return false }\n\n pos = labelEnd + 1\n if (pos < max && state.src.charCodeAt(pos) === 0x28/* ( */) {\n //\n // Inline link\n //\n\n // [link]( <href> \"title\" )\n // ^^ skipping these spaces\n pos++\n for (; pos < max; pos++) {\n code = state.src.charCodeAt(pos)\n if (!isSpace(code) && code !== 0x0A) { break }\n }\n if (pos >= max) { return false }\n\n // [link]( <href> \"title\" )\n // ^^^^^^ parsing link destination\n start = pos\n res = state.md.helpers.parseLinkDestination(state.src, pos, state.posMax)\n if (res.ok) {\n href = state.md.normalizeLink(res.str)\n if (state.md.validateLink(href)) {\n pos = res.pos\n } else {\n href = ''\n }\n }\n\n // [link]( <href> \"title\" )\n // ^^ skipping these spaces\n start = pos\n for (; pos < max; pos++) {\n code = state.src.charCodeAt(pos)\n if (!isSpace(code) && code !== 0x0A) { break }\n }\n\n // [link]( <href> \"title\" )\n // ^^^^^^^ parsing link title\n res = state.md.helpers.parseLinkTitle(state.src, pos, state.posMax)\n if (pos < max && start !== pos && res.ok) {\n title = res.str\n pos = res.pos\n\n // [link]( <href> \"title\" )\n // ^^ skipping these spaces\n for (; pos < max; pos++) {\n code = state.src.charCodeAt(pos)\n if (!isSpace(code) && code !== 0x0A) { break }\n }\n } else {\n title = ''\n }\n\n if (pos >= max || state.src.charCodeAt(pos) !== 0x29/* ) */) {\n state.pos = oldPos\n return false\n }\n pos++\n } else {\n //\n // Link reference\n //\n if (typeof state.env.references === 'undefined') { return false }\n\n if (pos < max && state.src.charCodeAt(pos) === 0x5B/* [ */) {\n start = pos + 1\n pos = state.md.helpers.parseLinkLabel(state, pos)\n if (pos >= 0) {\n label = state.src.slice(start, pos++)\n } else {\n pos = labelEnd + 1\n }\n } else {\n pos = labelEnd + 1\n }\n\n // covers label === '' and label === undefined\n // (collapsed reference link and shortcut reference link respectively)\n if (!label) { label = state.src.slice(labelStart, labelEnd) }\n\n ref = state.env.references[normalizeReference(label)]\n if (!ref) {\n state.pos = oldPos\n return false\n }\n href = ref.href\n title = ref.title\n }\n\n //\n // We found the end of the link, and know for a fact it's a valid link;\n // so all that's left to do is to call tokenizer.\n //\n if (!silent) {\n content = state.src.slice(labelStart, labelEnd)\n\n const tokens = []\n state.md.inline.parse(\n content,\n state.md,\n state.env,\n tokens\n )\n\n const token = state.push('image', 'img', 0)\n const attrs = [['src', href], ['alt', '']]\n token.attrs = attrs\n token.children = tokens\n token.content = content\n\n if (title) {\n attrs.push(['title', title])\n }\n }\n\n state.pos = pos\n state.posMax = max\n return true\n}\n", "// Process autolinks '<protocol:...>'\n\n/* eslint max-len:0 */\nconst 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])?)*)$/\n/* eslint-disable-next-line no-control-regex */\nconst AUTOLINK_RE = /^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\\x00-\\x20]*)$/\n\nexport default function autolink (state, silent) {\n let pos = state.pos\n\n if (state.src.charCodeAt(pos) !== 0x3C/* < */) { return false }\n\n const start = state.pos\n const max = state.posMax\n\n for (;;) {\n if (++pos >= max) return false\n\n const ch = state.src.charCodeAt(pos)\n\n if (ch === 0x3C /* < */) return false\n if (ch === 0x3E /* > */) break\n }\n\n const url = state.src.slice(start + 1, pos)\n\n if (AUTOLINK_RE.test(url)) {\n const fullUrl = state.md.normalizeLink(url)\n if (!state.md.validateLink(fullUrl)) { return false }\n\n if (!silent) {\n const token_o = state.push('link_open', 'a', 1)\n token_o.attrs = [['href', fullUrl]]\n token_o.markup = 'autolink'\n token_o.info = 'auto'\n\n const token_t = state.push('text', '', 0)\n token_t.content = state.md.normalizeLinkText(url)\n\n const token_c = state.push('link_close', 'a', -1)\n token_c.markup = 'autolink'\n token_c.info = 'auto'\n }\n\n state.pos += url.length + 2\n return true\n }\n\n if (EMAIL_RE.test(url)) {\n const fullUrl = state.md.normalizeLink('mailto:' + url)\n if (!state.md.validateLink(fullUrl)) { return false }\n\n if (!silent) {\n const token_o = state.push('link_open', 'a', 1)\n token_o.attrs = [['href', fullUrl]]\n token_o.markup = 'autolink'\n token_o.info = 'auto'\n\n const token_t = state.push('text', '', 0)\n token_t.content = state.md.normalizeLinkText(url)\n\n const token_c = state.push('link_close', 'a', -1)\n token_c.markup = 'autolink'\n token_c.info = 'auto'\n }\n\n state.pos += url.length + 2\n return true\n }\n\n return false\n}\n", "// Process html tags\n\nimport { HTML_TAG_RE } from '../common/html_re.mjs'\n\nfunction isLinkOpen (str) {\n return /^<a[>\\s]/i.test(str)\n}\nfunction isLinkClose (str) {\n return /^<\\/a\\s*>/i.test(str)\n}\n\nfunction isLetter (ch) {\n /* eslint no-bitwise:0 */\n const lc = ch | 0x20 // to lower case\n return (lc >= 0x61/* a */) && (lc <= 0x7a/* z */)\n}\n\nexport default function html_inline (state, silent) {\n if (!state.md.options.html) { return false }\n\n // Check start\n const max = state.posMax\n const pos = state.pos\n if (state.src.charCodeAt(pos) !== 0x3C/* < */ ||\n pos + 2 >= max) {\n return false\n }\n\n // Quick fail on second char\n const ch = state.src.charCodeAt(pos + 1)\n if (ch !== 0x21/* ! */ &&\n ch !== 0x3F/* ? */ &&\n ch !== 0x2F/* / */ &&\n !isLetter(ch)) {\n return false\n }\n\n const match = state.src.slice(pos).match(HTML_TAG_RE)\n if (!match) { return false }\n\n if (!silent) {\n const token = state.push('html_inline', '', 0)\n token.content = match[0]\n\n if (isLinkOpen(token.content)) state.linkLevel++\n if (isLinkClose(token.content)) state.linkLevel--\n }\n state.pos += match[0].length\n return true\n}\n", "// Process html entity - {, ¯, ", ...\n\nimport { decodeHTML } from 'entities'\nimport { isValidEntityCode, fromCodePoint } from '../common/utils.mjs'\n\nconst DIGITAL_RE = /^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i\nconst NAMED_RE = /^&([a-z][a-z0-9]{1,31});/i\n\nexport default function entity (state, silent) {\n const pos = state.pos\n const max = state.posMax\n\n if (state.src.charCodeAt(pos) !== 0x26/* & */) return false\n\n if (pos + 1 >= max) return false\n\n const ch = state.src.charCodeAt(pos + 1)\n\n if (ch === 0x23 /* # */) {\n const match = state.src.slice(pos).match(DIGITAL_RE)\n if (match) {\n if (!silent) {\n const code = match[1][0].toLowerCase() === 'x' ? parseInt(match[1].slice(1), 16) : parseInt(match[1], 10)\n\n const token = state.push('text_special', '', 0)\n token.content = isValidEntityCode(code) ? fromCodePoint(code) : fromCodePoint(0xFFFD)\n token.markup = match[0]\n token.info = 'entity'\n }\n state.pos += match[0].length\n return true\n }\n } else {\n const match = state.src.slice(pos).match(NAMED_RE)\n if (match) {\n const decoded = decodeHTML(match[0])\n if (decoded !== match[0]) {\n if (!silent) {\n const token = state.push('text_special', '', 0)\n token.content = decoded\n token.markup = match[0]\n token.info = 'entity'\n }\n state.pos += match[0].length\n return true\n }\n }\n }\n\n return false\n}\n", "// For each opening emphasis-like marker find a matching closing one\n//\n\nfunction processDelimiters (delimiters) {\n const openersBottom = {}\n const max = delimiters.length\n\n if (!max) return\n\n // headerIdx is the first delimiter of the current (where closer is) delimiter run\n let headerIdx = 0\n let lastTokenIdx = -2 // needs any value lower than -1\n const jumps = []\n\n for (let closerIdx = 0; closerIdx < max; closerIdx++) {\n const closer = delimiters[closerIdx]\n\n jumps.push(0)\n\n // markers belong to same delimiter run if:\n // - they have adjacent tokens\n // - AND markers are the same\n //\n if (delimiters[headerIdx].marker !== closer.marker || lastTokenIdx !== closer.token - 1) {\n headerIdx = closerIdx\n }\n\n lastTokenIdx = closer.token\n\n // Length is only used for emphasis-specific \"rule of 3\",\n // if it's not defined (in strikethrough or 3rd party plugins),\n // we can default it to 0 to disable those checks.\n //\n closer.length = closer.length || 0\n\n if (!closer.close) continue\n\n // Previously calculated lower bounds (previous fails)\n // for each marker, each delimiter length modulo 3,\n // and for whether this closer can be an opener;\n // https://github.com/commonmark/cmark/commit/34250e12ccebdc6372b8b49c44fab57c72443460\n /* eslint-disable-next-line no-prototype-builtins */\n if (!openersBottom.hasOwnProperty(closer.marker)) {\n openersBottom[closer.marker] = [-1, -1, -1, -1, -1, -1]\n }\n\n const minOpenerIdx = openersBottom[closer.marker][(closer.open ? 3 : 0) + (closer.length % 3)]\n\n let openerIdx = headerIdx - jumps[headerIdx] - 1\n\n let newMinOpenerIdx = openerIdx\n\n for (; openerIdx > minOpenerIdx; openerIdx -= jumps[openerIdx] + 1) {\n const opener = delimiters[openerIdx]\n\n if (opener.marker !== closer.marker) continue\n\n if (opener.open && opener.end < 0) {\n let isOddMatch = false\n\n // from spec:\n //\n // If one of the delimiters can both open and close emphasis, then the\n // sum of the lengths of the delimiter runs containing the opening and\n // closing delimiters must not be a multiple of 3 unless both lengths\n // are multiples of 3.\n //\n if (opener.close || closer.open) {\n if ((opener.length + closer.length) % 3 === 0) {\n if (opener.length % 3 !== 0 || closer.length % 3 !== 0) {\n isOddMatch = true\n }\n }\n }\n\n if (!isOddMatch) {\n // If previous delimiter cannot be an opener, we can safely skip\n // the entire sequence in future checks. This is required to make\n // sure algorithm has linear complexity (see *_*_*_*_*_... case).\n //\n const lastJump = openerIdx > 0 && !delimiters[openerIdx - 1].open\n ? jumps[openerIdx - 1] + 1\n : 0\n\n jumps[closerIdx] = closerIdx - openerIdx + lastJump\n jumps[openerIdx] = lastJump\n\n closer.open = false\n opener.end = closerIdx\n opener.close = false\n newMinOpenerIdx = -1\n // treat next token as start of run,\n // it optimizes skips in **<...>**a**<...>** pathological case\n lastTokenIdx = -2\n break\n }\n }\n }\n\n if (newMinOpenerIdx !== -1) {\n // If match for this delimiter run failed, we want to set lower bound for\n // future lookups. This is required to make sure algorithm has linear\n // complexity.\n //\n // See details here:\n // https://github.com/commonmark/cmark/issues/178#issuecomment-270417442\n //\n openersBottom[closer.marker][(closer.open ? 3 : 0) + ((closer.length || 0) % 3)] = newMinOpenerIdx\n }\n }\n}\n\nexport default function link_pairs (state) {\n const tokens_meta = state.tokens_meta\n const max = state.tokens_meta.length\n\n processDelimiters(state.delimiters)\n\n for (let curr = 0; curr < max; curr++) {\n if (tokens_meta[curr] && tokens_meta[curr].delimiters) {\n processDelimiters(tokens_meta[curr].delimiters)\n }\n }\n}\n", "// Clean up tokens after emphasis and strikethrough postprocessing:\n// merge adjacent text nodes into one and re-calculate all token levels\n//\n// This is necessary because initially emphasis delimiter markers (*, _, ~)\n// are treated as their own separate text tokens. Then emphasis rule either\n// leaves them as text (needed to merge with adjacent text) or turns them\n// into opening/closing tags (which messes up levels inside).\n//\n\nexport default function fragments_join (state) {\n let curr, last\n let level = 0\n const tokens = state.tokens\n const max = state.tokens.length\n\n for (curr = last = 0; curr < max; curr++) {\n // re-calculate levels after emphasis/strikethrough turns some text nodes\n // into opening/closing tags\n if (tokens[curr].nesting < 0) level-- // closing tag\n tokens[curr].level = level\n if (tokens[curr].nesting > 0) level++ // opening tag\n\n if (tokens[curr].type === 'text' &&\n curr + 1 < max &&\n tokens[curr + 1].type === 'text') {\n // collapse two adjacent text nodes\n tokens[curr + 1].content = tokens[curr].content + tokens[curr + 1].content\n } else {\n if (curr !== last) { tokens[last] = tokens[curr] }\n\n last++\n }\n }\n\n if (curr !== last) {\n tokens.length = last\n }\n}\n", "/** internal\n * class ParserInline\n *\n * Tokenizes paragraph content.\n **/\n\nimport Ruler from './ruler.mjs'\nimport StateInline from './rules_inline/state_inline.mjs'\n\nimport r_text from './rules_inline/text.mjs'\nimport r_linkify from './rules_inline/linkify.mjs'\nimport r_newline from './rules_inline/newline.mjs'\nimport r_escape from './rules_inline/escape.mjs'\nimport r_backticks from './rules_inline/backticks.mjs'\nimport r_strikethrough from './rules_inline/strikethrough.mjs'\nimport r_emphasis from './rules_inline/emphasis.mjs'\nimport r_link from './rules_inline/link.mjs'\nimport r_image from './rules_inline/image.mjs'\nimport r_autolink from './rules_inline/autolink.mjs'\nimport r_html_inline from './rules_inline/html_inline.mjs'\nimport r_entity from './rules_inline/entity.mjs'\n\nimport r_balance_pairs from './rules_inline/balance_pairs.mjs'\nimport r_fragments_join from './rules_inline/fragments_join.mjs'\n\n// Parser rules\n\nconst _rules = [\n ['text', r_text],\n ['linkify', r_linkify],\n ['newline', r_newline],\n ['escape', r_escape],\n ['backticks', r_backticks],\n ['strikethrough', r_strikethrough.tokenize],\n ['emphasis', r_emphasis.tokenize],\n ['link', r_link],\n ['image', r_image],\n ['autolink', r_autolink],\n ['html_inline', r_html_inline],\n ['entity', r_entity]\n]\n\n// `rule2` ruleset was created specifically for emphasis/strikethrough\n// post-processing and may be changed in the future.\n//\n// Don't use this for anything except pairs (plugins working with `balance_pairs`).\n//\nconst _rules2 = [\n ['balance_pairs', r_balance_pairs],\n ['strikethrough', r_strikethrough.postProcess],\n ['emphasis', r_emphasis.postProcess],\n // rules for pairs separate '**' into its own text tokens, which may be left unused,\n // rule below merges unused segments back with the rest of the text\n ['fragments_join', r_fragments_join]\n]\n\n/**\n * new ParserInline()\n **/\nfunction ParserInline () {\n /**\n * ParserInline#ruler -> Ruler\n *\n * [[Ruler]] instance. Keep configuration of inline rules.\n **/\n this.ruler = new Ruler()\n\n for (let i = 0; i < _rules.length; i++) {\n this.ruler.push(_rules[i][0], _rules[i][1])\n }\n\n /**\n * ParserInline#ruler2 -> Ruler\n *\n * [[Ruler]] instance. Second ruler used for post-processing\n * (e.g. in emphasis-like rules).\n **/\n this.ruler2 = new Ruler()\n\n for (let i = 0; i < _rules2.length; i++) {\n this.ruler2.push(_rules2[i][0], _rules2[i][1])\n }\n}\n\n// Skip single token by running all rules in validation mode;\n// returns `true` if any rule reported success\n//\nParserInline.prototype.skipToken = function (state) {\n const pos = state.pos\n const rules = this.ruler.getRules('')\n const len = rules.length\n const maxNesting = state.md.options.maxNesting\n const cache = state.cache\n\n if (typeof cache[pos] !== 'undefined') {\n state.pos = cache[pos]\n return\n }\n\n let ok = false\n\n if (state.level < maxNesting) {\n for (let i = 0; i < len; i++) {\n // Increment state.level and decrement it later to limit recursion.\n // It's harmless to do here, because no tokens are created. But ideally,\n // we'd need a separate private state variable for this purpose.\n //\n state.level++\n ok = rules[i](state, true)\n state.level--\n\n if (ok) {\n if (pos >= state.pos) { throw new Error(\"inline rule didn't increment state.pos\") }\n break\n }\n }\n } else {\n // Too much nesting, just skip until the end of the paragraph.\n //\n // NOTE: this will cause links to behave incorrectly in the following case,\n // when an amount of `[` is exactly equal to `maxNesting + 1`:\n //\n // [[[[[[[[[[[[[[[[[[[[[foo]()\n //\n // TODO: remove this workaround when CM standard will allow nested links\n // (we can replace it by preventing links from being parsed in\n // validation mode)\n //\n state.pos = state.posMax\n }\n\n if (!ok) { state.pos++ }\n cache[pos] = state.pos\n}\n\n// Generate tokens for input range\n//\nParserInline.prototype.tokenize = function (state) {\n const rules = this.ruler.getRules('')\n const len = rules.length\n const end = state.posMax\n const maxNesting = state.md.options.maxNesting\n\n while (state.pos < end) {\n // Try all possible rules.\n // On success, rule should:\n //\n // - update `state.pos`\n // - update `state.tokens`\n // - return true\n const prevPos = state.pos\n let ok = false\n\n if (state.level < maxNesting) {\n for (let i = 0; i < len; i++) {\n ok = rules[i](state, false)\n if (ok) {\n if (prevPos >= state.pos) { throw new Error(\"inline rule didn't increment state.pos\") }\n break\n }\n }\n }\n\n if (ok) {\n if (state.pos >= end) { break }\n continue\n }\n\n state.pending += state.src[state.pos++]\n }\n\n if (state.pending) {\n state.pushPending()\n }\n}\n\n/**\n * ParserInline.parse(str, md, env, outTokens)\n *\n * Process input string and push inline tokens into `outTokens`\n **/\nParserInline.prototype.parse = function (str, md, env, outTokens) {\n const state = new this.State(str, md, env, outTokens)\n\n this.tokenize(state)\n\n const rules = this.ruler2.getRules('')\n const len = rules.length\n\n for (let i = 0; i < len; i++) {\n rules[i](state)\n }\n}\n\nParserInline.prototype.State = StateInline\n\nexport default ParserInline\n", "import { Any, Cc, Z, P } from 'uc.micro'\n\nexport default function (opts) {\n const re = {}\n opts = opts || {}\n\n re.src_Any = Any.source\n re.src_Cc = Cc.source\n re.src_Z = Z.source\n re.src_P = P.source\n\n // \\p{\\Z\\P\\Cc\\CF} (white spaces + control + format + punctuation)\n re.src_ZPCc = [re.src_Z, re.src_P, re.src_Cc].join('|')\n\n // \\p{\\Z\\Cc} (white spaces + control)\n re.src_ZCc = [re.src_Z, re.src_Cc].join('|')\n\n // Experimental. List of chars, completely prohibited in links\n // because can separate it from other part of text\n const text_separators = '[><\\uff5c]'\n\n // All possible word characters (everything without punctuation, spaces & controls)\n // Defined via punctuation & spaces to save space\n // Should be something like \\p{\\L\\N\\S\\M} (\\w but without `_`)\n re.src_pseudo_letter = '(?:(?!' + text_separators + '|' + re.src_ZPCc + ')' + re.src_Any + ')'\n // The same as abothe but without [0-9]\n // var src_pseudo_letter_non_d = '(?:(?![0-9]|' + src_ZPCc + ')' + src_Any + ')';\n\n re.src_ip4 =\n\n '(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)'\n\n // Prohibit any of \"@/[]()\" in user/pass to avoid wrong domain fetch.\n re.src_auth = '(?:(?:(?!' + re.src_ZCc + '|[@/\\\\[\\\\]()]).)+@)?'\n\n re.src_port =\n\n '(?::(?:6(?:[0-4]\\\\d{3}|5(?:[0-4]\\\\d{2}|5(?:[0-2]\\\\d|3[0-5])))|[1-5]?\\\\d{1,4}))?'\n\n re.src_host_terminator =\n\n '(?=$|' + text_separators + '|' + re.src_ZPCc + ')' +\n '(?!' + (opts['---'] ? '-(?!--)|' : '-|') + '_|:\\\\d|\\\\.-|\\\\.(?!$|' + re.src_ZPCc + '))'\n\n re.src_path =\n\n '(?:' +\n '[/?#]' +\n '(?:' +\n '(?!' + re.src_ZCc + '|' + text_separators + '|[()[\\\\]{}.,\"\\'?!\\\\-;]).|' +\n '\\\\[(?:(?!' + re.src_ZCc + '|\\\\]).)*\\\\]|' +\n '\\\\((?:(?!' + re.src_ZCc + '|[)]).)*\\\\)|' +\n '\\\\{(?:(?!' + re.src_ZCc + '|[}]).)*\\\\}|' +\n '\\\\\"(?:(?!' + re.src_ZCc + '|[\"]).)+\\\\\"|' +\n \"\\\\'(?:(?!\" + re.src_ZCc + \"|[']).)+\\\\'|\" +\n\n // allow `I'm_king` if no pair found\n \"\\\\'(?=\" + re.src_pseudo_letter + '|[-])|' +\n\n // google has many dots in \"google search\" links (#66, #81).\n // github has ... in commit range links,\n // Restrict to\n // - english\n // - percent-encoded\n // - parts of file path\n // - params separator\n // until more examples found.\n '\\\\.{2,}[a-zA-Z0-9%/&]|' +\n\n '\\\\.(?!' + re.src_ZCc + '|[.]|$)|' +\n (opts['---']\n ? '\\\\-(?!--(?:[^-]|$))(?:-*)|' // `---` => long dash, terminate\n : '\\\\-+|'\n ) +\n // allow `,,,` in paths\n ',(?!' + re.src_ZCc + '|$)|' +\n\n // allow `;` if not followed by space-like char\n ';(?!' + re.src_ZCc + '|$)|' +\n\n // allow `!!!` in paths, but not at the end\n '\\\\!+(?!' + re.src_ZCc + '|[!]|$)|' +\n\n '\\\\?(?!' + re.src_ZCc + '|[?]|$)' +\n ')+' +\n '|\\\\/' +\n ')?'\n\n // Allow anything in markdown spec, forbid quote (\") at the first position\n // because emails enclosed in quotes are far more common\n re.src_email_name =\n\n '[\\\\-;:&=\\\\+\\\\$,\\\\.a-zA-Z0-9_][\\\\-;:&=\\\\+\\\\$,\\\\\"\\\\.a-zA-Z0-9_]*'\n\n re.src_xn =\n\n 'xn--[a-z0-9\\\\-]{1,59}'\n\n // More to read about domain names\n // http://serverfault.com/questions/638260/\n\n re.src_domain_root =\n\n // Allow letters & digits (http://test1)\n '(?:' +\n re.src_xn +\n '|' +\n re.src_pseudo_letter + '{1,63}' +\n ')'\n\n re.src_domain =\n\n '(?:' +\n re.src_xn +\n '|' +\n '(?:' + re.src_pseudo_letter + ')' +\n '|' +\n '(?:' + re.src_pseudo_letter + '(?:-|' + re.src_pseudo_letter + '){0,61}' + re.src_pseudo_letter + ')' +\n ')'\n\n re.src_host =\n\n '(?:' +\n // Don't need IP check, because digits are already allowed in normal domain names\n // src_ip4 +\n // '|' +\n '(?:(?:(?:' + re.src_domain + ')\\\\.)*' + re.src_domain/* _root */ + ')' +\n ')'\n\n re.tpl_host_fuzzy =\n\n '(?:' +\n re.src_ip4 +\n '|' +\n '(?:(?:(?:' + re.src_domain + ')\\\\.)+(?:%TLDS%))' +\n ')'\n\n re.tpl_host_no_ip_fuzzy =\n\n '(?:(?:(?:' + re.src_domain + ')\\\\.)+(?:%TLDS%))'\n\n re.src_host_strict =\n\n re.src_host + re.src_host_terminator\n\n re.tpl_host_fuzzy_strict =\n\n re.tpl_host_fuzzy + re.src_host_terminator\n\n re.src_host_port_strict =\n\n re.src_host + re.src_port + re.src_host_terminator\n\n re.tpl_host_port_fuzzy_strict =\n\n re.tpl_host_fuzzy + re.src_port + re.src_host_terminator\n\n re.tpl_host_port_no_ip_fuzzy_strict =\n\n re.tpl_host_no_ip_fuzzy + re.src_port + re.src_host_terminator\n\n //\n // Main rules\n //\n\n // Rude test fuzzy links by host, for quick deny\n re.tpl_host_fuzzy_test =\n\n 'localhost|www\\\\.|\\\\.\\\\d{1,3}\\\\.|(?:\\\\.(?:%TLDS%)(?:' + re.src_ZPCc + '|>|$))'\n\n re.tpl_email_fuzzy =\n\n '(^|' + text_separators + '|\"|\\\\(|' + re.src_ZCc + ')' +\n '(' + re.src_email_name + '@' + re.tpl_host_fuzzy_strict + ')'\n\n re.tpl_link_fuzzy =\n // Fuzzy link can't be prepended with .:/\\- and non punctuation.\n // but can start with > (markdown blockquote)\n '(^|(?![.:/\\\\-_@])(?:[$+<=>^`|\\uff5c]|' + re.src_ZPCc + '))' +\n '((?![$+<=>^`|\\uff5c])' + re.tpl_host_port_fuzzy_strict + re.src_path + ')'\n\n re.tpl_link_no_ip_fuzzy =\n // Fuzzy link can't be prepended with .:/\\- and non punctuation.\n // but can start with > (markdown blockquote)\n '(^|(?![.:/\\\\-_@])(?:[$+<=>^`|\\uff5c]|' + re.src_ZPCc + '))' +\n '((?![$+<=>^`|\\uff5c])' + re.tpl_host_port_no_ip_fuzzy_strict + re.src_path + ')'\n\n return re\n}\n", "import reFactory from './lib/re.mjs'\n\n//\n// Helpers\n//\n\n// Merge objects\n//\nfunction assign (obj /* from1, from2, from3, ... */) {\n const sources = Array.prototype.slice.call(arguments, 1)\n\n sources.forEach(function (source) {\n if (!source) { return }\n\n Object.keys(source).forEach(function (key) {\n obj[key] = source[key]\n })\n })\n\n return obj\n}\n\nfunction _class (obj) { return Object.prototype.toString.call(obj) }\nfunction isString (obj) { return _class(obj) === '[object String]' }\nfunction isObject (obj) { return _class(obj) === '[object Object]' }\nfunction isRegExp (obj) { return _class(obj) === '[object RegExp]' }\nfunction isFunction (obj) { return _class(obj) === '[object Function]' }\n\nfunction escapeRE (str) { return str.replace(/[.?*+^$[\\]\\\\(){}|-]/g, '\\\\$&') }\n\n//\n\nconst defaultOptions = {\n fuzzyLink: true,\n fuzzyEmail: true,\n fuzzyIP: false\n}\n\nfunction isOptionsObj (obj) {\n return Object.keys(obj || {}).reduce(function (acc, k) {\n /* eslint-disable-next-line no-prototype-builtins */\n return acc || defaultOptions.hasOwnProperty(k)\n }, false)\n}\n\nconst defaultSchemas = {\n 'http:': {\n validate: function (text, pos, self) {\n const tail = text.slice(pos)\n\n if (!self.re.http) {\n // compile lazily, because \"host\"-containing variables can change on tlds update.\n self.re.http = new RegExp(\n '^\\\\/\\\\/' + self.re.src_auth + self.re.src_host_port_strict + self.re.src_path, 'i'\n )\n }\n if (self.re.http.test(tail)) {\n return tail.match(self.re.http)[0].length\n }\n return 0\n }\n },\n 'https:': 'http:',\n 'ftp:': 'http:',\n '//': {\n validate: function (text, pos, self) {\n const tail = text.slice(pos)\n\n if (!self.re.no_http) {\n // compile lazily, because \"host\"-containing variables can change on tlds update.\n self.re.no_http = new RegExp(\n '^' +\n self.re.src_auth +\n // Don't allow single-level domains, because of false positives like '//test'\n // with code comments\n '(?:localhost|(?:(?:' + self.re.src_domain + ')\\\\.)+' + self.re.src_domain_root + ')' +\n self.re.src_port +\n self.re.src_host_terminator +\n self.re.src_path,\n\n 'i'\n )\n }\n\n if (self.re.no_http.test(tail)) {\n // should not be `://` & `///`, that protects from errors in protocol name\n if (pos >= 3 && text[pos - 3] === ':') { return 0 }\n if (pos >= 3 && text[pos - 3] === '/') { return 0 }\n return tail.match(self.re.no_http)[0].length\n }\n return 0\n }\n },\n 'mailto:': {\n validate: function (text, pos, self) {\n const tail = text.slice(pos)\n\n if (!self.re.mailto) {\n self.re.mailto = new RegExp(\n '^' + self.re.src_email_name + '@' + self.re.src_host_strict, 'i'\n )\n }\n if (self.re.mailto.test(tail)) {\n return tail.match(self.re.mailto)[0].length\n }\n return 0\n }\n }\n}\n\n// RE pattern for 2-character tlds (autogenerated by ./support/tlds_2char_gen.js)\n/* eslint-disable-next-line max-len */\nconst tlds_2ch_src_re = 'a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]'\n\n// DON'T try to make PRs with changes. Extend TLDs with LinkifyIt.tlds() instead\nconst tlds_default = 'biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|\u0440\u0444'.split('|')\n\nfunction resetScanCache (self) {\n self.__index__ = -1\n self.__text_cache__ = ''\n}\n\nfunction createValidator (re) {\n return function (text, pos) {\n const tail = text.slice(pos)\n\n if (re.test(tail)) {\n return tail.match(re)[0].length\n }\n return 0\n }\n}\n\nfunction createNormalizer () {\n return function (match, self) {\n self.normalize(match)\n }\n}\n\n// Schemas compiler. Build regexps.\n//\nfunction compile (self) {\n // Load & clone RE patterns.\n const re = self.re = reFactory(self.__opts__)\n\n // Define dynamic patterns\n const tlds = self.__tlds__.slice()\n\n self.onCompile()\n\n if (!self.__tlds_replaced__) {\n tlds.push(tlds_2ch_src_re)\n }\n tlds.push(re.src_xn)\n\n re.src_tlds = tlds.join('|')\n\n function untpl (tpl) { return tpl.replace('%TLDS%', re.src_tlds) }\n\n re.email_fuzzy = RegExp(untpl(re.tpl_email_fuzzy), 'i')\n re.link_fuzzy = RegExp(untpl(re.tpl_link_fuzzy), 'i')\n re.link_no_ip_fuzzy = RegExp(untpl(re.tpl_link_no_ip_fuzzy), 'i')\n re.host_fuzzy_test = RegExp(untpl(re.tpl_host_fuzzy_test), 'i')\n\n //\n // Compile each schema\n //\n\n const aliases = []\n\n self.__compiled__ = {} // Reset compiled data\n\n function schemaError (name, val) {\n throw new Error('(LinkifyIt) Invalid schema \"' + name + '\": ' + val)\n }\n\n Object.keys(self.__schemas__).forEach(function (name) {\n const val = self.__schemas__[name]\n\n // skip disabled methods\n if (val === null) { return }\n\n const compiled = { validate: null, link: null }\n\n self.__compiled__[name] = compiled\n\n if (isObject(val)) {\n if (isRegExp(val.validate)) {\n compiled.validate = createValidator(val.validate)\n } else if (isFunction(val.validate)) {\n compiled.validate = val.validate\n } else {\n schemaError(name, val)\n }\n\n if (isFunction(val.normalize)) {\n compiled.normalize = val.normalize\n } else if (!val.normalize) {\n compiled.normalize = createNormalizer()\n } else {\n schemaError(name, val)\n }\n\n return\n }\n\n if (isString(val)) {\n aliases.push(name)\n return\n }\n\n schemaError(name, val)\n })\n\n //\n // Compile postponed aliases\n //\n\n aliases.forEach(function (alias) {\n if (!self.__compiled__[self.__schemas__[alias]]) {\n // Silently fail on missed schemas to avoid errons on disable.\n // schemaError(alias, self.__schemas__[alias]);\n return\n }\n\n self.__compiled__[alias].validate =\n self.__compiled__[self.__schemas__[alias]].validate\n self.__compiled__[alias].normalize =\n self.__compiled__[self.__schemas__[alias]].normalize\n })\n\n //\n // Fake record for guessed links\n //\n self.__compiled__[''] = { validate: null, normalize: createNormalizer() }\n\n //\n // Build schema condition\n //\n const slist = Object.keys(self.__compiled__)\n .filter(function (name) {\n // Filter disabled & fake schemas\n return name.length > 0 && self.__compiled__[name]\n })\n .map(escapeRE)\n .join('|')\n // (?!_) cause 1.5x slowdown\n self.re.schema_test = RegExp('(^|(?!_)(?:[><\\uff5c]|' + re.src_ZPCc + '))(' + slist + ')', 'i')\n self.re.schema_search = RegExp('(^|(?!_)(?:[><\\uff5c]|' + re.src_ZPCc + '))(' + slist + ')', 'ig')\n self.re.schema_at_start = RegExp('^' + self.re.schema_search.source, 'i')\n\n self.re.pretest = RegExp(\n '(' + self.re.schema_test.source + ')|(' + self.re.host_fuzzy_test.source + ')|@',\n 'i'\n )\n\n //\n // Cleanup\n //\n\n resetScanCache(self)\n}\n\n/**\n * class Match\n *\n * Match result. Single element of array, returned by [[LinkifyIt#match]]\n **/\nfunction Match (self, shift) {\n const start = self.__index__\n const end = self.__last_index__\n const text = self.__text_cache__.slice(start, end)\n\n /**\n * Match#schema -> String\n *\n * Prefix (protocol) for matched string.\n **/\n this.schema = self.__schema__.toLowerCase()\n /**\n * Match#index -> Number\n *\n * First position of matched string.\n **/\n this.index = start + shift\n /**\n * Match#lastIndex -> Number\n *\n * Next position after matched string.\n **/\n this.lastIndex = end + shift\n /**\n * Match#raw -> String\n *\n * Matched string.\n **/\n this.raw = text\n /**\n * Match#text -> String\n *\n * Notmalized text of matched string.\n **/\n this.text = text\n /**\n * Match#url -> String\n *\n * Normalized url of matched string.\n **/\n this.url = text\n}\n\nfunction createMatch (self, shift) {\n const match = new Match(self, shift)\n\n self.__compiled__[match.schema].normalize(match, self)\n\n return match\n}\n\n/**\n * class LinkifyIt\n **/\n\n/**\n * new LinkifyIt(schemas, options)\n * - schemas (Object): Optional. Additional schemas to validate (prefix/validator)\n * - options (Object): { fuzzyLink|fuzzyEmail|fuzzyIP: true|false }\n *\n * Creates new linkifier instance with optional additional schemas.\n * Can be called without `new` keyword for convenience.\n *\n * By default understands:\n *\n * - `http(s)://...` , `ftp://...`, `mailto:...` & `//...` links\n * - \"fuzzy\" links and emails (example.com, foo@bar.com).\n *\n * `schemas` is an object, where each key/value describes protocol/rule:\n *\n * - __key__ - link prefix (usually, protocol name with `:` at the end, `skype:`\n * for example). `linkify-it` makes shure that prefix is not preceeded with\n * alphanumeric char and symbols. Only whitespaces and punctuation allowed.\n * - __value__ - rule to check tail after link prefix\n * - _String_ - just alias to existing rule\n * - _Object_\n * - _validate_ - validator function (should return matched length on success),\n * or `RegExp`.\n * - _normalize_ - optional function to normalize text & url of matched result\n * (for example, for @twitter mentions).\n *\n * `options`:\n *\n * - __fuzzyLink__ - recognige URL-s without `http(s):` prefix. Default `true`.\n * - __fuzzyIP__ - allow IPs in fuzzy links above. Can conflict with some texts\n * like version numbers. Default `false`.\n * - __fuzzyEmail__ - recognize emails without `mailto:` prefix.\n *\n **/\nfunction LinkifyIt (schemas, options) {\n if (!(this instanceof LinkifyIt)) {\n return new LinkifyIt(schemas, options)\n }\n\n if (!options) {\n if (isOptionsObj(schemas)) {\n options = schemas\n schemas = {}\n }\n }\n\n this.__opts__ = assign({}, defaultOptions, options)\n\n // Cache last tested result. Used to skip repeating steps on next `match` call.\n this.__index__ = -1\n this.__last_index__ = -1 // Next scan position\n this.__schema__ = ''\n this.__text_cache__ = ''\n\n this.__schemas__ = assign({}, defaultSchemas, schemas)\n this.__compiled__ = {}\n\n this.__tlds__ = tlds_default\n this.__tlds_replaced__ = false\n\n this.re = {}\n\n compile(this)\n}\n\n/** chainable\n * LinkifyIt#add(schema, definition)\n * - schema (String): rule name (fixed pattern prefix)\n * - definition (String|RegExp|Object): schema definition\n *\n * Add new rule definition. See constructor description for details.\n **/\nLinkifyIt.prototype.add = function add (schema, definition) {\n this.__schemas__[schema] = definition\n compile(this)\n return this\n}\n\n/** chainable\n * LinkifyIt#set(options)\n * - options (Object): { fuzzyLink|fuzzyEmail|fuzzyIP: true|false }\n *\n * Set recognition options for links without schema.\n **/\nLinkifyIt.prototype.set = function set (options) {\n this.__opts__ = assign(this.__opts__, options)\n return this\n}\n\n/**\n * LinkifyIt#test(text) -> Boolean\n *\n * Searches linkifiable pattern and returns `true` on success or `false` on fail.\n **/\nLinkifyIt.prototype.test = function test (text) {\n // Reset scan cache\n this.__text_cache__ = text\n this.__index__ = -1\n\n if (!text.length) { return false }\n\n let m, ml, me, len, shift, next, re, tld_pos, at_pos\n\n // try to scan for link with schema - that's the most simple rule\n if (this.re.schema_test.test(text)) {\n re = this.re.schema_search\n re.lastIndex = 0\n while ((m = re.exec(text)) !== null) {\n len = this.testSchemaAt(text, m[2], re.lastIndex)\n if (len) {\n this.__schema__ = m[2]\n this.__index__ = m.index + m[1].length\n this.__last_index__ = m.index + m[0].length + len\n break\n }\n }\n }\n\n if (this.__opts__.fuzzyLink && this.__compiled__['http:']) {\n // guess schemaless links\n tld_pos = text.search(this.re.host_fuzzy_test)\n if (tld_pos >= 0) {\n // if tld is located after found link - no need to check fuzzy pattern\n if (this.__index__ < 0 || tld_pos < this.__index__) {\n if ((ml = text.match(this.__opts__.fuzzyIP ? this.re.link_fuzzy : this.re.link_no_ip_fuzzy)) !== null) {\n shift = ml.index + ml[1].length\n\n if (this.__index__ < 0 || shift < this.__index__) {\n this.__schema__ = ''\n this.__index__ = shift\n this.__last_index__ = ml.index + ml[0].length\n }\n }\n }\n }\n }\n\n if (this.__opts__.fuzzyEmail && this.__compiled__['mailto:']) {\n // guess schemaless emails\n at_pos = text.indexOf('@')\n if (at_pos >= 0) {\n // We can't skip this check, because this cases are possible:\n // 192.168.1.1@gmail.com, my.in@example.com\n if ((me = text.match(this.re.email_fuzzy)) !== null) {\n shift = me.index + me[1].length\n next = me.index + me[0].length\n\n if (this.__index__ < 0 || shift < this.__index__ ||\n (shift === this.__index__ && next > this.__last_index__)) {\n this.__schema__ = 'mailto:'\n this.__index__ = shift\n this.__last_index__ = next\n }\n }\n }\n }\n\n return this.__index__ >= 0\n}\n\n/**\n * LinkifyIt#pretest(text) -> Boolean\n *\n * Very quick check, that can give false positives. Returns true if link MAY BE\n * can exists. Can be used for speed optimization, when you need to check that\n * link NOT exists.\n **/\nLinkifyIt.prototype.pretest = function pretest (text) {\n return this.re.pretest.test(text)\n}\n\n/**\n * LinkifyIt#testSchemaAt(text, name, position) -> Number\n * - text (String): text to scan\n * - name (String): rule (schema) name\n * - position (Number): text offset to check from\n *\n * Similar to [[LinkifyIt#test]] but checks only specific protocol tail exactly\n * at given position. Returns length of found pattern (0 on fail).\n **/\nLinkifyIt.prototype.testSchemaAt = function testSchemaAt (text, schema, pos) {\n // If not supported schema check requested - terminate\n if (!this.__compiled__[schema.toLowerCase()]) {\n return 0\n }\n return this.__compiled__[schema.toLowerCase()].validate(text, pos, this)\n}\n\n/**\n * LinkifyIt#match(text) -> Array|null\n *\n * Returns array of found link descriptions or `null` on fail. We strongly\n * recommend to use [[LinkifyIt#test]] first, for best speed.\n *\n * ##### Result match description\n *\n * - __schema__ - link schema, can be empty for fuzzy links, or `//` for\n * protocol-neutral links.\n * - __index__ - offset of matched text\n * - __lastIndex__ - index of next char after mathch end\n * - __raw__ - matched text\n * - __text__ - normalized text\n * - __url__ - link, generated from matched text\n **/\nLinkifyIt.prototype.match = function match (text) {\n const result = []\n let shift = 0\n\n // Try to take previous element from cache, if .test() called before\n if (this.__index__ >= 0 && this.__text_cache__ === text) {\n result.push(createMatch(this, shift))\n shift = this.__last_index__\n }\n\n // Cut head if cache was used\n let tail = shift ? text.slice(shift) : text\n\n // Scan string until end reached\n while (this.test(tail)) {\n result.push(createMatch(this, shift))\n\n tail = tail.slice(this.__last_index__)\n shift += this.__last_index__\n }\n\n if (result.length) {\n return result\n }\n\n return null\n}\n\n/**\n * LinkifyIt#matchAtStart(text) -> Match|null\n *\n * Returns fully-formed (not fuzzy) link if it starts at the beginning\n * of the string, and null otherwise.\n **/\nLinkifyIt.prototype.matchAtStart = function matchAtStart (text) {\n // Reset scan cache\n this.__text_cache__ = text\n this.__index__ = -1\n\n if (!text.length) return null\n\n const m = this.re.schema_at_start.exec(text)\n if (!m) return null\n\n const len = this.testSchemaAt(text, m[2], m[0].length)\n if (!len) return null\n\n this.__schema__ = m[2]\n this.__index__ = m.index + m[1].length\n this.__last_index__ = m.index + m[0].length + len\n\n return createMatch(this, 0)\n}\n\n/** chainable\n * LinkifyIt#tlds(list [, keepOld]) -> this\n * - list (Array): list of tlds\n * - keepOld (Boolean): merge with current list if `true` (`false` by default)\n *\n * Load (or merge) new tlds list. Those are user for fuzzy links (without prefix)\n * to avoid false positives. By default this algorythm used:\n *\n * - hostname with any 2-letter root zones are ok.\n * - biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|\u0440\u0444\n * are ok.\n * - encoded (`xn--...`) root zones are ok.\n *\n * If list is replaced, then exact match for 2-chars root zones will be checked.\n **/\nLinkifyIt.prototype.tlds = function tlds (list, keepOld) {\n list = Array.isArray(list) ? list : [list]\n\n if (!keepOld) {\n this.__tlds__ = list.slice()\n this.__tlds_replaced__ = true\n compile(this)\n return this\n }\n\n this.__tlds__ = this.__tlds__.concat(list)\n .sort()\n .filter(function (el, idx, arr) {\n return el !== arr[idx - 1]\n })\n .reverse()\n\n compile(this)\n return this\n}\n\n/**\n * LinkifyIt#normalize(match)\n *\n * Default normalizer (if schema does not define it's own).\n **/\nLinkifyIt.prototype.normalize = function normalize (match) {\n // Do minimal possible changes by default. Need to collect feedback prior\n // to move forward https://github.com/markdown-it/linkify-it/issues/1\n\n if (!match.schema) { match.url = 'http://' + match.url }\n\n if (match.schema === 'mailto:' && !/^mailto:/i.test(match.url)) {\n match.url = 'mailto:' + match.url\n }\n}\n\n/**\n * LinkifyIt#onCompile()\n *\n * Override to modify basic RegExp-s.\n **/\nLinkifyIt.prototype.onCompile = function onCompile () {\n}\n\nexport default LinkifyIt\n", "'use strict';\n\n/** Highest positive signed 32-bit float value */\nconst maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1\n\n/** Bootstring parameters */\nconst base = 36;\nconst tMin = 1;\nconst tMax = 26;\nconst skew = 38;\nconst damp = 700;\nconst initialBias = 72;\nconst initialN = 128; // 0x80\nconst delimiter = '-'; // '\\x2D'\n\n/** Regular expressions */\nconst regexPunycode = /^xn--/;\nconst regexNonASCII = /[^\\0-\\x7F]/; // Note: U+007F DEL is excluded too.\nconst regexSeparators = /[\\x2E\\u3002\\uFF0E\\uFF61]/g; // RFC 3490 separators\n\n/** Error messages */\nconst errors = {\n\t'overflow': 'Overflow: input needs wider integers to process',\n\t'not-basic': 'Illegal input >= 0x80 (not a basic code point)',\n\t'invalid-input': 'Invalid input'\n};\n\n/** Convenience shortcuts */\nconst baseMinusTMin = base - tMin;\nconst floor = Math.floor;\nconst stringFromCharCode = String.fromCharCode;\n\n/*--------------------------------------------------------------------------*/\n\n/**\n * A generic error utility function.\n * @private\n * @param {String} type The error type.\n * @returns {Error} Throws a `RangeError` with the applicable error message.\n */\nfunction error(type) {\n\tthrow new RangeError(errors[type]);\n}\n\n/**\n * A generic `Array#map` utility function.\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} callback The function that gets called for every array\n * item.\n * @returns {Array} A new array of values returned by the callback function.\n */\nfunction map(array, callback) {\n\tconst result = [];\n\tlet length = array.length;\n\twhile (length--) {\n\t\tresult[length] = callback(array[length]);\n\t}\n\treturn result;\n}\n\n/**\n * A simple `Array#map`-like wrapper to work with domain name strings or email\n * addresses.\n * @private\n * @param {String} domain The domain name or email address.\n * @param {Function} callback The function that gets called for every\n * character.\n * @returns {String} A new string of characters returned by the callback\n * function.\n */\nfunction mapDomain(domain, callback) {\n\tconst parts = domain.split('@');\n\tlet result = '';\n\tif (parts.length > 1) {\n\t\t// In email addresses, only the domain name should be punycoded. Leave\n\t\t// the local part (i.e. everything up to `@`) intact.\n\t\tresult = parts[0] + '@';\n\t\tdomain = parts[1];\n\t}\n\t// Avoid `split(regex)` for IE8 compatibility. See #17.\n\tdomain = domain.replace(regexSeparators, '\\x2E');\n\tconst labels = domain.split('.');\n\tconst encoded = map(labels, callback).join('.');\n\treturn result + encoded;\n}\n\n/**\n * Creates an array containing the numeric code points of each Unicode\n * character in the string. While JavaScript uses UCS-2 internally,\n * this function will convert a pair of surrogate halves (each of which\n * UCS-2 exposes as separate characters) into a single code point,\n * matching UTF-16.\n * @see `punycode.ucs2.encode`\n * @see <https://mathiasbynens.be/notes/javascript-encoding>\n * @memberOf punycode.ucs2\n * @name decode\n * @param {String} string The Unicode input string (UCS-2).\n * @returns {Array} The new array of code points.\n */\nfunction ucs2decode(string) {\n\tconst output = [];\n\tlet counter = 0;\n\tconst length = string.length;\n\twhile (counter < length) {\n\t\tconst value = string.charCodeAt(counter++);\n\t\tif (value >= 0xD800 && value <= 0xDBFF && counter < length) {\n\t\t\t// It's a high surrogate, and there is a next character.\n\t\t\tconst extra = string.charCodeAt(counter++);\n\t\t\tif ((extra & 0xFC00) == 0xDC00) { // Low surrogate.\n\t\t\t\toutput.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);\n\t\t\t} else {\n\t\t\t\t// It's an unmatched surrogate; only append this code unit, in case the\n\t\t\t\t// next code unit is the high surrogate of a surrogate pair.\n\t\t\t\toutput.push(value);\n\t\t\t\tcounter--;\n\t\t\t}\n\t\t} else {\n\t\t\toutput.push(value);\n\t\t}\n\t}\n\treturn output;\n}\n\n/**\n * Creates a string based on an array of numeric code points.\n * @see `punycode.ucs2.decode`\n * @memberOf punycode.ucs2\n * @name encode\n * @param {Array} codePoints The array of numeric code points.\n * @returns {String} The new Unicode string (UCS-2).\n */\nconst ucs2encode = codePoints => String.fromCodePoint(...codePoints);\n\n/**\n * Converts a basic code point into a digit/integer.\n * @see `digitToBasic()`\n * @private\n * @param {Number} codePoint The basic numeric code point value.\n * @returns {Number} The numeric value of a basic code point (for use in\n * representing integers) in the range `0` to `base - 1`, or `base` if\n * the code point does not represent a value.\n */\nconst basicToDigit = function(codePoint) {\n\tif (codePoint >= 0x30 && codePoint < 0x3A) {\n\t\treturn 26 + (codePoint - 0x30);\n\t}\n\tif (codePoint >= 0x41 && codePoint < 0x5B) {\n\t\treturn codePoint - 0x41;\n\t}\n\tif (codePoint >= 0x61 && codePoint < 0x7B) {\n\t\treturn codePoint - 0x61;\n\t}\n\treturn base;\n};\n\n/**\n * Converts a digit/integer into a basic code point.\n * @see `basicToDigit()`\n * @private\n * @param {Number} digit The numeric value of a basic code point.\n * @returns {Number} The basic code point whose value (when used for\n * representing integers) is `digit`, which needs to be in the range\n * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is\n * used; else, the lowercase form is used. The behavior is undefined\n * if `flag` is non-zero and `digit` has no uppercase form.\n */\nconst digitToBasic = function(digit, flag) {\n\t// 0..25 map to ASCII a..z or A..Z\n\t// 26..35 map to ASCII 0..9\n\treturn digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);\n};\n\n/**\n * Bias adaptation function as per section 3.4 of RFC 3492.\n * https://tools.ietf.org/html/rfc3492#section-3.4\n * @private\n */\nconst adapt = function(delta, numPoints, firstTime) {\n\tlet k = 0;\n\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\tdelta += floor(delta / numPoints);\n\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\tdelta = floor(delta / baseMinusTMin);\n\t}\n\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n};\n\n/**\n * Converts a Punycode string of ASCII-only symbols to a string of Unicode\n * symbols.\n * @memberOf punycode\n * @param {String} input The Punycode string of ASCII-only symbols.\n * @returns {String} The resulting string of Unicode symbols.\n */\nconst decode = function(input) {\n\t// Don't use UCS-2.\n\tconst output = [];\n\tconst inputLength = input.length;\n\tlet i = 0;\n\tlet n = initialN;\n\tlet bias = initialBias;\n\n\t// Handle the basic code points: let `basic` be the number of input code\n\t// points before the last delimiter, or `0` if there is none, then copy\n\t// the first basic code points to the output.\n\n\tlet basic = input.lastIndexOf(delimiter);\n\tif (basic < 0) {\n\t\tbasic = 0;\n\t}\n\n\tfor (let j = 0; j < basic; ++j) {\n\t\t// if it's not a basic code point\n\t\tif (input.charCodeAt(j) >= 0x80) {\n\t\t\terror('not-basic');\n\t\t}\n\t\toutput.push(input.charCodeAt(j));\n\t}\n\n\t// Main decoding loop: start just after the last delimiter if any basic code\n\t// points were copied; start at the beginning otherwise.\n\n\tfor (let index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) {\n\n\t\t// `index` is the index of the next character to be consumed.\n\t\t// Decode a generalized variable-length integer into `delta`,\n\t\t// which gets added to `i`. The overflow checking is easier\n\t\t// if we increase `i` as we go, then subtract off its starting\n\t\t// value at the end to obtain `delta`.\n\t\tconst oldi = i;\n\t\tfor (let w = 1, k = base; /* no condition */; k += base) {\n\n\t\t\tif (index >= inputLength) {\n\t\t\t\terror('invalid-input');\n\t\t\t}\n\n\t\t\tconst digit = basicToDigit(input.charCodeAt(index++));\n\n\t\t\tif (digit >= base) {\n\t\t\t\terror('invalid-input');\n\t\t\t}\n\t\t\tif (digit > floor((maxInt - i) / w)) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\n\t\t\ti += digit * w;\n\t\t\tconst t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\n\t\t\tif (digit < t) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tconst baseMinusT = base - t;\n\t\t\tif (w > floor(maxInt / baseMinusT)) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\n\t\t\tw *= baseMinusT;\n\n\t\t}\n\n\t\tconst out = output.length + 1;\n\t\tbias = adapt(i - oldi, out, oldi == 0);\n\n\t\t// `i` was supposed to wrap around from `out` to `0`,\n\t\t// incrementing `n` each time, so we'll fix that now:\n\t\tif (floor(i / out) > maxInt - n) {\n\t\t\terror('overflow');\n\t\t}\n\n\t\tn += floor(i / out);\n\t\ti %= out;\n\n\t\t// Insert `n` at position `i` of the output.\n\t\toutput.splice(i++, 0, n);\n\n\t}\n\n\treturn String.fromCodePoint(...output);\n};\n\n/**\n * Converts a string of Unicode symbols (e.g. a domain name label) to a\n * Punycode string of ASCII-only symbols.\n * @memberOf punycode\n * @param {String} input The string of Unicode symbols.\n * @returns {String} The resulting Punycode string of ASCII-only symbols.\n */\nconst encode = function(input) {\n\tconst output = [];\n\n\t// Convert the input in UCS-2 to an array of Unicode code points.\n\tinput = ucs2decode(input);\n\n\t// Cache the length.\n\tconst inputLength = input.length;\n\n\t// Initialize the state.\n\tlet n = initialN;\n\tlet delta = 0;\n\tlet bias = initialBias;\n\n\t// Handle the basic code points.\n\tfor (const currentValue of input) {\n\t\tif (currentValue < 0x80) {\n\t\t\toutput.push(stringFromCharCode(currentValue));\n\t\t}\n\t}\n\n\tconst basicLength = output.length;\n\tlet handledCPCount = basicLength;\n\n\t// `handledCPCount` is the number of code points that have been handled;\n\t// `basicLength` is the number of basic code points.\n\n\t// Finish the basic string with a delimiter unless it's empty.\n\tif (basicLength) {\n\t\toutput.push(delimiter);\n\t}\n\n\t// Main encoding loop:\n\twhile (handledCPCount < inputLength) {\n\n\t\t// All non-basic code points < n have been handled already. Find the next\n\t\t// larger one:\n\t\tlet m = maxInt;\n\t\tfor (const currentValue of input) {\n\t\t\tif (currentValue >= n && currentValue < m) {\n\t\t\t\tm = currentValue;\n\t\t\t}\n\t\t}\n\n\t\t// Increase `delta` enough to advance the decoder's <n,i> state to <m,0>,\n\t\t// but guard against overflow.\n\t\tconst handledCPCountPlusOne = handledCPCount + 1;\n\t\tif (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {\n\t\t\terror('overflow');\n\t\t}\n\n\t\tdelta += (m - n) * handledCPCountPlusOne;\n\t\tn = m;\n\n\t\tfor (const currentValue of input) {\n\t\t\tif (currentValue < n && ++delta > maxInt) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\t\t\tif (currentValue === n) {\n\t\t\t\t// Represent delta as a generalized variable-length integer.\n\t\t\t\tlet q = delta;\n\t\t\t\tfor (let k = base; /* no condition */; k += base) {\n\t\t\t\t\tconst t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\t\t\t\t\tif (q < t) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tconst qMinusT = q - t;\n\t\t\t\t\tconst baseMinusT = base - t;\n\t\t\t\t\toutput.push(\n\t\t\t\t\t\tstringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))\n\t\t\t\t\t);\n\t\t\t\t\tq = floor(qMinusT / baseMinusT);\n\t\t\t\t}\n\n\t\t\t\toutput.push(stringFromCharCode(digitToBasic(q, 0)));\n\t\t\t\tbias = adapt(delta, handledCPCountPlusOne, handledCPCount === basicLength);\n\t\t\t\tdelta = 0;\n\t\t\t\t++handledCPCount;\n\t\t\t}\n\t\t}\n\n\t\t++delta;\n\t\t++n;\n\n\t}\n\treturn output.join('');\n};\n\n/**\n * Converts a Punycode string representing a domain name or an email address\n * to Unicode. Only the Punycoded parts of the input will be converted, i.e.\n * it doesn't matter if you call it on a string that has already been\n * converted to Unicode.\n * @memberOf punycode\n * @param {String} input The Punycoded domain name or email address to\n * convert to Unicode.\n * @returns {String} The Unicode representation of the given Punycode\n * string.\n */\nconst toUnicode = function(input) {\n\treturn mapDomain(input, function(string) {\n\t\treturn regexPunycode.test(string)\n\t\t\t? decode(string.slice(4).toLowerCase())\n\t\t\t: string;\n\t});\n};\n\n/**\n * Converts a Unicode string representing a domain name or an email address to\n * Punycode. Only the non-ASCII parts of the domain name will be converted,\n * i.e. it doesn't matter if you call it with a domain that's already in\n * ASCII.\n * @memberOf punycode\n * @param {String} input The domain name or email address to convert, as a\n * Unicode string.\n * @returns {String} The Punycode representation of the given domain name or\n * email address.\n */\nconst toASCII = function(input) {\n\treturn mapDomain(input, function(string) {\n\t\treturn regexNonASCII.test(string)\n\t\t\t? 'xn--' + encode(string)\n\t\t\t: string;\n\t});\n};\n\n/*--------------------------------------------------------------------------*/\n\n/** Define the public API */\nconst punycode = {\n\t/**\n\t * A string representing the current Punycode.js version number.\n\t * @memberOf punycode\n\t * @type String\n\t */\n\t'version': '2.3.1',\n\t/**\n\t * An object of methods to convert from JavaScript's internal character\n\t * representation (UCS-2) to Unicode code points, and back.\n\t * @see <https://mathiasbynens.be/notes/javascript-encoding>\n\t * @memberOf punycode\n\t * @type Object\n\t */\n\t'ucs2': {\n\t\t'decode': ucs2decode,\n\t\t'encode': ucs2encode\n\t},\n\t'decode': decode,\n\t'encode': encode,\n\t'toASCII': toASCII,\n\t'toUnicode': toUnicode\n};\n\nexport { ucs2decode, ucs2encode, decode, encode, toASCII, toUnicode };\nexport default punycode;\n", "// markdown-it default options\n\nexport default {\n options: {\n // Enable HTML tags in source\n html: false,\n\n // Use '/' to close single tags (<br />)\n xhtmlOut: false,\n\n // Convert '\\n' in paragraphs into <br>\n breaks: false,\n\n // CSS language prefix for fenced blocks\n langPrefix: 'language-',\n\n // autoconvert URL-like texts to links\n linkify: false,\n\n // Enable some language-neutral replacements + quotes beautification\n typographer: false,\n\n // Double + single quotes replacement pairs, when typographer enabled,\n // and smartquotes on. Could be either a String or an Array.\n //\n // For example, you can use '\u00AB\u00BB\u201E\u201C' for Russian, '\u201E\u201C\u201A\u2018' for German,\n // and ['\u00AB\\xA0', '\\xA0\u00BB', '\u2039\\xA0', '\\xA0\u203A'] for French (including nbsp).\n quotes: '\\u201c\\u201d\\u2018\\u2019', /* \u201C\u201D\u2018\u2019 */\n\n // Highlighter function. Should return escaped HTML,\n // or '' if the source string is not changed and should be escaped externaly.\n // If result starts with <pre... internal wrapper is skipped.\n //\n // function (/*str, lang*/) { return ''; }\n //\n highlight: null,\n\n // Internal protection, recursion limit\n maxNesting: 100\n },\n\n components: {\n core: {},\n block: {},\n inline: {}\n }\n}\n", "// \"Zero\" preset, with nothing enabled. Useful for manual configuring of simple\n// modes. For example, to parse bold/italic only.\n\nexport default {\n options: {\n // Enable HTML tags in source\n html: false,\n\n // Use '/' to close single tags (<br />)\n xhtmlOut: false,\n\n // Convert '\\n' in paragraphs into <br>\n breaks: false,\n\n // CSS language prefix for fenced blocks\n langPrefix: 'language-',\n\n // autoconvert URL-like texts to links\n linkify: false,\n\n // Enable some language-neutral replacements + quotes beautification\n typographer: false,\n\n // Double + single quotes replacement pairs, when typographer enabled,\n // and smartquotes on. Could be either a String or an Array.\n //\n // For example, you can use '\u00AB\u00BB\u201E\u201C' for Russian, '\u201E\u201C\u201A\u2018' for German,\n // and ['\u00AB\\xA0', '\\xA0\u00BB', '\u2039\\xA0', '\\xA0\u203A'] for French (including nbsp).\n quotes: '\\u201c\\u201d\\u2018\\u2019', /* \u201C\u201D\u2018\u2019 */\n\n // Highlighter function. Should return escaped HTML,\n // or '' if the source string is not changed and should be escaped externaly.\n // If result starts with <pre... internal wrapper is skipped.\n //\n // function (/*str, lang*/) { return ''; }\n //\n highlight: null,\n\n // Internal protection, recursion limit\n maxNesting: 20\n },\n\n components: {\n\n core: {\n rules: [\n 'normalize',\n 'block',\n 'inline',\n 'text_join'\n ]\n },\n\n block: {\n rules: [\n 'paragraph'\n ]\n },\n\n inline: {\n rules: [\n 'text'\n ],\n rules2: [\n 'balance_pairs',\n 'fragments_join'\n ]\n }\n }\n}\n", "// Commonmark default options\n\nexport default {\n options: {\n // Enable HTML tags in source\n html: true,\n\n // Use '/' to close single tags (<br />)\n xhtmlOut: true,\n\n // Convert '\\n' in paragraphs into <br>\n breaks: false,\n\n // CSS language prefix for fenced blocks\n langPrefix: 'language-',\n\n // autoconvert URL-like texts to links\n linkify: false,\n\n // Enable some language-neutral replacements + quotes beautification\n typographer: false,\n\n // Double + single quotes replacement pairs, when typographer enabled,\n // and smartquotes on. Could be either a String or an Array.\n //\n // For example, you can use '\u00AB\u00BB\u201E\u201C' for Russian, '\u201E\u201C\u201A\u2018' for German,\n // and ['\u00AB\\xA0', '\\xA0\u00BB', '\u2039\\xA0', '\\xA0\u203A'] for French (including nbsp).\n quotes: '\\u201c\\u201d\\u2018\\u2019', /* \u201C\u201D\u2018\u2019 */\n\n // Highlighter function. Should return escaped HTML,\n // or '' if the source string is not changed and should be escaped externaly.\n // If result starts with <pre... internal wrapper is skipped.\n //\n // function (/*str, lang*/) { return ''; }\n //\n highlight: null,\n\n // Internal protection, recursion limit\n maxNesting: 20\n },\n\n components: {\n\n core: {\n rules: [\n 'normalize',\n 'block',\n 'inline',\n 'text_join'\n ]\n },\n\n block: {\n rules: [\n 'blockquote',\n 'code',\n 'fence',\n 'heading',\n 'hr',\n 'html_block',\n 'lheading',\n 'list',\n 'reference',\n 'paragraph'\n ]\n },\n\n inline: {\n rules: [\n 'autolink',\n 'backticks',\n 'emphasis',\n 'entity',\n 'escape',\n 'html_inline',\n 'image',\n 'link',\n 'newline',\n 'text'\n ],\n rules2: [\n 'balance_pairs',\n 'emphasis',\n 'fragments_join'\n ]\n }\n }\n}\n", "// Main parser class\n\nimport * as utils from './common/utils.mjs'\nimport * as helpers from './helpers/index.mjs'\nimport Renderer from './renderer.mjs'\nimport ParserCore from './parser_core.mjs'\nimport ParserBlock from './parser_block.mjs'\nimport ParserInline from './parser_inline.mjs'\nimport LinkifyIt from 'linkify-it'\nimport * as mdurl from 'mdurl'\nimport punycode from 'punycode.js'\n\nimport cfg_default from './presets/default.mjs'\nimport cfg_zero from './presets/zero.mjs'\nimport cfg_commonmark from './presets/commonmark.mjs'\n\nconst config = {\n default: cfg_default,\n zero: cfg_zero,\n commonmark: cfg_commonmark\n}\n\n//\n// This validator can prohibit more than really needed to prevent XSS. It's a\n// tradeoff to keep code simple and to be secure by default.\n//\n// If you need different setup - override validator method as you wish. Or\n// replace it with dummy function and use external sanitizer.\n//\n\nconst BAD_PROTO_RE = /^(vbscript|javascript|file|data):/\nconst GOOD_DATA_RE = /^data:image\\/(gif|png|jpeg|webp);/\n\nfunction validateLink (url) {\n // url should be normalized at this point, and existing entities are decoded\n const str = url.trim().toLowerCase()\n\n return BAD_PROTO_RE.test(str) ? GOOD_DATA_RE.test(str) : true\n}\n\nconst RECODE_HOSTNAME_FOR = ['http:', 'https:', 'mailto:']\n\nfunction normalizeLink (url) {\n const parsed = mdurl.parse(url, true)\n\n if (parsed.hostname) {\n // Encode hostnames in urls like:\n // `http://host/`, `https://host/`, `mailto:user@host`, `//host/`\n //\n // We don't encode unknown schemas, because it's likely that we encode\n // something we shouldn't (e.g. `skype:name` treated as `skype:host`)\n //\n if (!parsed.protocol || RECODE_HOSTNAME_FOR.indexOf(parsed.protocol) >= 0) {\n try {\n parsed.hostname = punycode.toASCII(parsed.hostname)\n } catch (er) { /**/ }\n }\n }\n\n return mdurl.encode(mdurl.format(parsed))\n}\n\nfunction normalizeLinkText (url) {\n const parsed = mdurl.parse(url, true)\n\n if (parsed.hostname) {\n // Encode hostnames in urls like:\n // `http://host/`, `https://host/`, `mailto:user@host`, `//host/`\n //\n // We don't encode unknown schemas, because it's likely that we encode\n // something we shouldn't (e.g. `skype:name` treated as `skype:host`)\n //\n if (!parsed.protocol || RECODE_HOSTNAME_FOR.indexOf(parsed.protocol) >= 0) {\n try {\n parsed.hostname = punycode.toUnicode(parsed.hostname)\n } catch (er) { /**/ }\n }\n }\n\n // add '%' to exclude list because of https://github.com/markdown-it/markdown-it/issues/720\n return mdurl.decode(mdurl.format(parsed), mdurl.decode.defaultChars + '%')\n}\n\n/**\n * class MarkdownIt\n *\n * Main parser/renderer class.\n *\n * ##### Usage\n *\n * ```javascript\n * // node.js, \"classic\" way:\n * var MarkdownIt = require('markdown-it'),\n * md = new MarkdownIt();\n * var result = md.render('# markdown-it rulezz!');\n *\n * // node.js, the same, but with sugar:\n * var md = require('markdown-it')();\n * var result = md.render('# markdown-it rulezz!');\n *\n * // browser without AMD, added to \"window\" on script load\n * // Note, there are no dash.\n * var md = window.markdownit();\n * var result = md.render('# markdown-it rulezz!');\n * ```\n *\n * Single line rendering, without paragraph wrap:\n *\n * ```javascript\n * var md = require('markdown-it')();\n * var result = md.renderInline('__markdown-it__ rulezz!');\n * ```\n **/\n\n/**\n * new MarkdownIt([presetName, options])\n * - presetName (String): optional, `commonmark` / `zero`\n * - options (Object)\n *\n * Creates parser instanse with given config. Can be called without `new`.\n *\n * ##### presetName\n *\n * MarkdownIt provides named presets as a convenience to quickly\n * enable/disable active syntax rules and options for common use cases.\n *\n * - [\"commonmark\"](https://github.com/markdown-it/markdown-it/blob/master/lib/presets/commonmark.mjs) -\n * configures parser to strict [CommonMark](http://commonmark.org/) mode.\n * - [default](https://github.com/markdown-it/markdown-it/blob/master/lib/presets/default.mjs) -\n * similar to GFM, used when no preset name given. Enables all available rules,\n * but still without html, typographer & autolinker.\n * - [\"zero\"](https://github.com/markdown-it/markdown-it/blob/master/lib/presets/zero.mjs) -\n * all rules disabled. Useful to quickly setup your config via `.enable()`.\n * For example, when you need only `bold` and `italic` markup and nothing else.\n *\n * ##### options:\n *\n * - __html__ - `false`. Set `true` to enable HTML tags in source. Be careful!\n * That's not safe! You may need external sanitizer to protect output from XSS.\n * It's better to extend features via plugins, instead of enabling HTML.\n * - __xhtmlOut__ - `false`. Set `true` to add '/' when closing single tags\n * (`<br />`). This is needed only for full CommonMark compatibility. In real\n * world you will need HTML output.\n * - __breaks__ - `false`. Set `true` to convert `\\n` in paragraphs into `<br>`.\n * - __langPrefix__ - `language-`. CSS language class prefix for fenced blocks.\n * Can be useful for external highlighters.\n * - __linkify__ - `false`. Set `true` to autoconvert URL-like text to links.\n * - __typographer__ - `false`. Set `true` to enable [some language-neutral\n * replacement](https://github.com/markdown-it/markdown-it/blob/master/lib/rules_core/replacements.mjs) +\n * quotes beautification (smartquotes).\n * - __quotes__ - `\u201C\u201D\u2018\u2019`, String or Array. Double + single quotes replacement\n * pairs, when typographer enabled and smartquotes on. For example, you can\n * use `'\u00AB\u00BB\u201E\u201C'` for Russian, `'\u201E\u201C\u201A\u2018'` for German, and\n * `['\u00AB\\xA0', '\\xA0\u00BB', '\u2039\\xA0', '\\xA0\u203A']` for French (including nbsp).\n * - __highlight__ - `null`. Highlighter function for fenced code blocks.\n * Highlighter `function (str, lang)` should return escaped HTML. It can also\n * return empty string if the source was not changed and should be escaped\n * externaly. If result starts with <pre... internal wrapper is skipped.\n *\n * ##### Example\n *\n * ```javascript\n * // commonmark mode\n * var md = require('markdown-it')('commonmark');\n *\n * // default mode\n * var md = require('markdown-it')();\n *\n * // enable everything\n * var md = require('markdown-it')({\n * html: true,\n * linkify: true,\n * typographer: true\n * });\n * ```\n *\n * ##### Syntax highlighting\n *\n * ```js\n * var hljs = require('highlight.js') // https://highlightjs.org/\n *\n * var md = require('markdown-it')({\n * highlight: function (str, lang) {\n * if (lang && hljs.getLanguage(lang)) {\n * try {\n * return hljs.highlight(str, { language: lang, ignoreIllegals: true }).value;\n * } catch (__) {}\n * }\n *\n * return ''; // use external default escaping\n * }\n * });\n * ```\n *\n * Or with full wrapper override (if you need assign class to `<pre>` or `<code>`):\n *\n * ```javascript\n * var hljs = require('highlight.js') // https://highlightjs.org/\n *\n * // Actual default values\n * var md = require('markdown-it')({\n * highlight: function (str, lang) {\n * if (lang && hljs.getLanguage(lang)) {\n * try {\n * return '<pre><code class=\"hljs\">' +\n * hljs.highlight(str, { language: lang, ignoreIllegals: true }).value +\n * '</code></pre>';\n * } catch (__) {}\n * }\n *\n * return '<pre><code class=\"hljs\">' + md.utils.escapeHtml(str) + '</code></pre>';\n * }\n * });\n * ```\n *\n **/\nfunction MarkdownIt (presetName, options) {\n if (!(this instanceof MarkdownIt)) {\n return new MarkdownIt(presetName, options)\n }\n\n if (!options) {\n if (!utils.isString(presetName)) {\n options = presetName || {}\n presetName = 'default'\n }\n }\n\n /**\n * MarkdownIt#inline -> ParserInline\n *\n * Instance of [[ParserInline]]. You may need it to add new rules when\n * writing plugins. For simple rules control use [[MarkdownIt.disable]] and\n * [[MarkdownIt.enable]].\n **/\n this.inline = new ParserInline()\n\n /**\n * MarkdownIt#block -> ParserBlock\n *\n * Instance of [[ParserBlock]]. You may need it to add new rules when\n * writing plugins. For simple rules control use [[MarkdownIt.disable]] and\n * [[MarkdownIt.enable]].\n **/\n this.block = new ParserBlock()\n\n /**\n * MarkdownIt#core -> Core\n *\n * Instance of [[Core]] chain executor. You may need it to add new rules when\n * writing plugins. For simple rules control use [[MarkdownIt.disable]] and\n * [[MarkdownIt.enable]].\n **/\n this.core = new ParserCore()\n\n /**\n * MarkdownIt#renderer -> Renderer\n *\n * Instance of [[Renderer]]. Use it to modify output look. Or to add rendering\n * rules for new token types, generated by plugins.\n *\n * ##### Example\n *\n * ```javascript\n * var md = require('markdown-it')();\n *\n * function myToken(tokens, idx, options, env, self) {\n * //...\n * return result;\n * };\n *\n * md.renderer.rules['my_token'] = myToken\n * ```\n *\n * See [[Renderer]] docs and [source code](https://github.com/markdown-it/markdown-it/blob/master/lib/renderer.mjs).\n **/\n this.renderer = new Renderer()\n\n /**\n * MarkdownIt#linkify -> LinkifyIt\n *\n * [linkify-it](https://github.com/markdown-it/linkify-it) instance.\n * Used by [linkify](https://github.com/markdown-it/markdown-it/blob/master/lib/rules_core/linkify.mjs)\n * rule.\n **/\n this.linkify = new LinkifyIt()\n\n /**\n * MarkdownIt#validateLink(url) -> Boolean\n *\n * Link validation function. CommonMark allows too much in links. By default\n * we disable `javascript:`, `vbscript:`, `file:` schemas, and almost all `data:...` schemas\n * except some embedded image types.\n *\n * You can change this behaviour:\n *\n * ```javascript\n * var md = require('markdown-it')();\n * // enable everything\n * md.validateLink = function () { return true; }\n * ```\n **/\n this.validateLink = validateLink\n\n /**\n * MarkdownIt#normalizeLink(url) -> String\n *\n * Function used to encode link url to a machine-readable format,\n * which includes url-encoding, punycode, etc.\n **/\n this.normalizeLink = normalizeLink\n\n /**\n * MarkdownIt#normalizeLinkText(url) -> String\n *\n * Function used to decode link url to a human-readable format`\n **/\n this.normalizeLinkText = normalizeLinkText\n\n // Expose utils & helpers for easy acces from plugins\n\n /**\n * MarkdownIt#utils -> utils\n *\n * Assorted utility functions, useful to write plugins. See details\n * [here](https://github.com/markdown-it/markdown-it/blob/master/lib/common/utils.mjs).\n **/\n this.utils = utils\n\n /**\n * MarkdownIt#helpers -> helpers\n *\n * Link components parser functions, useful to write plugins. See details\n * [here](https://github.com/markdown-it/markdown-it/blob/master/lib/helpers).\n **/\n this.helpers = utils.assign({}, helpers)\n\n this.options = {}\n this.configure(presetName)\n\n if (options) { this.set(options) }\n}\n\n/** chainable\n * MarkdownIt.set(options)\n *\n * Set parser options (in the same format as in constructor). Probably, you\n * will never need it, but you can change options after constructor call.\n *\n * ##### Example\n *\n * ```javascript\n * var md = require('markdown-it')()\n * .set({ html: true, breaks: true })\n * .set({ typographer, true });\n * ```\n *\n * __Note:__ To achieve the best possible performance, don't modify a\n * `markdown-it` instance options on the fly. If you need multiple configurations\n * it's best to create multiple instances and initialize each with separate\n * config.\n **/\nMarkdownIt.prototype.set = function (options) {\n utils.assign(this.options, options)\n return this\n}\n\n/** chainable, internal\n * MarkdownIt.configure(presets)\n *\n * Batch load of all options and compenent settings. This is internal method,\n * and you probably will not need it. But if you will - see available presets\n * and data structure [here](https://github.com/markdown-it/markdown-it/tree/master/lib/presets)\n *\n * We strongly recommend to use presets instead of direct config loads. That\n * will give better compatibility with next versions.\n **/\nMarkdownIt.prototype.configure = function (presets) {\n const self = this\n\n if (utils.isString(presets)) {\n const presetName = presets\n presets = config[presetName]\n if (!presets) { throw new Error('Wrong `markdown-it` preset \"' + presetName + '\", check name') }\n }\n\n if (!presets) { throw new Error('Wrong `markdown-it` preset, can\\'t be empty') }\n\n if (presets.options) { self.set(presets.options) }\n\n if (presets.components) {\n Object.keys(presets.components).forEach(function (name) {\n if (presets.components[name].rules) {\n self[name].ruler.enableOnly(presets.components[name].rules)\n }\n if (presets.components[name].rules2) {\n self[name].ruler2.enableOnly(presets.components[name].rules2)\n }\n })\n }\n return this\n}\n\n/** chainable\n * MarkdownIt.enable(list, ignoreInvalid)\n * - list (String|Array): rule name or list of rule names to enable\n * - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found.\n *\n * Enable list or rules. It will automatically find appropriate components,\n * containing rules with given names. If rule not found, and `ignoreInvalid`\n * not set - throws exception.\n *\n * ##### Example\n *\n * ```javascript\n * var md = require('markdown-it')()\n * .enable(['sub', 'sup'])\n * .disable('smartquotes');\n * ```\n **/\nMarkdownIt.prototype.enable = function (list, ignoreInvalid) {\n let result = []\n\n if (!Array.isArray(list)) { list = [list] }\n\n ['core', 'block', 'inline'].forEach(function (chain) {\n result = result.concat(this[chain].ruler.enable(list, true))\n }, this)\n\n result = result.concat(this.inline.ruler2.enable(list, true))\n\n const missed = list.filter(function (name) { return result.indexOf(name) < 0 })\n\n if (missed.length && !ignoreInvalid) {\n throw new Error('MarkdownIt. Failed to enable unknown rule(s): ' + missed)\n }\n\n return this\n}\n\n/** chainable\n * MarkdownIt.disable(list, ignoreInvalid)\n * - list (String|Array): rule name or list of rule names to disable.\n * - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found.\n *\n * The same as [[MarkdownIt.enable]], but turn specified rules off.\n **/\nMarkdownIt.prototype.disable = function (list, ignoreInvalid) {\n let result = []\n\n if (!Array.isArray(list)) { list = [list] }\n\n ['core', 'block', 'inline'].forEach(function (chain) {\n result = result.concat(this[chain].ruler.disable(list, true))\n }, this)\n\n result = result.concat(this.inline.ruler2.disable(list, true))\n\n const missed = list.filter(function (name) { return result.indexOf(name) < 0 })\n\n if (missed.length && !ignoreInvalid) {\n throw new Error('MarkdownIt. Failed to disable unknown rule(s): ' + missed)\n }\n return this\n}\n\n/** chainable\n * MarkdownIt.use(plugin, params)\n *\n * Load specified plugin with given params into current parser instance.\n * It's just a sugar to call `plugin(md, params)` with curring.\n *\n * ##### Example\n *\n * ```javascript\n * var iterator = require('markdown-it-for-inline');\n * var md = require('markdown-it')()\n * .use(iterator, 'foo_replace', 'text', function (tokens, idx) {\n * tokens[idx].content = tokens[idx].content.replace(/foo/g, 'bar');\n * });\n * ```\n **/\nMarkdownIt.prototype.use = function (plugin /*, params, ... */) {\n const args = [this].concat(Array.prototype.slice.call(arguments, 1))\n plugin.apply(plugin, args)\n return this\n}\n\n/** internal\n * MarkdownIt.parse(src, env) -> Array\n * - src (String): source string\n * - env (Object): environment sandbox\n *\n * Parse input string and return list of block tokens (special token type\n * \"inline\" will contain list of inline tokens). You should not call this\n * method directly, until you write custom renderer (for example, to produce\n * AST).\n *\n * `env` is used to pass data between \"distributed\" rules and return additional\n * metadata like reference info, needed for the renderer. It also can be used to\n * inject data in specific cases. Usually, you will be ok to pass `{}`,\n * and then pass updated object to renderer.\n **/\nMarkdownIt.prototype.parse = function (src, env) {\n if (typeof src !== 'string') {\n throw new Error('Input data should be a String')\n }\n\n const state = new this.core.State(src, this, env)\n\n this.core.process(state)\n\n return state.tokens\n}\n\n/**\n * MarkdownIt.render(src [, env]) -> String\n * - src (String): source string\n * - env (Object): environment sandbox\n *\n * Render markdown string into html. It does all magic for you :).\n *\n * `env` can be used to inject additional metadata (`{}` by default).\n * But you will not need it with high probability. See also comment\n * in [[MarkdownIt.parse]].\n **/\nMarkdownIt.prototype.render = function (src, env) {\n env = env || {}\n\n return this.renderer.render(this.parse(src, env), this.options, env)\n}\n\n/** internal\n * MarkdownIt.parseInline(src, env) -> Array\n * - src (String): source string\n * - env (Object): environment sandbox\n *\n * The same as [[MarkdownIt.parse]] but skip all block rules. It returns the\n * block tokens list with the single `inline` element, containing parsed inline\n * tokens in `children` property. Also updates `env` object.\n **/\nMarkdownIt.prototype.parseInline = function (src, env) {\n const state = new this.core.State(src, this, env)\n\n state.inlineMode = true\n this.core.process(state)\n\n return state.tokens\n}\n\n/**\n * MarkdownIt.renderInline(src [, env]) -> String\n * - src (String): source string\n * - env (Object): environment sandbox\n *\n * Similar to [[MarkdownIt.render]] but for single paragraph content. Result\n * will NOT be wrapped into `<p>` tags.\n **/\nMarkdownIt.prototype.renderInline = function (src, env) {\n env = env || {}\n\n return this.renderer.render(this.parseInline(src, env), this.options, env)\n}\n\nexport default MarkdownIt\n", "import { Schema, Mark } from 'prosemirror-model';\nimport MarkdownIt from 'markdown-it';\n\n/**\nDocument schema for the data model used by CommonMark.\n*/\nconst schema = new Schema({\n nodes: {\n doc: {\n content: \"block+\"\n },\n paragraph: {\n content: \"inline*\",\n group: \"block\",\n parseDOM: [{ tag: \"p\" }],\n toDOM() { return [\"p\", 0]; }\n },\n blockquote: {\n content: \"block+\",\n group: \"block\",\n parseDOM: [{ tag: \"blockquote\" }],\n toDOM() { return [\"blockquote\", 0]; }\n },\n horizontal_rule: {\n group: \"block\",\n parseDOM: [{ tag: \"hr\" }],\n toDOM() { return [\"div\", [\"hr\"]]; }\n },\n heading: {\n attrs: { level: { default: 1 } },\n content: \"(text | image)*\",\n group: \"block\",\n defining: true,\n parseDOM: [{ tag: \"h1\", attrs: { level: 1 } },\n { tag: \"h2\", attrs: { level: 2 } },\n { tag: \"h3\", attrs: { level: 3 } },\n { tag: \"h4\", attrs: { level: 4 } },\n { tag: \"h5\", attrs: { level: 5 } },\n { tag: \"h6\", attrs: { level: 6 } }],\n toDOM(node) { return [\"h\" + node.attrs.level, 0]; }\n },\n code_block: {\n content: \"text*\",\n group: \"block\",\n code: true,\n defining: true,\n marks: \"\",\n attrs: { params: { default: \"\" } },\n parseDOM: [{ tag: \"pre\", preserveWhitespace: \"full\", getAttrs: node => ({ params: node.getAttribute(\"data-params\") || \"\" }) }],\n toDOM(node) { return [\"pre\", node.attrs.params ? { \"data-params\": node.attrs.params } : {}, [\"code\", 0]]; }\n },\n ordered_list: {\n content: \"list_item+\",\n group: \"block\",\n attrs: { order: { default: 1 }, tight: { default: false } },\n parseDOM: [{ tag: \"ol\", getAttrs(dom) {\n return { order: dom.hasAttribute(\"start\") ? +dom.getAttribute(\"start\") : 1,\n tight: dom.hasAttribute(\"data-tight\") };\n } }],\n toDOM(node) {\n return [\"ol\", { start: node.attrs.order == 1 ? null : node.attrs.order,\n \"data-tight\": node.attrs.tight ? \"true\" : null }, 0];\n }\n },\n bullet_list: {\n content: \"list_item+\",\n group: \"block\",\n attrs: { tight: { default: false } },\n parseDOM: [{ tag: \"ul\", getAttrs: dom => ({ tight: dom.hasAttribute(\"data-tight\") }) }],\n toDOM(node) { return [\"ul\", { \"data-tight\": node.attrs.tight ? \"true\" : null }, 0]; }\n },\n list_item: {\n content: \"block+\",\n defining: true,\n parseDOM: [{ tag: \"li\" }],\n toDOM() { return [\"li\", 0]; }\n },\n text: {\n group: \"inline\"\n },\n image: {\n inline: true,\n attrs: {\n src: {},\n alt: { default: null },\n title: { default: null }\n },\n group: \"inline\",\n draggable: true,\n parseDOM: [{ tag: \"img[src]\", getAttrs(dom) {\n return {\n src: dom.getAttribute(\"src\"),\n title: dom.getAttribute(\"title\"),\n alt: dom.getAttribute(\"alt\")\n };\n } }],\n toDOM(node) { return [\"img\", node.attrs]; }\n },\n hard_break: {\n inline: true,\n group: \"inline\",\n selectable: false,\n parseDOM: [{ tag: \"br\" }],\n toDOM() { return [\"br\"]; }\n }\n },\n marks: {\n em: {\n parseDOM: [\n { tag: \"i\" }, { tag: \"em\" },\n { style: \"font-style=italic\" },\n { style: \"font-style=normal\", clearMark: m => m.type.name == \"em\" }\n ],\n toDOM() { return [\"em\"]; }\n },\n strong: {\n parseDOM: [\n { tag: \"strong\" },\n { tag: \"b\", getAttrs: node => node.style.fontWeight != \"normal\" && null },\n { style: \"font-weight=400\", clearMark: m => m.type.name == \"strong\" },\n { style: \"font-weight\", getAttrs: value => /^(bold(er)?|[5-9]\\d{2,})$/.test(value) && null }\n ],\n toDOM() { return [\"strong\"]; }\n },\n link: {\n attrs: {\n href: {},\n title: { default: null }\n },\n inclusive: false,\n parseDOM: [{ tag: \"a[href]\", getAttrs(dom) {\n return { href: dom.getAttribute(\"href\"), title: dom.getAttribute(\"title\") };\n } }],\n toDOM(node) { return [\"a\", node.attrs]; }\n },\n code: {\n code: true,\n parseDOM: [{ tag: \"code\" }],\n toDOM() { return [\"code\"]; }\n }\n }\n});\n\n// @ts-ignore\nfunction maybeMerge(a, b) {\n if (a.isText && b.isText && Mark.sameSet(a.marks, b.marks))\n return a.withText(a.text + b.text);\n}\n// Object used to track the context of a running parse.\nclass MarkdownParseState {\n constructor(schema, tokenHandlers) {\n this.schema = schema;\n this.tokenHandlers = tokenHandlers;\n this.stack = [{ type: schema.topNodeType, attrs: null, content: [], marks: Mark.none }];\n }\n top() {\n return this.stack[this.stack.length - 1];\n }\n push(elt) {\n if (this.stack.length)\n this.top().content.push(elt);\n }\n // Adds the given text to the current position in the document,\n // using the current marks as styling.\n addText(text) {\n if (!text)\n return;\n let top = this.top(), nodes = top.content, last = nodes[nodes.length - 1];\n let node = this.schema.text(text, top.marks), merged;\n if (last && (merged = maybeMerge(last, node)))\n nodes[nodes.length - 1] = merged;\n else\n nodes.push(node);\n }\n // Adds the given mark to the set of active marks.\n openMark(mark) {\n let top = this.top();\n top.marks = mark.addToSet(top.marks);\n }\n // Removes the given mark from the set of active marks.\n closeMark(mark) {\n let top = this.top();\n top.marks = mark.removeFromSet(top.marks);\n }\n parseTokens(toks) {\n for (let i = 0; i < toks.length; i++) {\n let tok = toks[i];\n let handler = this.tokenHandlers[tok.type];\n if (!handler)\n throw new Error(\"Token type `\" + tok.type + \"` not supported by Markdown parser\");\n handler(this, tok, toks, i);\n }\n }\n // Add a node at the current position.\n addNode(type, attrs, content) {\n let top = this.top();\n let node = type.createAndFill(attrs, content, top ? top.marks : []);\n if (!node)\n return null;\n this.push(node);\n return node;\n }\n // Wrap subsequent content in a node of the given type.\n openNode(type, attrs) {\n this.stack.push({ type: type, attrs: attrs, content: [], marks: Mark.none });\n }\n // Close and return the node that is currently on top of the stack.\n closeNode() {\n let info = this.stack.pop();\n return this.addNode(info.type, info.attrs, info.content);\n }\n}\nfunction attrs(spec, token, tokens, i) {\n if (spec.getAttrs)\n return spec.getAttrs(token, tokens, i);\n // For backwards compatibility when `attrs` is a Function\n else if (spec.attrs instanceof Function)\n return spec.attrs(token);\n else\n return spec.attrs;\n}\n// Code content is represented as a single token with a `content`\n// property in Markdown-it.\nfunction noCloseToken(spec, type) {\n return spec.noCloseToken || type == \"code_inline\" || type == \"code_block\" || type == \"fence\";\n}\nfunction withoutTrailingNewline(str) {\n return str[str.length - 1] == \"\\n\" ? str.slice(0, str.length - 1) : str;\n}\nfunction noOp() { }\nfunction tokenHandlers(schema, tokens) {\n let handlers = Object.create(null);\n for (let type in tokens) {\n let spec = tokens[type];\n if (spec.block) {\n let nodeType = schema.nodeType(spec.block);\n if (noCloseToken(spec, type)) {\n handlers[type] = (state, tok, tokens, i) => {\n state.openNode(nodeType, attrs(spec, tok, tokens, i));\n state.addText(withoutTrailingNewline(tok.content));\n state.closeNode();\n };\n }\n else {\n handlers[type + \"_open\"] = (state, tok, tokens, i) => state.openNode(nodeType, attrs(spec, tok, tokens, i));\n handlers[type + \"_close\"] = state => state.closeNode();\n }\n }\n else if (spec.node) {\n let nodeType = schema.nodeType(spec.node);\n handlers[type] = (state, tok, tokens, i) => state.addNode(nodeType, attrs(spec, tok, tokens, i));\n }\n else if (spec.mark) {\n let markType = schema.marks[spec.mark];\n if (noCloseToken(spec, type)) {\n handlers[type] = (state, tok, tokens, i) => {\n state.openMark(markType.create(attrs(spec, tok, tokens, i)));\n state.addText(withoutTrailingNewline(tok.content));\n state.closeMark(markType);\n };\n }\n else {\n handlers[type + \"_open\"] = (state, tok, tokens, i) => state.openMark(markType.create(attrs(spec, tok, tokens, i)));\n handlers[type + \"_close\"] = state => state.closeMark(markType);\n }\n }\n else if (spec.ignore) {\n if (noCloseToken(spec, type)) {\n handlers[type] = noOp;\n }\n else {\n handlers[type + \"_open\"] = noOp;\n handlers[type + \"_close\"] = noOp;\n }\n }\n else {\n throw new RangeError(\"Unrecognized parsing spec \" + JSON.stringify(spec));\n }\n }\n handlers.text = (state, tok) => state.addText(tok.content);\n handlers.inline = (state, tok) => state.parseTokens(tok.children);\n handlers.softbreak = handlers.softbreak || (state => state.addText(\" \"));\n return handlers;\n}\n/**\nA configuration of a Markdown parser. Such a parser uses\n[markdown-it](https://github.com/markdown-it/markdown-it) to\ntokenize a file, and then runs the custom rules it is given over\nthe tokens to create a ProseMirror document tree.\n*/\nclass MarkdownParser {\n /**\n Create a parser with the given configuration. You can configure\n the markdown-it parser to parse the dialect you want, and provide\n a description of the ProseMirror entities those tokens map to in\n the `tokens` object, which maps token names to descriptions of\n what to do with them. Such a description is an object, and may\n have the following properties:\n */\n constructor(\n /**\n The parser's document schema.\n */\n schema, \n /**\n This parser's markdown-it tokenizer.\n */\n tokenizer, \n /**\n The value of the `tokens` object used to construct this\n parser. Can be useful to copy and modify to base other parsers\n on.\n */\n tokens) {\n this.schema = schema;\n this.tokenizer = tokenizer;\n this.tokens = tokens;\n this.tokenHandlers = tokenHandlers(schema, tokens);\n }\n /**\n Parse a string as [CommonMark](http://commonmark.org/) markup,\n and create a ProseMirror document as prescribed by this parser's\n rules.\n \n The second argument, when given, is passed through to the\n [Markdown\n parser](https://markdown-it.github.io/markdown-it/#MarkdownIt.parse).\n */\n parse(text, markdownEnv = {}) {\n let state = new MarkdownParseState(this.schema, this.tokenHandlers), doc;\n state.parseTokens(this.tokenizer.parse(text, markdownEnv));\n do {\n doc = state.closeNode();\n } while (state.stack.length);\n return doc || this.schema.topNodeType.createAndFill();\n }\n}\nfunction listIsTight(tokens, i) {\n while (++i < tokens.length)\n if (tokens[i].type != \"list_item_open\")\n return tokens[i].hidden;\n return false;\n}\n/**\nA parser parsing unextended [CommonMark](http://commonmark.org/),\nwithout inline HTML, and producing a document in the basic schema.\n*/\nconst defaultMarkdownParser = new MarkdownParser(schema, MarkdownIt(\"commonmark\", { html: false }), {\n blockquote: { block: \"blockquote\" },\n paragraph: { block: \"paragraph\" },\n list_item: { block: \"list_item\" },\n bullet_list: { block: \"bullet_list\", getAttrs: (_, tokens, i) => ({ tight: listIsTight(tokens, i) }) },\n ordered_list: { block: \"ordered_list\", getAttrs: (tok, tokens, i) => ({\n order: +tok.attrGet(\"start\") || 1,\n tight: listIsTight(tokens, i)\n }) },\n heading: { block: \"heading\", getAttrs: tok => ({ level: +tok.tag.slice(1) }) },\n code_block: { block: \"code_block\", noCloseToken: true },\n fence: { block: \"code_block\", getAttrs: tok => ({ params: tok.info || \"\" }), noCloseToken: true },\n hr: { node: \"horizontal_rule\" },\n image: { node: \"image\", getAttrs: tok => ({\n src: tok.attrGet(\"src\"),\n title: tok.attrGet(\"title\") || null,\n alt: tok.children[0] && tok.children[0].content || null\n }) },\n hardbreak: { node: \"hard_break\" },\n em: { mark: \"em\" },\n strong: { mark: \"strong\" },\n link: { mark: \"link\", getAttrs: tok => ({\n href: tok.attrGet(\"href\"),\n title: tok.attrGet(\"title\") || null\n }) },\n code_inline: { mark: \"code\", noCloseToken: true }\n});\n\nconst blankMark = { open: \"\", close: \"\", mixable: true };\n/**\nA specification for serializing a ProseMirror document as\nMarkdown/CommonMark text.\n*/\nclass MarkdownSerializer {\n /**\n Construct a serializer with the given configuration. The `nodes`\n object should map node names in a given schema to function that\n take a serializer state and such a node, and serialize the node.\n */\n constructor(\n /**\n The node serializer functions for this serializer.\n */\n nodes, \n /**\n The mark serializer info.\n */\n marks, options = {}) {\n this.nodes = nodes;\n this.marks = marks;\n this.options = options;\n }\n /**\n Serialize the content of the given node to\n [CommonMark](http://commonmark.org/).\n */\n serialize(content, options = {}) {\n options = Object.assign({}, this.options, options);\n let state = new MarkdownSerializerState(this.nodes, this.marks, options);\n state.renderContent(content);\n return state.out;\n }\n}\n/**\nA serializer for the [basic schema](https://prosemirror.net/docs/ref/#schema).\n*/\nconst defaultMarkdownSerializer = new MarkdownSerializer({\n blockquote(state, node) {\n state.wrapBlock(\"> \", null, node, () => state.renderContent(node));\n },\n code_block(state, node) {\n // Make sure the front matter fences are longer than any dash sequence within it\n const backticks = node.textContent.match(/`{3,}/gm);\n const fence = backticks ? (backticks.sort().slice(-1)[0] + \"`\") : \"```\";\n state.write(fence + (node.attrs.params || \"\") + \"\\n\");\n state.text(node.textContent, false);\n // Add a newline to the current content before adding closing marker\n state.write(\"\\n\");\n state.write(fence);\n state.closeBlock(node);\n },\n heading(state, node) {\n state.write(state.repeat(\"#\", node.attrs.level) + \" \");\n state.renderInline(node, false);\n state.closeBlock(node);\n },\n horizontal_rule(state, node) {\n state.write(node.attrs.markup || \"---\");\n state.closeBlock(node);\n },\n bullet_list(state, node) {\n state.renderList(node, \" \", () => (node.attrs.bullet || \"*\") + \" \");\n },\n ordered_list(state, node) {\n let start = node.attrs.order || 1;\n let maxW = String(start + node.childCount - 1).length;\n let space = state.repeat(\" \", maxW + 2);\n state.renderList(node, space, i => {\n let nStr = String(start + i);\n return state.repeat(\" \", maxW - nStr.length) + nStr + \". \";\n });\n },\n list_item(state, node) {\n state.renderContent(node);\n },\n paragraph(state, node) {\n state.renderInline(node);\n state.closeBlock(node);\n },\n image(state, node) {\n state.write(\"]/g, \"\\\\$&\") +\n (node.attrs.title ? ' \"' + node.attrs.title.replace(/\"/g, '\\\\\"') + '\"' : \"\") + \")\");\n },\n hard_break(state, node, parent, index) {\n for (let i = index + 1; i < parent.childCount; i++)\n if (parent.child(i).type != node.type) {\n state.write(\"\\\\\\n\");\n return;\n }\n },\n text(state, node) {\n state.text(node.text, !state.inAutolink);\n }\n}, {\n em: { open: \"*\", close: \"*\", mixable: true, expelEnclosingWhitespace: true },\n strong: { open: \"**\", close: \"**\", mixable: true, expelEnclosingWhitespace: true },\n link: {\n open(state, mark, parent, index) {\n state.inAutolink = isPlainURL(mark, parent, index);\n return state.inAutolink ? \"<\" : \"[\";\n },\n close(state, mark, parent, index) {\n let { inAutolink } = state;\n state.inAutolink = undefined;\n return inAutolink ? \">\"\n : \"](\" + mark.attrs.href.replace(/[\\(\\)\"]/g, \"\\\\$&\") + (mark.attrs.title ? ` \"${mark.attrs.title.replace(/\"/g, '\\\\\"')}\"` : \"\") + \")\";\n },\n mixable: true\n },\n code: { open(_state, _mark, parent, index) { return backticksFor(parent.child(index), -1); },\n close(_state, _mark, parent, index) { return backticksFor(parent.child(index - 1), 1); },\n escape: false }\n});\nfunction backticksFor(node, side) {\n let ticks = /`+/g, m, len = 0;\n if (node.isText)\n while (m = ticks.exec(node.text))\n len = Math.max(len, m[0].length);\n let result = len > 0 && side > 0 ? \" `\" : \"`\";\n for (let i = 0; i < len; i++)\n result += \"`\";\n if (len > 0 && side < 0)\n result += \" \";\n return result;\n}\nfunction isPlainURL(link, parent, index) {\n if (link.attrs.title || !/^\\w+:/.test(link.attrs.href))\n return false;\n let content = parent.child(index);\n if (!content.isText || content.text != link.attrs.href || content.marks[content.marks.length - 1] != link)\n return false;\n return index == parent.childCount - 1 || !link.isInSet(parent.child(index + 1).marks);\n}\n/**\nThis is an object used to track state and expose\nmethods related to markdown serialization. Instances are passed to\nnode and mark serialization methods (see `toMarkdown`).\n*/\nclass MarkdownSerializerState {\n /**\n @internal\n */\n constructor(\n /**\n @internal\n */\n nodes, \n /**\n @internal\n */\n marks, \n /**\n The options passed to the serializer.\n */\n options) {\n this.nodes = nodes;\n this.marks = marks;\n this.options = options;\n /**\n @internal\n */\n this.delim = \"\";\n /**\n @internal\n */\n this.out = \"\";\n /**\n @internal\n */\n this.closed = null;\n /**\n @internal\n */\n this.inAutolink = undefined;\n /**\n @internal\n */\n this.atBlockStart = false;\n /**\n @internal\n */\n this.inTightList = false;\n if (typeof this.options.tightLists == \"undefined\")\n this.options.tightLists = false;\n if (typeof this.options.hardBreakNodeName == \"undefined\")\n this.options.hardBreakNodeName = \"hard_break\";\n }\n /**\n @internal\n */\n flushClose(size = 2) {\n if (this.closed) {\n if (!this.atBlank())\n this.out += \"\\n\";\n if (size > 1) {\n let delimMin = this.delim;\n let trim = /\\s+$/.exec(delimMin);\n if (trim)\n delimMin = delimMin.slice(0, delimMin.length - trim[0].length);\n for (let i = 1; i < size; i++)\n this.out += delimMin + \"\\n\";\n }\n this.closed = null;\n }\n }\n /**\n @internal\n */\n getMark(name) {\n let info = this.marks[name];\n if (!info) {\n if (this.options.strict !== false)\n throw new Error(`Mark type \\`${name}\\` not supported by Markdown renderer`);\n info = blankMark;\n }\n return info;\n }\n /**\n Render a block, prefixing each line with `delim`, and the first\n line in `firstDelim`. `node` should be the node that is closed at\n the end of the block, and `f` is a function that renders the\n content of the block.\n */\n wrapBlock(delim, firstDelim, node, f) {\n let old = this.delim;\n this.write(firstDelim != null ? firstDelim : delim);\n this.delim += delim;\n f();\n this.delim = old;\n this.closeBlock(node);\n }\n /**\n @internal\n */\n atBlank() {\n return /(^|\\n)$/.test(this.out);\n }\n /**\n Ensure the current content ends with a newline.\n */\n ensureNewLine() {\n if (!this.atBlank())\n this.out += \"\\n\";\n }\n /**\n Prepare the state for writing output (closing closed paragraphs,\n adding delimiters, and so on), and then optionally add content\n (unescaped) to the output.\n */\n write(content) {\n this.flushClose();\n if (this.delim && this.atBlank())\n this.out += this.delim;\n if (content)\n this.out += content;\n }\n /**\n Close the block for the given node.\n */\n closeBlock(node) {\n this.closed = node;\n }\n /**\n Add the given text to the document. When escape is not `false`,\n it will be escaped.\n */\n text(text, escape = true) {\n let lines = text.split(\"\\n\");\n for (let i = 0; i < lines.length; i++) {\n this.write();\n // Escape exclamation marks in front of links\n if (!escape && lines[i][0] == \"[\" && /(^|[^\\\\])\\!$/.test(this.out))\n this.out = this.out.slice(0, this.out.length - 1) + \"\\\\!\";\n this.out += escape ? this.esc(lines[i], this.atBlockStart) : lines[i];\n if (i != lines.length - 1)\n this.out += \"\\n\";\n }\n }\n /**\n Render the given node as a block.\n */\n render(node, parent, index) {\n if (this.nodes[node.type.name]) {\n this.nodes[node.type.name](this, node, parent, index);\n }\n else {\n if (this.options.strict !== false) {\n throw new Error(\"Token type `\" + node.type.name + \"` not supported by Markdown renderer\");\n }\n else if (!node.type.isLeaf) {\n if (node.type.inlineContent)\n this.renderInline(node);\n else\n this.renderContent(node);\n if (node.isBlock)\n this.closeBlock(node);\n }\n }\n }\n /**\n Render the contents of `parent` as block nodes.\n */\n renderContent(parent) {\n parent.forEach((node, _, i) => this.render(node, parent, i));\n }\n /**\n Render the contents of `parent` as inline content.\n */\n renderInline(parent, fromBlockStart = true) {\n this.atBlockStart = fromBlockStart;\n let active = [], trailing = \"\";\n let progress = (node, offset, index) => {\n let marks = node ? node.marks : [];\n // Remove marks from `hard_break` that are the last node inside\n // that mark to prevent parser edge cases with new lines just\n // before closing marks.\n if (node && node.type.name === this.options.hardBreakNodeName)\n marks = marks.filter(m => {\n if (index + 1 == parent.childCount)\n return false;\n let next = parent.child(index + 1);\n return m.isInSet(next.marks) && (!next.isText || /\\S/.test(next.text));\n });\n let leading = trailing;\n trailing = \"\";\n // If whitespace has to be expelled from the node, adjust\n // leading and trailing accordingly.\n if (node && node.isText && marks.some(mark => {\n let info = this.getMark(mark.type.name);\n return info && info.expelEnclosingWhitespace && !mark.isInSet(active);\n })) {\n let [_, lead, rest] = /^(\\s*)(.*)$/m.exec(node.text);\n if (lead) {\n leading += lead;\n node = rest ? node.withText(rest) : null;\n if (!node)\n marks = active;\n }\n }\n if (node && node.isText && marks.some(mark => {\n let info = this.getMark(mark.type.name);\n return info && info.expelEnclosingWhitespace && !this.isMarkAhead(parent, index + 1, mark);\n })) {\n let [_, rest, trail] = /^(.*?)(\\s*)$/m.exec(node.text);\n if (trail) {\n trailing = trail;\n node = rest ? node.withText(rest) : null;\n if (!node)\n marks = active;\n }\n }\n let inner = marks.length ? marks[marks.length - 1] : null;\n let noEsc = inner && this.getMark(inner.type.name).escape === false;\n let len = marks.length - (noEsc ? 1 : 0);\n // Try to reorder 'mixable' marks, such as em and strong, which\n // in Markdown may be opened and closed in different order, so\n // that order of the marks for the token matches the order in\n // active.\n outer: for (let i = 0; i < len; i++) {\n let mark = marks[i];\n if (!this.getMark(mark.type.name).mixable)\n break;\n for (let j = 0; j < active.length; j++) {\n let other = active[j];\n if (!this.getMark(other.type.name).mixable)\n break;\n if (mark.eq(other)) {\n if (i > j)\n marks = marks.slice(0, j).concat(mark).concat(marks.slice(j, i)).concat(marks.slice(i + 1, len));\n else if (j > i)\n marks = marks.slice(0, i).concat(marks.slice(i + 1, j)).concat(mark).concat(marks.slice(j, len));\n continue outer;\n }\n }\n }\n // Find the prefix of the mark set that didn't change\n let keep = 0;\n while (keep < Math.min(active.length, len) && marks[keep].eq(active[keep]))\n ++keep;\n // Close the marks that need to be closed\n while (keep < active.length)\n this.text(this.markString(active.pop(), false, parent, index), false);\n // Output any previously expelled trailing whitespace outside the marks\n if (leading)\n this.text(leading);\n // Open the marks that need to be opened\n if (node) {\n while (active.length < len) {\n let add = marks[active.length];\n active.push(add);\n this.text(this.markString(add, true, parent, index), false);\n this.atBlockStart = false;\n }\n // Render the node. Special case code marks, since their content\n // may not be escaped.\n if (noEsc && node.isText)\n this.text(this.markString(inner, true, parent, index) + node.text +\n this.markString(inner, false, parent, index + 1), false);\n else\n this.render(node, parent, index);\n this.atBlockStart = false;\n }\n // After the first non-empty text node is rendered, the end of output\n // is no longer at block start.\n //\n // FIXME: If a non-text node writes something to the output for this\n // block, the end of output is also no longer at block start. But how\n // can we detect that?\n if ((node === null || node === void 0 ? void 0 : node.isText) && node.nodeSize > 0) {\n this.atBlockStart = false;\n }\n };\n parent.forEach(progress);\n progress(null, 0, parent.childCount);\n this.atBlockStart = false;\n }\n /**\n Render a node's content as a list. `delim` should be the extra\n indentation added to all lines except the first in an item,\n `firstDelim` is a function going from an item index to a\n delimiter for the first line of the item.\n */\n renderList(node, delim, firstDelim) {\n if (this.closed && this.closed.type == node.type)\n this.flushClose(3);\n else if (this.inTightList)\n this.flushClose(1);\n let isTight = typeof node.attrs.tight != \"undefined\" ? node.attrs.tight : this.options.tightLists;\n let prevTight = this.inTightList;\n this.inTightList = isTight;\n node.forEach((child, _, i) => {\n if (i && isTight)\n this.flushClose(1);\n this.wrapBlock(delim, firstDelim(i), node, () => this.render(child, node, i));\n });\n this.inTightList = prevTight;\n }\n /**\n Escape the given string so that it can safely appear in Markdown\n content. If `startOfLine` is true, also escape characters that\n have special meaning only at the start of the line.\n */\n esc(str, startOfLine = false) {\n str = str.replace(/[`*\\\\~\\[\\]_]/g, (m, i) => m == \"_\" && i > 0 && i + 1 < str.length && str[i - 1].match(/\\w/) && str[i + 1].match(/\\w/) ? m : \"\\\\\" + m);\n if (startOfLine)\n str = str.replace(/^(\\+[ ]|[\\-*>])/, \"\\\\$&\").replace(/^(\\s*)(#{1,6})(\\s|$)/, '$1\\\\$2$3').replace(/^(\\s*\\d+)\\.\\s/, \"$1\\\\. \");\n if (this.options.escapeExtraCharacters)\n str = str.replace(this.options.escapeExtraCharacters, \"\\\\$&\");\n return str;\n }\n /**\n @internal\n */\n quote(str) {\n let wrap = str.indexOf('\"') == -1 ? '\"\"' : str.indexOf(\"'\") == -1 ? \"''\" : \"()\";\n return wrap[0] + str + wrap[1];\n }\n /**\n Repeat the given string `n` times.\n */\n repeat(str, n) {\n let out = \"\";\n for (let i = 0; i < n; i++)\n out += str;\n return out;\n }\n /**\n Get the markdown string for a given opening or closing mark.\n */\n markString(mark, open, parent, index) {\n let info = this.getMark(mark.type.name);\n let value = open ? info.open : info.close;\n return typeof value == \"string\" ? value : value(this, mark, parent, index);\n }\n /**\n Get leading and trailing whitespace from a string. Values of\n leading or trailing property of the return object will be undefined\n if there is no match.\n */\n getEnclosingWhitespace(text) {\n return {\n leading: (text.match(/^(\\s+)/) || [undefined])[0],\n trailing: (text.match(/(\\s+)$/) || [undefined])[0]\n };\n }\n /**\n @internal\n */\n isMarkAhead(parent, index, mark) {\n for (;; index++) {\n if (index >= parent.childCount)\n return false;\n let next = parent.child(index);\n if (next.type.name != this.options.hardBreakNodeName)\n return mark.isInSet(next.marks);\n index++;\n }\n }\n}\n\nexport { MarkdownParser, MarkdownSerializer, MarkdownSerializerState, defaultMarkdownParser, defaultMarkdownSerializer, schema };\n", "import { Extension } from \"@tiptap/core\";\n\nexport const MarkdownTightLists = Extension.create({\n name: 'markdownTightLists',\n addOptions: () => ({\n tight: true,\n tightClass: 'tight',\n listTypes: [\n 'bulletList',\n 'orderedList',\n ],\n }),\n addGlobalAttributes() {\n return [\n {\n types: this.options.listTypes,\n attributes: {\n tight: {\n default: this.options.tight,\n parseHTML: element =>\n element.getAttribute('data-tight') === 'true' || !element.querySelector('p'),\n renderHTML: attributes => ({\n class: attributes.tight ? this.options.tightClass : null,\n 'data-tight': attributes.tight ? 'true' : null,\n }),\n },\n },\n },\n ]\n },\n addCommands() {\n return {\n toggleTight: (tight = null) => ({ editor, commands }) => {\n function toggleTight(name) {\n if(!editor.isActive(name)) {\n return false;\n }\n const attrs = editor.getAttributes(name);\n return commands.updateAttributes(name, {\n tight: tight ?? !attrs?.tight,\n });\n }\n return this.options.listTypes\n .some(name => toggleTight(name));\n }\n }\n },\n});\n", "import markdownit from 'markdown-it';\n\nconst md = markdownit();\n\nfunction scanDelims(text, pos) {\n md.inline.State.prototype.scanDelims.call({ src: text, posMax: text.length })\n const state = new (md.inline.State)(text, null, null, []);\n return state.scanDelims(pos, true);\n}\n\nexport function shiftDelim(text, delim, start, offset) {\n let res = text.substring(0, start) + text.substring(start + delim.length);\n res = res.substring(0, start + offset) + delim + res.substring(start + offset);\n return res;\n}\n\nfunction trimStart(text, delim, from, to) {\n let pos = from, res = text;\n while(pos < to) {\n if(scanDelims(res, pos).can_open) {\n break;\n }\n res = shiftDelim(res, delim, pos, 1);\n pos++;\n }\n return { text: res, from: pos, to }\n}\n\nfunction trimEnd(text, delim, from, to) {\n let pos = to, res = text;\n while(pos > from) {\n if(scanDelims(res, pos).can_close) {\n break;\n }\n res = shiftDelim(res, delim, pos, -1);\n pos--;\n }\n return { text: res, from, to: pos }\n}\n\nexport function trimInline(text, delim, from, to) {\n let state = {\n text,\n from,\n to,\n }\n\n state = trimStart(state.text, delim, state.from, state.to);\n state = trimEnd(state.text, delim, state.from, state.to);\n\n if(state.to - state.from < delim.length + 1) {\n state.text = state.text.substring(0, state.from) + state.text.substring(state.to + delim.length);\n }\n\n return state.text;\n}\n", "import { MarkdownSerializerState as BaseMarkdownSerializerState } from \"prosemirror-markdown\";\nimport { trimInline } from \"../util/markdown\";\n\n\n/**\n * Override default MarkdownSerializerState to:\n * - handle commonmark delimiters (https://spec.commonmark.org/0.29/#left-flanking-delimiter-run)\n */\nexport class MarkdownSerializerState extends BaseMarkdownSerializerState {\n\n inTable = false;\n\n constructor(nodes, marks, options) {\n super(nodes, marks, options ?? {});\n this.inlines = [];\n }\n\n render(node, parent, index) {\n super.render(node, parent, index);\n const top = this.inlines[this.inlines.length - 1];\n if(top?.start && top?.end) {\n const { delimiter, start, end } = this.normalizeInline(top);\n this.out = trimInline(this.out, delimiter, start, end);\n this.inlines.pop();\n }\n }\n\n markString(mark, open, parent, index) {\n const info = this.marks[mark.type.name]\n if(info.expelEnclosingWhitespace) {\n if(open) {\n this.inlines.push({\n start: this.out.length,\n delimiter: info.open,\n });\n } else {\n const top = this.inlines.pop();\n this.inlines.push({\n ...top,\n end: this.out.length,\n });\n }\n }\n return super.markString(mark, open, parent, index);\n }\n\n normalizeInline(inline) {\n let { start, end } = inline;\n while(this.out.charAt(start).match(/\\s/)) {\n start++;\n }\n return {\n ...inline,\n start,\n }\n }\n}\n", "import { Fragment } from \"@tiptap/pm/model\";\nimport { getHTMLFromFragment, Mark } from \"@tiptap/core\";\n\n\nexport default Mark.create({\n name: 'markdownHTMLMark',\n /**\n * @return {{markdown: MarkdownMarkSpec}}\n */\n addStorage() {\n return {\n markdown: {\n serialize: {\n open(state, mark) {\n if(!this.editor.storage.markdown.options.html) {\n console.warn(`Tiptap Markdown: \"${mark.type.name}\" mark is only available in html mode`);\n return '';\n }\n return getMarkTags(mark)?.[0] ?? '';\n },\n close(state, mark) {\n if(!this.editor.storage.markdown.options.html) {\n return '';\n }\n return getMarkTags(mark)?.[1] ?? '';\n },\n },\n parse: {\n // handled by markdown-it\n }\n }\n }\n }\n});\n\nfunction getMarkTags(mark) {\n const schema = mark.type.schema;\n const node = schema.text(' ', [mark]);\n const html = getHTMLFromFragment(Fragment.from(node), schema);\n const match = html.match(/^(<.*?>) (<\\/.*?>)$/);\n return match ? [match[1], match[2]] : null;\n}\n", "\n\nexport function elementFromString(value) {\n // add a wrapper to preserve leading and trailing whitespace\n const wrappedValue = `<body>${value}</body>`\n\n return new window.DOMParser().parseFromString(wrappedValue, 'text/html').body\n}\n\nexport function escapeHTML(value) {\n return value\n ?.replace(/</g, '<')\n .replace(/>/g, '>');\n}\n\nexport function extractElement(node) {\n const parent = node.parentElement;\n const prepend = parent.cloneNode();\n\n while(parent.firstChild && parent.firstChild !== node) {\n prepend.appendChild(parent.firstChild);\n }\n\n if(prepend.childNodes.length > 0) {\n parent.parentElement.insertBefore(prepend, parent);\n }\n parent.parentElement.insertBefore(node, parent);\n if(parent.childNodes.length === 0) {\n parent.remove();\n }\n}\n\nexport function unwrapElement(node) {\n const parent = node.parentNode;\n\n while (node.firstChild) parent.insertBefore(node.firstChild, node);\n\n parent.removeChild(node);\n}\n", "import { Fragment } from \"@tiptap/pm/model\";\nimport { getHTMLFromFragment, Node } from \"@tiptap/core\";\nimport { elementFromString } from \"../../util/dom\";\n\n\nexport default Node.create({\n name: 'markdownHTMLNode',\n addStorage() {\n return {\n markdown: {\n serialize(state, node, parent) {\n if(this.editor.storage.markdown.options.html) {\n state.write(serializeHTML(node, parent));\n } else {\n console.warn(`Tiptap Markdown: \"${node.type.name}\" node is only available in html mode`);\n state.write(`[${node.type.name}]`);\n }\n if(node.isBlock) {\n state.closeBlock(node);\n }\n },\n parse: {\n // handled by markdown-it\n },\n },\n }\n }\n});\n\nfunction serializeHTML(node, parent) {\n const schema = node.type.schema;\n const html = getHTMLFromFragment(Fragment.from(node), schema);\n\n if(node.isBlock && (parent instanceof Fragment || parent.type.name === schema.topNodeType.name)) {\n return formatBlock(html);\n }\n\n return html;\n}\n\n/**\n * format html block as per the commonmark spec\n */\nfunction formatBlock(html) {\n const dom = elementFromString(html);\n const element = dom.firstElementChild;\n\n element.innerHTML = element.innerHTML.trim()\n ? `\\n${element.innerHTML}\\n`\n : `\\n`;\n\n return element.outerHTML;\n}\n", "import { Node } from \"@tiptap/core\";\nimport { defaultMarkdownSerializer } from \"prosemirror-markdown\";\n\n\nconst Blockquote = Node.create({\n name: 'blockquote',\n});\n\nexport default Blockquote.extend({\n /**\n * @return {{markdown: MarkdownNodeSpec}}\n */\n addStorage() {\n return {\n markdown: {\n serialize: defaultMarkdownSerializer.nodes.blockquote,\n parse: {\n // handled by markdown-it\n },\n }\n }\n }\n});\n", "import { Node } from \"@tiptap/core\";\n\n\nconst BulletList = Node.create({\n name: 'bulletList',\n});\n\nexport default BulletList.extend({\n /**\n * @return {{markdown: MarkdownNodeSpec}}\n */\n addStorage() {\n return {\n markdown: {\n serialize(state, node) {\n return state.renderList(node, \" \", () => (this.editor.storage.markdown.options.bulletListMarker || \"-\") + \" \");\n },\n parse: {\n // handled by markdown-it\n },\n }\n }\n }\n});\n", "import { Node } from \"@tiptap/core\";\n\n\nconst CodeBlock = Node.create({\n name: 'codeBlock',\n});\n\nexport default CodeBlock.extend({\n /**\n * @return {{markdown: MarkdownNodeSpec}}\n */\n addStorage() {\n return {\n markdown: {\n serialize(state, node) {\n state.write(\"```\" + (node.attrs.language || \"\") + \"\\n\");\n state.text(node.textContent, false);\n state.ensureNewLine();\n state.write(\"```\");\n state.closeBlock(node);\n },\n parse: {\n setup(markdownit) {\n markdownit.set({\n langPrefix: this.options.languageClassPrefix ?? 'language-',\n });\n },\n updateDOM(element) {\n element.innerHTML = element.innerHTML.replace(/\\n<\\/code><\\/pre>/g, '</code></pre>')\n },\n },\n }\n }\n }\n});\n", "import { Node } from \"@tiptap/core\";\nimport HTMLNode from './html';\n\nconst HardBreak = Node.create({\n name: 'hardBreak',\n});\n\nexport default HardBreak.extend({\n /**\n * @return {{markdown: MarkdownNodeSpec}}\n */\n addStorage() {\n return {\n markdown: {\n serialize(state, node, parent, index) {\n for (let i = index + 1; i < parent.childCount; i++)\n if (parent.child(i).type != node.type) {\n state.write(\n state.inTable\n ? HTMLNode.storage.markdown.serialize.call(this, state, node, parent)\n : \"\\\\\\n\"\n );\n return;\n }\n },\n parse: {\n // handled by markdown-it\n },\n }\n }\n }\n});\n", "import { Node } from \"@tiptap/core\";\nimport { defaultMarkdownSerializer } from \"prosemirror-markdown\";\n\n\nconst Heading = Node.create({\n name: 'heading',\n});\n\nexport default Heading.extend({\n /**\n * @return {{markdown: MarkdownNodeSpec}}\n */\n addStorage() {\n return {\n markdown: {\n serialize: defaultMarkdownSerializer.nodes.heading,\n parse: {\n // handled by markdown-it\n },\n }\n }\n }\n});\n", "import { Node } from \"@tiptap/core\";\nimport { defaultMarkdownSerializer } from \"prosemirror-markdown\";\n\n\nconst HorizontalRule = Node.create({\n name: 'horizontalRule',\n});\n\nexport default HorizontalRule.extend({\n /**\n * @return {{markdown: MarkdownNodeSpec}}\n */\n addStorage() {\n return {\n markdown: {\n serialize: defaultMarkdownSerializer.nodes.horizontal_rule,\n parse: {\n // handled by markdown-it\n },\n }\n }\n }\n});\n", "import { Node } from \"@tiptap/core\";\nimport { defaultMarkdownSerializer } from \"prosemirror-markdown\";\n\n\nconst Image = Node.create({\n name: 'image',\n});\n\nexport default Image.extend({\n /**\n * @return {{markdown: MarkdownNodeSpec}}\n */\n addStorage() {\n return {\n markdown: {\n serialize: defaultMarkdownSerializer.nodes.image,\n parse: {\n // handled by markdown-it\n },\n }\n }\n }\n});\n", "import { Node } from \"@tiptap/core\";\nimport { defaultMarkdownSerializer } from \"prosemirror-markdown\";\n\n\nconst ListItem = Node.create({\n name: 'listItem',\n});\n\nexport default ListItem.extend({\n /**\n * @return {{markdown: MarkdownNodeSpec}}\n */\n addStorage() {\n return {\n markdown: {\n serialize: defaultMarkdownSerializer.nodes.list_item,\n parse: {\n // handled by markdown-it\n },\n }\n }\n }\n});\n", "import { Node } from \"@tiptap/core\";\n\n\nconst OrderedList = Node.create({\n name: 'orderedList',\n});\n\nfunction findIndexOfAdjacentNode(node, parent, index) {\n let i = 0;\n for (; index - i > 0; i++) {\n if (parent.child(index - i - 1).type.name !== node.type.name) {\n break;\n }\n }\n return i;\n}\n\nexport default OrderedList.extend({\n /**\n * @return {{markdown: MarkdownNodeSpec}}\n */\n addStorage() {\n return {\n markdown: {\n serialize(state, node, parent, index) {\n const start = node.attrs.start || 1\n const maxW = String(start + node.childCount - 1).length\n const space = state.repeat(\" \", maxW + 2)\n const adjacentIndex = findIndexOfAdjacentNode(node, parent, index);\n const separator = adjacentIndex % 2 ? ') ' : '. ';\n state.renderList(node, space, i => {\n const nStr = String(start + i)\n return state.repeat(\" \", maxW - nStr.length) + nStr + separator;\n })\n },\n parse: {\n // handled by markdown-it\n },\n }\n }\n }\n});\n", "import { Node } from \"@tiptap/core\";\nimport { defaultMarkdownSerializer } from \"prosemirror-markdown\";\n\n\nconst Paragraph = Node.create({\n name: 'paragraph',\n});\n\nexport default Paragraph.extend({\n /**\n * @return {{markdown: MarkdownNodeSpec}}\n */\n addStorage() {\n return {\n markdown: {\n serialize: defaultMarkdownSerializer.nodes.paragraph,\n parse: {\n // handled by markdown-it\n },\n },\n }\n }\n});\n", "\n\nexport function childNodes(node) {\n return node?.content?.content ?? [];\n}\n", "import { Node } from \"@tiptap/core\";\nimport { childNodes } from \"../../util/prosemirror\";\nimport HTMLNode from './html';\n\nconst Table = Node.create({\n name: 'table',\n});\n\nexport default Table.extend({\n /**\n * @return {{markdown: MarkdownNodeSpec}}\n */\n addStorage() {\n return {\n markdown: {\n serialize(state, node, parent) {\n if(!isMarkdownSerializable(node)) {\n HTMLNode.storage.markdown.serialize.call(this, state, node, parent);\n return;\n }\n state.inTable = true;\n node.forEach((row, p, i) => {\n state.write('| ');\n row.forEach((col, p, j) => {\n if(j) {\n state.write(' | ');\n }\n const cellContent = col.firstChild;\n if(cellContent.textContent.trim()) {\n state.renderInline(cellContent);\n }\n });\n state.write(' |')\n state.ensureNewLine();\n if(!i) {\n const delimiterRow = Array.from({length: row.childCount}).map(() => '---').join(' | ');\n state.write(`| ${delimiterRow} |`);\n state.ensureNewLine();\n }\n });\n state.closeBlock(node);\n state.inTable = false;\n },\n parse: {\n // handled by markdown-it\n },\n }\n }\n }\n})\n\n\nfunction hasSpan(node) {\n return node.attrs.colspan > 1 || node.attrs.rowspan > 1;\n}\n\nfunction isMarkdownSerializable(node) {\n const rows = childNodes(node);\n const firstRow = rows[0];\n const bodyRows = rows.slice(1);\n\n if(childNodes(firstRow).some(cell => cell.type.name !== 'tableHeader' || hasSpan(cell) || cell.childCount > 1)) {\n return false;\n }\n\n if(bodyRows.some(row =>\n childNodes(row).some(cell => cell.type.name === 'tableHeader' || hasSpan(cell) || cell.childCount > 1)\n )) {\n return false;\n }\n\n return true;\n}\n", "import { Node } from \"@tiptap/core\";\n\n\nconst TaskItem = Node.create({\n name: 'taskItem',\n});\n\nexport default TaskItem.extend({\n /**\n * @return {{markdown: MarkdownNodeSpec}}\n */\n addStorage() {\n return {\n markdown: {\n serialize(state, node) {\n const check = node.attrs.checked ? '[x]' : '[ ]';\n state.write(`${check} `);\n state.renderContent(node);\n },\n parse: {\n updateDOM(element) {\n [...element.querySelectorAll('.task-list-item')]\n .forEach(item => {\n const input = item.querySelector('input');\n item.setAttribute('data-type', 'taskItem');\n if(input) {\n item.setAttribute('data-checked', input.checked);\n input.remove();\n }\n });\n },\n }\n }\n }\n }\n});\n", "import taskListPlugin from \"markdown-it-task-lists\";\nimport { Node } from \"@tiptap/core\";\nimport BulletList from \"./bullet-list\";\n\n\nconst TaskList = Node.create({\n name: 'taskList',\n});\n\nexport default TaskList.extend({\n /**\n * @return {{markdown: MarkdownNodeSpec}}\n */\n addStorage() {\n return {\n markdown: {\n serialize: BulletList.storage.markdown.serialize,\n parse: {\n setup(markdownit) {\n markdownit.use(taskListPlugin);\n },\n updateDOM(element) {\n [...element.querySelectorAll('.contains-task-list')]\n .forEach(list => {\n list.setAttribute('data-type', 'taskList');\n });\n },\n }\n }\n }\n }\n});\n", "import { Node } from \"@tiptap/core\";\nimport { escapeHTML } from \"../../util/dom\";\n\n\nconst Text = Node.create({\n name: 'text',\n});\n\nexport default Text.extend({\n /**\n * @return {{markdown: MarkdownNodeSpec}}\n */\n addStorage() {\n return {\n markdown: {\n serialize(state, node) {\n state.text(escapeHTML(node.text));\n },\n parse: {\n // handled by markdown-it\n },\n }\n }\n }\n});\n", "import { Mark } from \"@tiptap/core\";\nimport { defaultMarkdownSerializer } from \"prosemirror-markdown\";\n\n\nconst Bold = Mark.create({\n name: 'bold',\n});\n\nexport default Bold.extend({\n /**\n * @return {{markdown: MarkdownMarkSpec}}\n */\n addStorage() {\n return {\n markdown: {\n serialize: defaultMarkdownSerializer.marks.strong,\n parse: {\n // handled by markdown-it\n }\n },\n }\n }\n});\n", "import { Mark } from \"@tiptap/core\";\nimport { defaultMarkdownSerializer } from \"prosemirror-markdown\";\n\n\nconst Code = Mark.create({\n name: 'code',\n});\n\nexport default Code.extend({\n /**\n * @return {{markdown: MarkdownMarkSpec}}\n */\n addStorage() {\n return {\n markdown: {\n serialize: defaultMarkdownSerializer.marks.code,\n parse: {\n // handled by markdown-it\n }\n }\n }\n }\n})\n", "import { Mark } from \"@tiptap/core\";\nimport { defaultMarkdownSerializer } from \"prosemirror-markdown\";\n\n\nconst Italic = Mark.create({\n name: 'italic',\n});\n\nexport default Italic.extend({\n /**\n * @return {{markdown: MarkdownMarkSpec}}\n */\n addStorage() {\n return {\n markdown: {\n serialize: defaultMarkdownSerializer.marks.em,\n parse: {\n // handled by markdown-it\n }\n }\n }\n }\n})\n", "import { Mark } from \"@tiptap/core\";\nimport { defaultMarkdownSerializer } from \"prosemirror-markdown\";\n\n\nconst Link = Mark.create({\n name: 'link',\n});\n\nexport default Link.extend({\n /**\n * @return {{markdown: MarkdownMarkSpec}}\n */\n addStorage() {\n return {\n markdown: {\n serialize: defaultMarkdownSerializer.marks.link,\n parse: {\n // handled by markdown-it\n }\n }\n }\n }\n})\n", "import { Mark } from \"@tiptap/core\";\n\n\nconst Strike = Mark.create({\n name: 'strike',\n});\n\nexport default Strike.extend({\n /**\n * @return {{markdown: MarkdownMarkSpec}}\n */\n addStorage() {\n return {\n markdown: {\n serialize: {open: '~~', close: '~~', expelEnclosingWhitespace: true},\n parse: {\n // handled by markdown-it\n },\n },\n }\n }\n});\n", "import Blockquote from \"./nodes/blockquote\";\nimport BulletList from \"./nodes/bullet-list\";\nimport CodeBlock from \"./nodes/code-block\";\nimport HardBreak from \"./nodes/hard-break\";\nimport Heading from \"./nodes/heading\";\nimport HorizontalRule from \"./nodes/horizontal-rule\";\nimport HTMLNode from \"./nodes/html\";\nimport Image from \"./nodes/image\";\nimport ListItem from \"./nodes/list-item\";\nimport OrderedList from \"./nodes/ordered-list\";\nimport Paragraph from \"./nodes/paragraph\";\nimport Table from \"./nodes/table\";\nimport TaskItem from \"./nodes/task-item\";\nimport TaskList from \"./nodes/task-list\";\nimport Text from \"./nodes/text\";\n\nimport Bold from \"./marks/bold\";\nimport Code from \"./marks/code\";\nimport HTMLMark from \"./marks/html\";\nimport Italic from \"./marks/italic\";\nimport Link from \"./marks/link\";\nimport Strike from \"./marks/strike\";\n\n\nexport default [\n Blockquote,\n BulletList,\n CodeBlock,\n HardBreak,\n Heading,\n HorizontalRule,\n HTMLNode,\n Image,\n ListItem,\n OrderedList,\n Paragraph,\n Table,\n TaskItem,\n TaskList,\n Text,\n\n Bold,\n Code,\n HTMLMark,\n Italic,\n Link,\n Strike,\n]\n", "import markdownExtensions from \"../extensions\";\n\n\nexport function getMarkdownSpec(extension) {\n const markdownSpec = extension.storage?.markdown;\n const defaultMarkdownSpec = markdownExtensions.find(e => e.name === extension.name)?.storage.markdown;\n\n if(markdownSpec || defaultMarkdownSpec) {\n return {\n ...defaultMarkdownSpec,\n ...markdownSpec,\n };\n }\n\n return null;\n}\n", "import { MarkdownSerializerState } from './state';\nimport HTMLMark from \"../extensions/marks/html\";\nimport HTMLNode from \"../extensions/nodes/html\";\nimport { getMarkdownSpec } from \"../util/extensions\";\nimport HardBreak from \"../extensions/nodes/hard-break\";\n\n\nexport class MarkdownSerializer {\n /**\n * @type {import('@tiptap/core').Editor}\n */\n editor = null;\n\n constructor(editor) {\n this.editor = editor;\n }\n\n serialize(content) {\n const state = new MarkdownSerializerState(this.nodes, this.marks, {\n hardBreakNodeName: HardBreak.name,\n });\n\n state.renderContent(content);\n\n return state.out;\n }\n\n get nodes() {\n return {\n ...Object.fromEntries(\n Object.keys(this.editor.schema.nodes)\n .map(name => [name, this.serializeNode(HTMLNode)])\n ),\n ...Object.fromEntries(\n this.editor.extensionManager.extensions\n .filter(extension => extension.type === 'node' && this.serializeNode(extension))\n .map(extension => [extension.name, this.serializeNode(extension)])\n ?? []\n ),\n };\n }\n\n get marks() {\n return {\n ...Object.fromEntries(\n Object.keys(this.editor.schema.marks)\n .map(name => [name, this.serializeMark(HTMLMark)])\n ),\n ...Object.fromEntries(\n this.editor.extensionManager.extensions\n .filter(extension => extension.type === 'mark' && this.serializeMark(extension))\n .map(extension => [extension.name, this.serializeMark(extension)])\n ?? []\n ),\n };\n }\n\n serializeNode(node) {\n return getMarkdownSpec(node)?.serialize?.bind({ editor: this.editor, options: node.options });\n }\n\n serializeMark(mark) {\n const serialize = getMarkdownSpec(mark)?.serialize;\n return serialize\n ? {\n ...serialize,\n open: typeof serialize.open === 'function' ? serialize.open.bind({ editor: this.editor, options: mark.options }) : serialize.open,\n close: typeof serialize.close === 'function' ? serialize.close.bind({ editor: this.editor, options: mark.options }) : serialize.close,\n }\n : null\n }\n}\n\n", "import markdownit from \"markdown-it\";\nimport { elementFromString, extractElement, unwrapElement } from \"../util/dom\";\nimport { getMarkdownSpec } from \"../util/extensions\";\n\nexport class MarkdownParser {\n /**\n * @type {import('@tiptap/core').Editor}\n */\n editor = null;\n /**\n * @type {markdownit}\n */\n md = null;\n\n constructor(editor, { html, linkify, breaks }) {\n this.editor = editor;\n this.md = this.withPatchedRenderer(markdownit({\n html,\n linkify,\n breaks,\n }));\n }\n\n parse(content, { inline } = {}) {\n if(typeof content === 'string') {\n this.editor.extensionManager.extensions.forEach(extension =>\n getMarkdownSpec(extension)?.parse?.setup?.call({ editor:this.editor, options:extension.options }, this.md)\n );\n\n const renderedHTML = this.md.render(content);\n const element = elementFromString(renderedHTML);\n\n this.editor.extensionManager.extensions.forEach(extension =>\n getMarkdownSpec(extension)?.parse?.updateDOM?.call({ editor:this.editor, options:extension.options }, element)\n );\n\n this.normalizeDOM(element, { inline, content });\n\n return element.innerHTML;\n }\n\n return content;\n }\n\n normalizeDOM(node, { inline, content }) {\n this.normalizeBlocks(node);\n\n // remove all \\n appended by markdown-it\n node.querySelectorAll('*').forEach(el => {\n if(el.nextSibling?.nodeType === Node.TEXT_NODE && !el.closest('pre')) {\n el.nextSibling.textContent = el.nextSibling.textContent.replace(/^\\n/, '');\n }\n });\n\n if(inline) {\n this.normalizeInline(node, content);\n }\n\n return node;\n }\n\n normalizeBlocks(node) {\n const blocks = Object.values(this.editor.schema.nodes)\n .filter(node => node.isBlock);\n\n const selector = blocks\n .map(block => block.spec.parseDOM?.map(spec => spec.tag))\n .flat()\n .filter(Boolean)\n .join(',');\n\n if(!selector) {\n return;\n }\n\n [...node.querySelectorAll(selector)].forEach(el => {\n if(el.parentElement.matches('p')) {\n extractElement(el);\n }\n });\n }\n\n normalizeInline(node, content) {\n if(node.firstElementChild?.matches('p')) {\n const firstParagraph = node.firstElementChild;\n const { nextElementSibling } = firstParagraph;\n const startSpaces = content.match(/^\\s+/)?.[0] ?? '';\n const endSpaces = !nextElementSibling\n ? content.match(/\\s+$/)?.[0] ?? ''\n : '';\n\n if(content.match(/^\\n\\n/)) {\n firstParagraph.innerHTML = `${firstParagraph.innerHTML}${endSpaces}`;\n return;\n }\n\n unwrapElement(firstParagraph);\n\n node.innerHTML = `${startSpaces}${node.innerHTML}${endSpaces}`;\n }\n }\n\n /**\n * @param {markdownit} md\n */\n withPatchedRenderer(md) {\n const withoutNewLine = (renderer) => (...args) => {\n const rendered = renderer(...args);\n if(rendered === '\\n') {\n return rendered; // keep soft breaks\n }\n if(rendered[rendered.length - 1] === '\\n') {\n return rendered.slice(0, -1);\n }\n return rendered;\n }\n\n md.renderer.rules.hardbreak = withoutNewLine(md.renderer.rules.hardbreak);\n md.renderer.rules.softbreak = withoutNewLine(md.renderer.rules.softbreak);\n md.renderer.rules.fence = withoutNewLine(md.renderer.rules.fence);\n md.renderer.rules.code_block = withoutNewLine(md.renderer.rules.code_block);\n md.renderer.renderToken = withoutNewLine(md.renderer.renderToken.bind(md.renderer));\n\n return md;\n }\n}\n\n", "import { Extension } from \"@tiptap/core\";\nimport { Plugin, PluginKey } from '@tiptap/pm/state';\nimport { DOMParser } from '@tiptap/pm/model';\nimport { elementFromString } from \"../../util/dom\";\n\nexport const MarkdownClipboard = Extension.create({\n name: 'markdownClipboard',\n addOptions() {\n return {\n transformPastedText: false,\n transformCopiedText: false,\n }\n },\n addProseMirrorPlugins() {\n return [\n new Plugin({\n key: new PluginKey('markdownClipboard'),\n props: {\n clipboardTextParser: (text, context, plainText) => {\n if(plainText || !this.options.transformPastedText) {\n return null; // pasting with shift key prevents formatting\n }\n const parsed = this.editor.storage.markdown.parser.parse(text, { inline: true });\n return DOMParser.fromSchema(this.editor.schema)\n .parseSlice(elementFromString(parsed), {\n preserveWhitespace: true,\n context,\n });\n },\n /**\n * @param {import('prosemirror-model').Slice} slice\n */\n clipboardTextSerializer: (slice) => {\n if(!this.options.transformCopiedText) {\n return null;\n }\n return this.editor.storage.markdown.serializer.serialize(slice.content);\n },\n },\n })\n ]\n }\n})\n", "import { Extension, extensions } from '@tiptap/core';\nimport { MarkdownTightLists } from \"./extensions/tiptap/tight-lists\";\nimport { MarkdownSerializer } from \"./serialize/MarkdownSerializer\";\nimport { MarkdownParser } from \"./parse/MarkdownParser\";\nimport { MarkdownClipboard } from \"./extensions/tiptap/clipboard\";\n\nexport const Markdown = Extension.create({\n name: 'markdown',\n priority: 50,\n addOptions() {\n return {\n html: true,\n tightLists: true,\n tightListClass: 'tight',\n bulletListMarker: '-',\n linkify: false,\n breaks: false,\n transformPastedText: false,\n transformCopiedText: false,\n }\n },\n addCommands() {\n const commands = extensions.Commands.config.addCommands();\n return {\n setContent: (content, options) => (props) => {\n return commands.setContent(\n props.editor.storage.markdown.parser.parse(content),\n options\n )(props);\n },\n insertContentAt: (range, content, options) => (props) => {\n return commands.insertContentAt(\n range,\n props.editor.storage.markdown.parser.parse(content, { inline: true }),\n options\n )(props);\n },\n }\n },\n onBeforeCreate() {\n this.editor.storage.markdown = {\n options: { ...this.options },\n parser: new MarkdownParser(this.editor, this.options),\n serializer: new MarkdownSerializer(this.editor),\n getMarkdown: () => {\n return this.editor.storage.markdown.serializer.serialize(this.editor.state.doc);\n },\n }\n this.editor.options.initialContent = this.editor.options.content;\n this.editor.options.content = this.editor.storage.markdown.parser.parse(this.editor.options.content);\n },\n onCreate() {\n this.editor.options.content = this.editor.options.initialContent;\n delete this.editor.options.initialContent;\n },\n addStorage() {\n return {\n /// storage will be defined in onBeforeCreate() to prevent initial object overriding\n }\n },\n addExtensions() {\n return [\n MarkdownTightLists.configure({\n tight: this.options.tightLists,\n tightClass: this.options.tightListClass,\n }),\n MarkdownClipboard.configure({\n transformPastedText: this.options.transformPastedText,\n transformCopiedText: this.options.transformCopiedText,\n }),\n ]\n },\n});\n", "// Re-export of `tiptap-markdown`'s `Markdown` extension. The .ts source\n// here only types the re-export; the .js emitted alongside it under\n// `dist/` is REPLACED at build time by an esbuild-produced ESM bundle\n// that inlines `tiptap-markdown` + `markdown-it` + `markdown-it-task-lists`.\n//\n// Why bundle. `tiptap-markdown@0.9.0`'s task-list node imports\n// `markdown-it-task-lists` as `import x from 'markdown-it-task-lists'`,\n// but that package ships pure CJS (`module.exports = fn`) with no\n// `default` export. Vite's dev runtime serves the raw CJS and does not\n// synthesize a `default`, so the import throws at client-bundle init and\n// the whole admin app silently fails to mount. Pre-bundling the chain\n// here moves CJS\u2194ESM interop to @pilotiq/tiptap's build step (esbuild\n// handles it cleanly) so downstream consumers don't have to wire\n// `optimizeDeps.include` for the CJS transitive.\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nimport { Markdown as MarkdownImpl } from 'tiptap-markdown'\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const Markdown: any = MarkdownImpl\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAKA,QAAI,oBAAoB;AACxB,QAAI,kBAAkB;AACtB,QAAI,gBAAgB;AAEpB,WAAO,UAAU,SAASA,KAAI,SAAS;AACtC,UAAI,SAAS;AACZ,4BAAoB,CAAC,QAAQ;AAC7B,0BAAkB,CAAC,CAAC,QAAQ;AAC5B,wBAAgB,CAAC,CAAC,QAAQ;AAAA,MAC3B;AAEA,MAAAA,IAAG,KAAK,MAAM,MAAM,UAAU,qBAAqB,SAAS,OAAO;AAClE,YAAI,SAAS,MAAM;AACnB,iBA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,CACHlU,mBAAmBmU,UAAU;MACzB9T,OAAO,KAAKK,QAAQ4S;MACpBhT,YAAY,KAAKI,QAAQ6S;IAC7B,CAAC,GACDrB,kBAAkBiC,UAAU;MACxBhC,qBAAqB,KAAKzR,QAAQyR;MAClCC,qBAAqB,KAAK1R,QAAQ0R;IACrC,CAAA,CAAC;EAEV;AACJ,CAAC;;;ACtDM,IAAMgC,YAAgB;",
|
|
6
|
-
"names": ["md", "attrSet", "found", "map", "text", "found", "schema", "attrs", "set", "Node", "match", "base", "i", "type", "nfa", "compile", "edge", "expr", "node", "states", "name", "mark", "fromCodePoint", "code", "regex_default", "regex_default", "regex_default", "regex_default", "regex_default", "regex_default", "_a", "CharCodes", "BinTrieFlags", "code", "EntityDecoderState", "DecodingMode", "errors", "base", "_a", "map", "escape", "match", "EntityLevel", "EncodingMode", "fromCodePoint", "match", "code", "entity", "regex_default", "found", "code", "code", "list", "attrs", "md", "text", "match", "replace", "text", "replace", "md", "code", "nextLine", "pos", "max", "_rules", "md", "md", "linkify", "match", "link", "escape", "postProcess", "code", "attrs", "code", "attrs", "isLinkOpen", "isLinkClose", "match", "match", "code", "fromCodePoint", "_rules", "linkify", "escape", "_rules2", "md", "regex_default", "assign", "_class", "isString", "escapeRE", "text", "match", "tlds", "schema", "list", "normalize", "decode", "encode", "list", "schema", "tokenHandlers", "text", "attrs", "tokens", "fence", "link", "escape", "add", "MarkdownTightLists", "Extension", "create", "name", "addOptions", "tight", "tightClass", "listTypes", "addGlobalAttributes", "types", "options", "attributes", "default", "parseHTML", "element", "getAttribute", "querySelector", "renderHTML", "class", "addCommands", "_this", "toggleTight", "arguments", "length", "undefined", "_ref", "editor", "commands", "isActive", "attrs", "getAttributes", "updateAttributes", "some", "md", "markdownit", "scanDelims", "text", "pos", "inline", "State", "prototype", "call", "src", "posMax", "state", "shiftDelim", "delim", "start", "offset", "res", "substring", "trimStart", "from", "to", "can_open", "trimEnd", "can_close", "trimInline", "MarkdownSerializerState", "BaseMarkdownSerializerState", "constructor", "nodes", "marks", "inTable", "inlines", "render", "node", "parent", "index", "top", "end", "delimiter", "normalizeInline", "out", "pop", "markString", "mark", "open", "info", "type", "expelEnclosingWhitespace", "push", "charAt", "match", "Mark", "addStorage", "markdown", "serialize", "_getMarkTags$", "_getMarkTags", "storage", "html", "console", "warn", "getMarkTags", "close", "_getMarkTags$2", "_getMarkTags2", "parse", "schema", "getHTMLFromFragment", "Fragment", "elementFromString", "value", "wrappedValue", "window", "DOMParser", "parseFromString", "body", "escapeHTML", "replace", "extractElement", "parentElement", "prepend", "cloneNode", "firstChild", "appendChild", "childNodes", "insertBefore", "remove", "unwrapElement", "parentNode", "removeChild", "Node", "write", "serializeHTML", "isBlock", "closeBlock", "topNodeType", "formatBlock", "dom", "firstElementChild", "innerHTML", "trim", "outerHTML", "Blockquote", "extend", "defaultMarkdownSerializer", "blockquote", "BulletList", "renderList", "bulletListMarker", "CodeBlock", "language", "textContent", "ensureNewLine", "setup", "_this$options$languag", "set", "langPrefix", "languageClassPrefix", "updateDOM", "HardBreak", "i", "childCount", "child", "HTMLNode", "Heading", "heading", "HorizontalRule", "horizontal_rule", "Image", "image", "ListItem", "list_item", "OrderedList", "findIndexOfAdjacentNode", "maxW", "String", "space", "repeat", "adjacentIndex", "separator", "nStr", "Paragraph", "paragraph", "_node$content$content", "_node$content", "content", "Table", "isMarkdownSerializable", "forEach", "row", "p", "col", "j", "cellContent", "renderInline", "delimiterRow", "Array", "map", "join", "hasSpan", "colspan", "rowspan", "rows", "firstRow", "bodyRows", "slice", "cell", "TaskItem", "check", "checked", "renderContent", "querySelectorAll", "item", "input", "setAttribute", "TaskList", "use", "taskListPlugin", "list", "Text", "Bold", "strong", "Code", "code", "Italic", "em", "Link", "link", "Strike", "HTMLMark", "getMarkdownSpec", "extension", "_extension$storage", "_markdownExtensions$f", "markdownSpec", "defaultMarkdownSpec", "markdownExtensions", "find", "e", "MarkdownSerializer", "hardBreakNodeName", "_this$editor$extensio", "Object", "fromEntries", "keys", "serializeNode", "extensionManager", "extensions", "filter", "_this$editor$extensio2", "serializeMark", "_getMarkdownSpec", "bind", "_getMarkdownSpec2", "MarkdownParser", "linkify", "breaks", "withPatchedRenderer", "renderedHTML", "normalizeDOM", "_ref2", "normalizeBlocks", "el", "_el$nextSibling", "nextSibling", "nodeType", "TEXT_NODE", "closest", "blocks", "values", "selector", "block", "_block$spec$parseDOM", "spec", "parseDOM", "tag", "flat", "Boolean", "matches", "_node$firstElementChi", "_content$match$", "_content$match", "_content$match$2", "_content$match2", "firstParagraph", "nextElementSibling", "startSpaces", "endSpaces", "withoutNewLine", "renderer", "rendered", "rules", "hardbreak", "softbreak", "fence", "code_block", "renderToken", "MarkdownClipboard", "transformPastedText", "transformCopiedText", "addProseMirrorPlugins", "Plugin", "key", "PluginKey", "props", "clipboardTextParser", "context", "plainText", "parsed", "parser", "fromSchema", "parseSlice", "preserveWhitespace", "clipboardTextSerializer", "serializer", "Markdown", "priority", "tightLists", "tightListClass", "Commands", "config", "setContent", "insertContentAt", "range", "onBeforeCreate", "getMarkdown", "doc", "initialContent", "onCreate", "addExtensions", "configure", "Markdown"]
|
|
7
|
-
}
|