@e-llm-studio/instant-learning 0.0.104 → 0.0.105
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/cjs/features/IL-OTJ/ILOTJ.js +1 -1
- package/dist/cjs/features/IL-OTJ/_components/ChatComponent.js +1 -1
- package/dist/cjs/features/IL-OTJ/_components/CitationLink.js +1 -1
- package/dist/cjs/features/IL-OTJ/_components/CognitiveDecisioningCard.js +1 -1
- package/dist/cjs/features/IL-OTJ/_components/ILPopup.styles.js +1 -1
- package/dist/cjs/features/IL-OTJ/_components/InputDataReasoningCard.js +2 -0
- package/dist/cjs/features/IL-OTJ/_components/InputDataReasoningCard.js.map +1 -0
- package/dist/cjs/features/IL-OTJ/_components/MessageRendering.js +1 -1
- package/dist/cjs/features/IL-OTJ/_components/MinimizedThinkingSteps.js +1 -1
- package/dist/cjs/features/IL-OTJ/_components/molecules/Condition/ConditionList.js +1 -1
- package/dist/cjs/features/IL-OTJ/_components/organisms/ConditionSection/ConditionSection.js +1 -1
- package/dist/cjs/features/IL-OTJ/_components/templates/TrafficManager/CreateRule.js +1 -1
- package/dist/cjs/node_modules/@e-llm-studio/citation/dist/features/Bookemon/Bookemon.js.map +1 -1
- package/dist/cjs/node_modules/@e-llm-studio/citation/dist/features/CitationRenderer/MarkdownRenderer.js +1 -1
- package/dist/cjs/node_modules/@e-llm-studio/citation/dist/features/CitationRenderer/MarkdownRenderer.js.map +1 -1
- package/dist/cjs/node_modules/mdast-util-find-and-replace/lib/index.js +1 -1
- package/dist/cjs/node_modules/mdast-util-find-and-replace/lib/index.js.map +1 -1
- package/dist/cjs/node_modules/mdast-util-find-and-replace/node_modules/unist-util-is/lib/index.js +2 -0
- package/dist/cjs/node_modules/mdast-util-find-and-replace/node_modules/unist-util-is/lib/index.js.map +1 -0
- package/dist/cjs/node_modules/mdast-util-find-and-replace/node_modules/unist-util-visit-parents/lib/color.browser.js +2 -0
- package/dist/cjs/node_modules/mdast-util-find-and-replace/node_modules/unist-util-visit-parents/lib/color.browser.js.map +1 -0
- package/dist/cjs/node_modules/mdast-util-find-and-replace/node_modules/unist-util-visit-parents/lib/index.js +2 -0
- package/dist/cjs/node_modules/mdast-util-find-and-replace/node_modules/unist-util-visit-parents/lib/index.js.map +1 -0
- package/dist/cjs/node_modules/mdast-util-from-markdown/lib/index.js +2 -0
- package/dist/cjs/node_modules/mdast-util-from-markdown/lib/index.js.map +1 -0
- package/dist/cjs/node_modules/mdast-util-from-markdown/node_modules/unist-util-stringify-position/lib/index.js +2 -0
- package/dist/cjs/node_modules/mdast-util-from-markdown/node_modules/unist-util-stringify-position/lib/index.js.map +1 -0
- package/dist/cjs/node_modules/mdast-util-gfm/lib/index.js +1 -1
- package/dist/cjs/node_modules/mdast-util-gfm/lib/index.js.map +1 -1
- package/dist/cjs/node_modules/mdast-util-gfm-autolink-literal/lib/index.js +1 -1
- package/dist/cjs/node_modules/mdast-util-gfm-autolink-literal/lib/index.js.map +1 -1
- package/dist/cjs/node_modules/mdast-util-gfm-autolink-literal/node_modules/micromark-util-character/index.js +2 -0
- package/dist/cjs/node_modules/mdast-util-gfm-autolink-literal/node_modules/micromark-util-character/index.js.map +1 -0
- package/dist/cjs/node_modules/mdast-util-gfm-autolink-literal/node_modules/micromark-util-character/lib/unicode-punctuation-regex.js +2 -0
- package/dist/cjs/node_modules/mdast-util-gfm-autolink-literal/node_modules/micromark-util-character/lib/unicode-punctuation-regex.js.map +1 -0
- package/dist/cjs/node_modules/mdast-util-gfm-footnote/lib/index.js +1 -1
- package/dist/cjs/node_modules/mdast-util-gfm-footnote/lib/index.js.map +1 -1
- package/dist/cjs/node_modules/mdast-util-gfm-strikethrough/lib/index.js +1 -1
- package/dist/cjs/node_modules/mdast-util-gfm-strikethrough/lib/index.js.map +1 -1
- package/dist/cjs/node_modules/mdast-util-gfm-table/lib/index.js +1 -1
- package/dist/cjs/node_modules/mdast-util-gfm-table/lib/index.js.map +1 -1
- package/dist/cjs/node_modules/mdast-util-gfm-task-list-item/lib/index.js +1 -1
- package/dist/cjs/node_modules/mdast-util-gfm-task-list-item/lib/index.js.map +1 -1
- package/dist/cjs/node_modules/mdast-util-to-markdown/lib/handle/inline-code.js +1 -1
- package/dist/cjs/node_modules/mdast-util-to-markdown/lib/handle/inline-code.js.map +1 -1
- package/dist/cjs/node_modules/mdast-util-to-markdown/lib/handle/list-item.js.map +1 -1
- package/dist/cjs/node_modules/mdast-util-to-markdown/lib/util/association.js +2 -0
- package/dist/cjs/node_modules/mdast-util-to-markdown/lib/util/association.js.map +1 -0
- package/dist/cjs/node_modules/mdast-util-to-markdown/lib/util/check-bullet.js.map +1 -1
- package/dist/cjs/node_modules/mdast-util-to-markdown/lib/util/check-list-item-indent.js +1 -1
- package/dist/cjs/node_modules/mdast-util-to-markdown/lib/util/check-list-item-indent.js.map +1 -1
- package/dist/cjs/node_modules/mdast-util-to-markdown/lib/util/container-flow.js +2 -0
- package/dist/cjs/node_modules/mdast-util-to-markdown/lib/util/container-flow.js.map +1 -0
- package/dist/cjs/node_modules/mdast-util-to-markdown/lib/util/container-phrasing.js +2 -0
- package/dist/cjs/node_modules/mdast-util-to-markdown/lib/util/container-phrasing.js.map +1 -0
- package/dist/cjs/node_modules/mdast-util-to-markdown/lib/util/indent-lines.js +2 -0
- package/dist/cjs/node_modules/mdast-util-to-markdown/lib/util/indent-lines.js.map +1 -0
- package/dist/cjs/node_modules/mdast-util-to-markdown/lib/util/pattern-compile.js +2 -0
- package/dist/cjs/node_modules/mdast-util-to-markdown/lib/util/pattern-compile.js.map +1 -0
- package/dist/cjs/node_modules/mdast-util-to-markdown/lib/util/pattern-in-scope.js.map +1 -1
- package/dist/cjs/node_modules/mdast-util-to-markdown/lib/util/safe.js +2 -0
- package/dist/cjs/node_modules/mdast-util-to-markdown/lib/util/safe.js.map +1 -0
- package/dist/cjs/node_modules/mdast-util-to-markdown/lib/util/track.js +2 -0
- package/dist/cjs/node_modules/mdast-util-to-markdown/lib/util/track.js.map +1 -0
- package/dist/cjs/node_modules/mdast-util-to-string/lib/index.js.map +1 -1
- package/dist/cjs/node_modules/micromark/lib/constructs.js +2 -0
- package/dist/cjs/node_modules/micromark/lib/constructs.js.map +1 -0
- package/dist/cjs/node_modules/micromark/lib/create-tokenizer.js +2 -0
- package/dist/cjs/node_modules/micromark/lib/create-tokenizer.js.map +1 -0
- package/dist/cjs/node_modules/micromark/lib/initialize/content.js +2 -0
- package/dist/cjs/node_modules/micromark/lib/initialize/content.js.map +1 -0
- package/dist/cjs/node_modules/micromark/lib/initialize/document.js +2 -0
- package/dist/cjs/node_modules/micromark/lib/initialize/document.js.map +1 -0
- package/dist/cjs/node_modules/micromark/lib/initialize/flow.js +2 -0
- package/dist/cjs/node_modules/micromark/lib/initialize/flow.js.map +1 -0
- package/dist/cjs/node_modules/micromark/lib/initialize/text.js +2 -0
- package/dist/cjs/node_modules/micromark/lib/initialize/text.js.map +1 -0
- package/dist/cjs/node_modules/micromark/lib/parse.js +2 -0
- package/dist/cjs/node_modules/micromark/lib/parse.js.map +1 -0
- package/dist/cjs/node_modules/micromark/lib/postprocess.js +2 -0
- package/dist/cjs/node_modules/micromark/lib/postprocess.js.map +1 -0
- package/dist/cjs/node_modules/micromark/lib/preprocess.js +2 -0
- package/dist/cjs/node_modules/micromark/lib/preprocess.js.map +1 -0
- package/dist/cjs/node_modules/micromark/node_modules/micromark-util-character/index.js +2 -0
- package/dist/cjs/node_modules/micromark/node_modules/micromark-util-character/index.js.map +1 -0
- package/dist/cjs/node_modules/micromark-core-commonmark/lib/attention.js +2 -0
- package/dist/cjs/node_modules/micromark-core-commonmark/lib/attention.js.map +1 -0
- package/dist/cjs/node_modules/micromark-core-commonmark/lib/autolink.js +2 -0
- package/dist/cjs/node_modules/micromark-core-commonmark/lib/autolink.js.map +1 -0
- package/dist/cjs/node_modules/micromark-core-commonmark/lib/blank-line.js +1 -1
- package/dist/cjs/node_modules/micromark-core-commonmark/lib/blank-line.js.map +1 -1
- package/dist/cjs/node_modules/micromark-core-commonmark/lib/block-quote.js +2 -0
- package/dist/cjs/node_modules/micromark-core-commonmark/lib/block-quote.js.map +1 -0
- package/dist/cjs/node_modules/micromark-core-commonmark/lib/character-escape.js +2 -0
- package/dist/cjs/node_modules/micromark-core-commonmark/lib/character-escape.js.map +1 -0
- package/dist/cjs/node_modules/micromark-core-commonmark/lib/character-reference.js +2 -0
- package/dist/cjs/node_modules/micromark-core-commonmark/lib/character-reference.js.map +1 -0
- package/dist/cjs/node_modules/micromark-core-commonmark/lib/code-fenced.js +2 -0
- package/dist/cjs/node_modules/micromark-core-commonmark/lib/code-fenced.js.map +1 -0
- package/dist/cjs/node_modules/micromark-core-commonmark/lib/code-indented.js +2 -0
- package/dist/cjs/node_modules/micromark-core-commonmark/lib/code-indented.js.map +1 -0
- package/dist/cjs/node_modules/micromark-core-commonmark/lib/code-text.js +2 -0
- package/dist/cjs/node_modules/micromark-core-commonmark/lib/code-text.js.map +1 -0
- package/dist/cjs/node_modules/micromark-core-commonmark/lib/content.js +2 -0
- package/dist/cjs/node_modules/micromark-core-commonmark/lib/content.js.map +1 -0
- package/dist/cjs/node_modules/micromark-core-commonmark/lib/definition.js +2 -0
- package/dist/cjs/node_modules/micromark-core-commonmark/lib/definition.js.map +1 -0
- package/dist/cjs/node_modules/micromark-core-commonmark/lib/hard-break-escape.js +2 -0
- package/dist/cjs/node_modules/micromark-core-commonmark/lib/hard-break-escape.js.map +1 -0
- package/dist/cjs/node_modules/micromark-core-commonmark/lib/heading-atx.js +2 -0
- package/dist/cjs/node_modules/micromark-core-commonmark/lib/heading-atx.js.map +1 -0
- package/dist/cjs/node_modules/micromark-core-commonmark/lib/html-flow.js +2 -0
- package/dist/cjs/node_modules/micromark-core-commonmark/lib/html-flow.js.map +1 -0
- package/dist/cjs/node_modules/micromark-core-commonmark/lib/html-text.js +2 -0
- package/dist/cjs/node_modules/micromark-core-commonmark/lib/html-text.js.map +1 -0
- package/dist/cjs/node_modules/micromark-core-commonmark/lib/label-end.js +2 -0
- package/dist/cjs/node_modules/micromark-core-commonmark/lib/label-end.js.map +1 -0
- package/dist/cjs/node_modules/micromark-core-commonmark/lib/label-start-image.js +2 -0
- package/dist/cjs/node_modules/micromark-core-commonmark/lib/label-start-image.js.map +1 -0
- package/dist/cjs/node_modules/micromark-core-commonmark/lib/label-start-link.js +2 -0
- package/dist/cjs/node_modules/micromark-core-commonmark/lib/label-start-link.js.map +1 -0
- package/dist/cjs/node_modules/micromark-core-commonmark/lib/line-ending.js +2 -0
- package/dist/cjs/node_modules/micromark-core-commonmark/lib/line-ending.js.map +1 -0
- package/dist/cjs/node_modules/micromark-core-commonmark/lib/list.js +2 -0
- package/dist/cjs/node_modules/micromark-core-commonmark/lib/list.js.map +1 -0
- package/dist/cjs/node_modules/micromark-core-commonmark/lib/setext-underline.js +2 -0
- package/dist/cjs/node_modules/micromark-core-commonmark/lib/setext-underline.js.map +1 -0
- package/dist/cjs/node_modules/micromark-core-commonmark/lib/thematic-break.js +2 -0
- package/dist/cjs/node_modules/micromark-core-commonmark/lib/thematic-break.js.map +1 -0
- package/dist/cjs/node_modules/micromark-core-commonmark/node_modules/micromark-util-character/index.js +2 -0
- package/dist/cjs/node_modules/micromark-core-commonmark/node_modules/micromark-util-character/index.js.map +1 -0
- package/dist/cjs/node_modules/micromark-extension-gfm/index.js +1 -1
- package/dist/cjs/node_modules/micromark-extension-gfm/index.js.map +1 -1
- package/dist/cjs/node_modules/micromark-extension-gfm-autolink-literal/lib/syntax.js +1 -1
- package/dist/cjs/node_modules/micromark-extension-gfm-autolink-literal/lib/syntax.js.map +1 -1
- package/dist/cjs/node_modules/micromark-extension-gfm-autolink-literal/node_modules/micromark-util-character/index.js +2 -0
- package/dist/cjs/node_modules/micromark-extension-gfm-autolink-literal/node_modules/micromark-util-character/index.js.map +1 -0
- package/dist/cjs/node_modules/micromark-extension-gfm-autolink-literal/node_modules/micromark-util-character/lib/unicode-punctuation-regex.js +2 -0
- package/dist/cjs/node_modules/micromark-extension-gfm-autolink-literal/node_modules/micromark-util-character/lib/unicode-punctuation-regex.js.map +1 -0
- package/dist/cjs/node_modules/micromark-extension-gfm-footnote/lib/syntax.js +1 -1
- package/dist/cjs/node_modules/micromark-extension-gfm-footnote/lib/syntax.js.map +1 -1
- package/dist/cjs/node_modules/micromark-extension-gfm-footnote/node_modules/micromark-util-character/index.js +2 -0
- package/dist/cjs/node_modules/micromark-extension-gfm-footnote/node_modules/micromark-util-character/index.js.map +1 -0
- package/dist/cjs/node_modules/micromark-extension-gfm-strikethrough/lib/syntax.js +1 -1
- package/dist/cjs/node_modules/micromark-extension-gfm-strikethrough/lib/syntax.js.map +1 -1
- package/dist/cjs/node_modules/micromark-extension-gfm-table/lib/edit-map.js +1 -1
- package/dist/cjs/node_modules/micromark-extension-gfm-table/lib/edit-map.js.map +1 -1
- package/dist/cjs/node_modules/micromark-extension-gfm-table/lib/infer.js.map +1 -1
- package/dist/cjs/node_modules/micromark-extension-gfm-table/lib/syntax.js +1 -1
- package/dist/cjs/node_modules/micromark-extension-gfm-table/lib/syntax.js.map +1 -1
- package/dist/cjs/node_modules/micromark-extension-gfm-table/node_modules/micromark-util-character/index.js +2 -0
- package/dist/cjs/node_modules/micromark-extension-gfm-table/node_modules/micromark-util-character/index.js.map +1 -0
- package/dist/cjs/node_modules/micromark-extension-gfm-task-list-item/lib/syntax.js +1 -1
- package/dist/cjs/node_modules/micromark-extension-gfm-task-list-item/lib/syntax.js.map +1 -1
- package/dist/cjs/node_modules/micromark-extension-gfm-task-list-item/node_modules/micromark-util-character/index.js +2 -0
- package/dist/cjs/node_modules/micromark-extension-gfm-task-list-item/node_modules/micromark-util-character/index.js.map +1 -0
- package/dist/cjs/node_modules/micromark-factory-destination/index.js +2 -0
- package/dist/cjs/node_modules/micromark-factory-destination/index.js.map +1 -0
- package/dist/cjs/node_modules/micromark-factory-destination/node_modules/micromark-util-character/index.js +2 -0
- package/dist/cjs/node_modules/micromark-factory-destination/node_modules/micromark-util-character/index.js.map +1 -0
- package/dist/cjs/node_modules/micromark-factory-label/index.js +2 -0
- package/dist/cjs/node_modules/micromark-factory-label/index.js.map +1 -0
- package/dist/cjs/node_modules/micromark-factory-label/node_modules/micromark-util-character/index.js +2 -0
- package/dist/cjs/node_modules/micromark-factory-label/node_modules/micromark-util-character/index.js.map +1 -0
- package/dist/cjs/node_modules/micromark-factory-space/index.js +1 -1
- package/dist/cjs/node_modules/micromark-factory-space/index.js.map +1 -1
- package/dist/cjs/node_modules/micromark-factory-space/node_modules/micromark-util-character/index.js +2 -0
- package/dist/cjs/node_modules/micromark-factory-space/node_modules/micromark-util-character/index.js.map +1 -0
- package/dist/cjs/node_modules/micromark-factory-title/index.js +2 -0
- package/dist/cjs/node_modules/micromark-factory-title/index.js.map +1 -0
- package/dist/cjs/node_modules/micromark-factory-title/node_modules/micromark-util-character/index.js +2 -0
- package/dist/cjs/node_modules/micromark-factory-title/node_modules/micromark-util-character/index.js.map +1 -0
- package/dist/cjs/node_modules/micromark-factory-whitespace/index.js +2 -0
- package/dist/cjs/node_modules/micromark-factory-whitespace/index.js.map +1 -0
- package/dist/cjs/node_modules/micromark-factory-whitespace/node_modules/micromark-util-character/index.js +2 -0
- package/dist/cjs/node_modules/micromark-factory-whitespace/node_modules/micromark-util-character/index.js.map +1 -0
- package/dist/cjs/node_modules/micromark-util-chunked/index.js +1 -1
- package/dist/cjs/node_modules/micromark-util-chunked/index.js.map +1 -1
- package/dist/cjs/node_modules/micromark-util-classify-character/index.js +1 -1
- package/dist/cjs/node_modules/micromark-util-classify-character/index.js.map +1 -1
- package/dist/cjs/node_modules/micromark-util-classify-character/node_modules/micromark-util-character/index.js +2 -0
- package/dist/cjs/node_modules/micromark-util-classify-character/node_modules/micromark-util-character/index.js.map +1 -0
- package/dist/cjs/node_modules/micromark-util-classify-character/node_modules/micromark-util-character/lib/unicode-punctuation-regex.js +2 -0
- package/dist/cjs/node_modules/micromark-util-classify-character/node_modules/micromark-util-character/lib/unicode-punctuation-regex.js.map +1 -0
- package/dist/cjs/node_modules/micromark-util-combine-extensions/index.js.map +1 -1
- package/dist/cjs/node_modules/micromark-util-decode-numeric-character-reference/index.js +2 -0
- package/dist/cjs/node_modules/micromark-util-decode-numeric-character-reference/index.js.map +1 -0
- package/dist/cjs/node_modules/micromark-util-decode-string/index.js +2 -0
- package/dist/cjs/node_modules/micromark-util-decode-string/index.js.map +1 -0
- package/dist/cjs/node_modules/micromark-util-html-tag-name/index.js +2 -0
- package/dist/cjs/node_modules/micromark-util-html-tag-name/index.js.map +1 -0
- package/dist/cjs/node_modules/micromark-util-normalize-identifier/index.js.map +1 -1
- package/dist/cjs/node_modules/micromark-util-resolve-all/index.js.map +1 -1
- package/dist/cjs/node_modules/micromark-util-subtokenize/index.js +2 -0
- package/dist/cjs/node_modules/micromark-util-subtokenize/index.js.map +1 -0
- package/dist/cjs/node_modules/react-markdown/lib/react-markdown.js +1 -1
- package/dist/cjs/node_modules/react-markdown/lib/react-markdown.js.map +1 -1
- package/dist/cjs/node_modules/react-markdown/node_modules/remark-parse/lib/index.js +1 -1
- package/dist/cjs/node_modules/react-markdown/node_modules/remark-parse/lib/index.js.map +1 -1
- package/dist/cjs/node_modules/remark-gfm/index.js +2 -0
- package/dist/cjs/node_modules/remark-gfm/index.js.map +1 -0
- package/dist/cjs/node_modules/unified/lib/index.js +2 -0
- package/dist/cjs/node_modules/unified/lib/index.js.map +1 -0
- package/dist/cjs/node_modules/unified/node_modules/is-plain-obj/index.js +2 -0
- package/dist/cjs/node_modules/unified/node_modules/is-plain-obj/index.js.map +1 -0
- package/dist/cjs/node_modules/unified/node_modules/unist-util-stringify-position/lib/index.js +2 -0
- package/dist/cjs/node_modules/unified/node_modules/unist-util-stringify-position/lib/index.js.map +1 -0
- package/dist/cjs/node_modules/unified/node_modules/vfile/lib/index.js +2 -0
- package/dist/cjs/node_modules/unified/node_modules/vfile/lib/index.js.map +1 -0
- package/dist/cjs/node_modules/unified/node_modules/vfile/lib/minpath.browser.js +2 -0
- package/dist/cjs/node_modules/unified/node_modules/vfile/lib/minpath.browser.js.map +1 -0
- package/dist/cjs/node_modules/unified/node_modules/vfile/lib/minproc.browser.js +2 -0
- package/dist/cjs/node_modules/unified/node_modules/vfile/lib/minproc.browser.js.map +1 -0
- package/dist/cjs/node_modules/unified/node_modules/vfile/lib/minurl.browser.js +2 -0
- package/dist/cjs/node_modules/unified/node_modules/vfile/lib/minurl.browser.js.map +1 -0
- package/dist/cjs/node_modules/unified/node_modules/vfile/lib/minurl.shared.js +2 -0
- package/dist/cjs/node_modules/unified/node_modules/vfile/lib/minurl.shared.js.map +1 -0
- package/dist/cjs/node_modules/unified/node_modules/vfile-message/lib/index.js +2 -0
- package/dist/cjs/node_modules/unified/node_modules/vfile-message/lib/index.js.map +1 -0
- package/dist/features/IL-OTJ/ILOTJ.js +1 -1
- package/dist/features/IL-OTJ/_components/ChatComponent.js +1 -1
- package/dist/features/IL-OTJ/_components/CitationLink.js +1 -1
- package/dist/features/IL-OTJ/_components/CognitiveDecisioningCard.js +1 -1
- package/dist/features/IL-OTJ/_components/ILPopup.styles.js +1 -1
- package/dist/features/IL-OTJ/_components/InputDataReasoningCard.js +2 -0
- package/dist/features/IL-OTJ/_components/InputDataReasoningCard.js.map +1 -0
- package/dist/features/IL-OTJ/_components/MessageRendering.js +1 -1
- package/dist/features/IL-OTJ/_components/MinimizedThinkingSteps.js +1 -1
- package/dist/features/IL-OTJ/_components/molecules/Condition/ConditionList.js +1 -1
- package/dist/features/IL-OTJ/_components/organisms/ConditionSection/ConditionSection.js +1 -1
- package/dist/features/IL-OTJ/_components/templates/TrafficManager/CreateRule.js +1 -1
- package/dist/node_modules/@e-llm-studio/citation/dist/features/Bookemon/Bookemon.js.map +1 -1
- package/dist/node_modules/@e-llm-studio/citation/dist/features/CitationRenderer/MarkdownRenderer.js +1 -1
- package/dist/node_modules/@e-llm-studio/citation/dist/features/CitationRenderer/MarkdownRenderer.js.map +1 -1
- package/dist/node_modules/mdast-util-find-and-replace/lib/index.js +1 -1
- package/dist/node_modules/mdast-util-find-and-replace/lib/index.js.map +1 -1
- package/dist/node_modules/mdast-util-find-and-replace/node_modules/unist-util-is/lib/index.js +2 -0
- package/dist/node_modules/mdast-util-find-and-replace/node_modules/unist-util-is/lib/index.js.map +1 -0
- package/dist/node_modules/mdast-util-find-and-replace/node_modules/unist-util-visit-parents/lib/color.browser.js +2 -0
- package/dist/node_modules/mdast-util-find-and-replace/node_modules/unist-util-visit-parents/lib/color.browser.js.map +1 -0
- package/dist/node_modules/mdast-util-find-and-replace/node_modules/unist-util-visit-parents/lib/index.js +2 -0
- package/dist/node_modules/mdast-util-find-and-replace/node_modules/unist-util-visit-parents/lib/index.js.map +1 -0
- package/dist/node_modules/mdast-util-from-markdown/lib/index.js +2 -0
- package/dist/node_modules/mdast-util-from-markdown/lib/index.js.map +1 -0
- package/dist/node_modules/mdast-util-from-markdown/node_modules/unist-util-stringify-position/lib/index.js +2 -0
- package/dist/node_modules/mdast-util-from-markdown/node_modules/unist-util-stringify-position/lib/index.js.map +1 -0
- package/dist/node_modules/mdast-util-gfm/lib/index.js +1 -1
- package/dist/node_modules/mdast-util-gfm/lib/index.js.map +1 -1
- package/dist/node_modules/mdast-util-gfm-autolink-literal/lib/index.js +1 -1
- package/dist/node_modules/mdast-util-gfm-autolink-literal/lib/index.js.map +1 -1
- package/dist/node_modules/mdast-util-gfm-autolink-literal/node_modules/micromark-util-character/index.js +2 -0
- package/dist/node_modules/mdast-util-gfm-autolink-literal/node_modules/micromark-util-character/index.js.map +1 -0
- package/dist/node_modules/mdast-util-gfm-autolink-literal/node_modules/micromark-util-character/lib/unicode-punctuation-regex.js +2 -0
- package/dist/node_modules/mdast-util-gfm-autolink-literal/node_modules/micromark-util-character/lib/unicode-punctuation-regex.js.map +1 -0
- package/dist/node_modules/mdast-util-gfm-footnote/lib/index.js +1 -1
- package/dist/node_modules/mdast-util-gfm-footnote/lib/index.js.map +1 -1
- package/dist/node_modules/mdast-util-gfm-strikethrough/lib/index.js +1 -1
- package/dist/node_modules/mdast-util-gfm-strikethrough/lib/index.js.map +1 -1
- package/dist/node_modules/mdast-util-gfm-table/lib/index.js +1 -1
- package/dist/node_modules/mdast-util-gfm-table/lib/index.js.map +1 -1
- package/dist/node_modules/mdast-util-gfm-task-list-item/lib/index.js +1 -1
- package/dist/node_modules/mdast-util-gfm-task-list-item/lib/index.js.map +1 -1
- package/dist/node_modules/mdast-util-to-markdown/lib/handle/inline-code.js +1 -1
- package/dist/node_modules/mdast-util-to-markdown/lib/handle/inline-code.js.map +1 -1
- package/dist/node_modules/mdast-util-to-markdown/lib/handle/list-item.js.map +1 -1
- package/dist/node_modules/mdast-util-to-markdown/lib/util/association.js +2 -0
- package/dist/node_modules/mdast-util-to-markdown/lib/util/association.js.map +1 -0
- package/dist/node_modules/mdast-util-to-markdown/lib/util/check-bullet.js.map +1 -1
- package/dist/node_modules/mdast-util-to-markdown/lib/util/check-list-item-indent.js +1 -1
- package/dist/node_modules/mdast-util-to-markdown/lib/util/check-list-item-indent.js.map +1 -1
- package/dist/node_modules/mdast-util-to-markdown/lib/util/container-flow.js +2 -0
- package/dist/node_modules/mdast-util-to-markdown/lib/util/container-flow.js.map +1 -0
- package/dist/node_modules/mdast-util-to-markdown/lib/util/container-phrasing.js +2 -0
- package/dist/node_modules/mdast-util-to-markdown/lib/util/container-phrasing.js.map +1 -0
- package/dist/node_modules/mdast-util-to-markdown/lib/util/indent-lines.js +2 -0
- package/dist/node_modules/mdast-util-to-markdown/lib/util/indent-lines.js.map +1 -0
- package/dist/node_modules/mdast-util-to-markdown/lib/util/pattern-compile.js +2 -0
- package/dist/node_modules/mdast-util-to-markdown/lib/util/pattern-compile.js.map +1 -0
- package/dist/node_modules/mdast-util-to-markdown/lib/util/pattern-in-scope.js.map +1 -1
- package/dist/node_modules/mdast-util-to-markdown/lib/util/safe.js +2 -0
- package/dist/node_modules/mdast-util-to-markdown/lib/util/safe.js.map +1 -0
- package/dist/node_modules/mdast-util-to-markdown/lib/util/track.js +2 -0
- package/dist/node_modules/mdast-util-to-markdown/lib/util/track.js.map +1 -0
- package/dist/node_modules/mdast-util-to-string/lib/index.js.map +1 -1
- package/dist/node_modules/micromark/lib/constructs.js +2 -0
- package/dist/node_modules/micromark/lib/constructs.js.map +1 -0
- package/dist/node_modules/micromark/lib/create-tokenizer.js +2 -0
- package/dist/node_modules/micromark/lib/create-tokenizer.js.map +1 -0
- package/dist/node_modules/micromark/lib/initialize/content.js +2 -0
- package/dist/node_modules/micromark/lib/initialize/content.js.map +1 -0
- package/dist/node_modules/micromark/lib/initialize/document.js +2 -0
- package/dist/node_modules/micromark/lib/initialize/document.js.map +1 -0
- package/dist/node_modules/micromark/lib/initialize/flow.js +2 -0
- package/dist/node_modules/micromark/lib/initialize/flow.js.map +1 -0
- package/dist/node_modules/micromark/lib/initialize/text.js +2 -0
- package/dist/node_modules/micromark/lib/initialize/text.js.map +1 -0
- package/dist/node_modules/micromark/lib/parse.js +2 -0
- package/dist/node_modules/micromark/lib/parse.js.map +1 -0
- package/dist/node_modules/micromark/lib/postprocess.js +2 -0
- package/dist/node_modules/micromark/lib/postprocess.js.map +1 -0
- package/dist/node_modules/micromark/lib/preprocess.js +2 -0
- package/dist/node_modules/micromark/lib/preprocess.js.map +1 -0
- package/dist/node_modules/micromark/node_modules/micromark-util-character/index.js +2 -0
- package/dist/node_modules/micromark/node_modules/micromark-util-character/index.js.map +1 -0
- package/dist/node_modules/micromark-core-commonmark/lib/attention.js +2 -0
- package/dist/node_modules/micromark-core-commonmark/lib/attention.js.map +1 -0
- package/dist/node_modules/micromark-core-commonmark/lib/autolink.js +2 -0
- package/dist/node_modules/micromark-core-commonmark/lib/autolink.js.map +1 -0
- package/dist/node_modules/micromark-core-commonmark/lib/blank-line.js +1 -1
- package/dist/node_modules/micromark-core-commonmark/lib/blank-line.js.map +1 -1
- package/dist/node_modules/micromark-core-commonmark/lib/block-quote.js +2 -0
- package/dist/node_modules/micromark-core-commonmark/lib/block-quote.js.map +1 -0
- package/dist/node_modules/micromark-core-commonmark/lib/character-escape.js +2 -0
- package/dist/node_modules/micromark-core-commonmark/lib/character-escape.js.map +1 -0
- package/dist/node_modules/micromark-core-commonmark/lib/character-reference.js +2 -0
- package/dist/node_modules/micromark-core-commonmark/lib/character-reference.js.map +1 -0
- package/dist/node_modules/micromark-core-commonmark/lib/code-fenced.js +2 -0
- package/dist/node_modules/micromark-core-commonmark/lib/code-fenced.js.map +1 -0
- package/dist/node_modules/micromark-core-commonmark/lib/code-indented.js +2 -0
- package/dist/node_modules/micromark-core-commonmark/lib/code-indented.js.map +1 -0
- package/dist/node_modules/micromark-core-commonmark/lib/code-text.js +2 -0
- package/dist/node_modules/micromark-core-commonmark/lib/code-text.js.map +1 -0
- package/dist/node_modules/micromark-core-commonmark/lib/content.js +2 -0
- package/dist/node_modules/micromark-core-commonmark/lib/content.js.map +1 -0
- package/dist/node_modules/micromark-core-commonmark/lib/definition.js +2 -0
- package/dist/node_modules/micromark-core-commonmark/lib/definition.js.map +1 -0
- package/dist/node_modules/micromark-core-commonmark/lib/hard-break-escape.js +2 -0
- package/dist/node_modules/micromark-core-commonmark/lib/hard-break-escape.js.map +1 -0
- package/dist/node_modules/micromark-core-commonmark/lib/heading-atx.js +2 -0
- package/dist/node_modules/micromark-core-commonmark/lib/heading-atx.js.map +1 -0
- package/dist/node_modules/micromark-core-commonmark/lib/html-flow.js +2 -0
- package/dist/node_modules/micromark-core-commonmark/lib/html-flow.js.map +1 -0
- package/dist/node_modules/micromark-core-commonmark/lib/html-text.js +2 -0
- package/dist/node_modules/micromark-core-commonmark/lib/html-text.js.map +1 -0
- package/dist/node_modules/micromark-core-commonmark/lib/label-end.js +2 -0
- package/dist/node_modules/micromark-core-commonmark/lib/label-end.js.map +1 -0
- package/dist/node_modules/micromark-core-commonmark/lib/label-start-image.js +2 -0
- package/dist/node_modules/micromark-core-commonmark/lib/label-start-image.js.map +1 -0
- package/dist/node_modules/micromark-core-commonmark/lib/label-start-link.js +2 -0
- package/dist/node_modules/micromark-core-commonmark/lib/label-start-link.js.map +1 -0
- package/dist/node_modules/micromark-core-commonmark/lib/line-ending.js +2 -0
- package/dist/node_modules/micromark-core-commonmark/lib/line-ending.js.map +1 -0
- package/dist/node_modules/micromark-core-commonmark/lib/list.js +2 -0
- package/dist/node_modules/micromark-core-commonmark/lib/list.js.map +1 -0
- package/dist/node_modules/micromark-core-commonmark/lib/setext-underline.js +2 -0
- package/dist/node_modules/micromark-core-commonmark/lib/setext-underline.js.map +1 -0
- package/dist/node_modules/micromark-core-commonmark/lib/thematic-break.js +2 -0
- package/dist/node_modules/micromark-core-commonmark/lib/thematic-break.js.map +1 -0
- package/dist/node_modules/micromark-core-commonmark/node_modules/micromark-util-character/index.js +2 -0
- package/dist/node_modules/micromark-core-commonmark/node_modules/micromark-util-character/index.js.map +1 -0
- package/dist/node_modules/micromark-extension-gfm/index.js +1 -1
- package/dist/node_modules/micromark-extension-gfm/index.js.map +1 -1
- package/dist/node_modules/micromark-extension-gfm-autolink-literal/lib/syntax.js +1 -1
- package/dist/node_modules/micromark-extension-gfm-autolink-literal/lib/syntax.js.map +1 -1
- package/dist/node_modules/micromark-extension-gfm-autolink-literal/node_modules/micromark-util-character/index.js +2 -0
- package/dist/node_modules/micromark-extension-gfm-autolink-literal/node_modules/micromark-util-character/index.js.map +1 -0
- package/dist/node_modules/micromark-extension-gfm-autolink-literal/node_modules/micromark-util-character/lib/unicode-punctuation-regex.js +2 -0
- package/dist/node_modules/micromark-extension-gfm-autolink-literal/node_modules/micromark-util-character/lib/unicode-punctuation-regex.js.map +1 -0
- package/dist/node_modules/micromark-extension-gfm-footnote/lib/syntax.js +1 -1
- package/dist/node_modules/micromark-extension-gfm-footnote/lib/syntax.js.map +1 -1
- package/dist/node_modules/micromark-extension-gfm-footnote/node_modules/micromark-util-character/index.js +2 -0
- package/dist/node_modules/micromark-extension-gfm-footnote/node_modules/micromark-util-character/index.js.map +1 -0
- package/dist/node_modules/micromark-extension-gfm-strikethrough/lib/syntax.js +1 -1
- package/dist/node_modules/micromark-extension-gfm-strikethrough/lib/syntax.js.map +1 -1
- package/dist/node_modules/micromark-extension-gfm-table/lib/edit-map.js +1 -1
- package/dist/node_modules/micromark-extension-gfm-table/lib/edit-map.js.map +1 -1
- package/dist/node_modules/micromark-extension-gfm-table/lib/infer.js.map +1 -1
- package/dist/node_modules/micromark-extension-gfm-table/lib/syntax.js +1 -1
- package/dist/node_modules/micromark-extension-gfm-table/lib/syntax.js.map +1 -1
- package/dist/node_modules/micromark-extension-gfm-table/node_modules/micromark-util-character/index.js +2 -0
- package/dist/node_modules/micromark-extension-gfm-table/node_modules/micromark-util-character/index.js.map +1 -0
- package/dist/node_modules/micromark-extension-gfm-task-list-item/lib/syntax.js +1 -1
- package/dist/node_modules/micromark-extension-gfm-task-list-item/lib/syntax.js.map +1 -1
- package/dist/node_modules/micromark-extension-gfm-task-list-item/node_modules/micromark-util-character/index.js +2 -0
- package/dist/node_modules/micromark-extension-gfm-task-list-item/node_modules/micromark-util-character/index.js.map +1 -0
- package/dist/node_modules/micromark-factory-destination/index.js +2 -0
- package/dist/node_modules/micromark-factory-destination/index.js.map +1 -0
- package/dist/node_modules/micromark-factory-destination/node_modules/micromark-util-character/index.js +2 -0
- package/dist/node_modules/micromark-factory-destination/node_modules/micromark-util-character/index.js.map +1 -0
- package/dist/node_modules/micromark-factory-label/index.js +2 -0
- package/dist/node_modules/micromark-factory-label/index.js.map +1 -0
- package/dist/node_modules/micromark-factory-label/node_modules/micromark-util-character/index.js +2 -0
- package/dist/node_modules/micromark-factory-label/node_modules/micromark-util-character/index.js.map +1 -0
- package/dist/node_modules/micromark-factory-space/index.js +1 -1
- package/dist/node_modules/micromark-factory-space/index.js.map +1 -1
- package/dist/node_modules/micromark-factory-space/node_modules/micromark-util-character/index.js +2 -0
- package/dist/node_modules/micromark-factory-space/node_modules/micromark-util-character/index.js.map +1 -0
- package/dist/node_modules/micromark-factory-title/index.js +2 -0
- package/dist/node_modules/micromark-factory-title/index.js.map +1 -0
- package/dist/node_modules/micromark-factory-title/node_modules/micromark-util-character/index.js +2 -0
- package/dist/node_modules/micromark-factory-title/node_modules/micromark-util-character/index.js.map +1 -0
- package/dist/node_modules/micromark-factory-whitespace/index.js +2 -0
- package/dist/node_modules/micromark-factory-whitespace/index.js.map +1 -0
- package/dist/node_modules/micromark-factory-whitespace/node_modules/micromark-util-character/index.js +2 -0
- package/dist/node_modules/micromark-factory-whitespace/node_modules/micromark-util-character/index.js.map +1 -0
- package/dist/node_modules/micromark-util-chunked/index.js +1 -1
- package/dist/node_modules/micromark-util-chunked/index.js.map +1 -1
- package/dist/node_modules/micromark-util-classify-character/index.js +1 -1
- package/dist/node_modules/micromark-util-classify-character/index.js.map +1 -1
- package/dist/node_modules/micromark-util-classify-character/node_modules/micromark-util-character/index.js +2 -0
- package/dist/node_modules/micromark-util-classify-character/node_modules/micromark-util-character/index.js.map +1 -0
- package/dist/node_modules/micromark-util-classify-character/node_modules/micromark-util-character/lib/unicode-punctuation-regex.js +2 -0
- package/dist/node_modules/micromark-util-classify-character/node_modules/micromark-util-character/lib/unicode-punctuation-regex.js.map +1 -0
- package/dist/node_modules/micromark-util-combine-extensions/index.js.map +1 -1
- package/dist/node_modules/micromark-util-decode-numeric-character-reference/index.js +2 -0
- package/dist/node_modules/micromark-util-decode-numeric-character-reference/index.js.map +1 -0
- package/dist/node_modules/micromark-util-decode-string/index.js +2 -0
- package/dist/node_modules/micromark-util-decode-string/index.js.map +1 -0
- package/dist/node_modules/micromark-util-html-tag-name/index.js +2 -0
- package/dist/node_modules/micromark-util-html-tag-name/index.js.map +1 -0
- package/dist/node_modules/micromark-util-normalize-identifier/index.js.map +1 -1
- package/dist/node_modules/micromark-util-resolve-all/index.js.map +1 -1
- package/dist/node_modules/micromark-util-subtokenize/index.js +2 -0
- package/dist/node_modules/micromark-util-subtokenize/index.js.map +1 -0
- package/dist/node_modules/react-markdown/lib/react-markdown.js +1 -1
- package/dist/node_modules/react-markdown/lib/react-markdown.js.map +1 -1
- package/dist/node_modules/react-markdown/node_modules/remark-parse/lib/index.js +1 -1
- package/dist/node_modules/react-markdown/node_modules/remark-parse/lib/index.js.map +1 -1
- package/dist/node_modules/remark-gfm/index.js +2 -0
- package/dist/node_modules/remark-gfm/index.js.map +1 -0
- package/dist/node_modules/unified/lib/index.js +2 -0
- package/dist/node_modules/unified/lib/index.js.map +1 -0
- package/dist/node_modules/unified/node_modules/is-plain-obj/index.js +2 -0
- package/dist/node_modules/unified/node_modules/is-plain-obj/index.js.map +1 -0
- package/dist/node_modules/unified/node_modules/unist-util-stringify-position/lib/index.js +2 -0
- package/dist/node_modules/unified/node_modules/unist-util-stringify-position/lib/index.js.map +1 -0
- package/dist/node_modules/unified/node_modules/vfile/lib/index.js +2 -0
- package/dist/node_modules/unified/node_modules/vfile/lib/index.js.map +1 -0
- package/dist/node_modules/unified/node_modules/vfile/lib/minpath.browser.js +2 -0
- package/dist/node_modules/unified/node_modules/vfile/lib/minpath.browser.js.map +1 -0
- package/dist/node_modules/unified/node_modules/vfile/lib/minproc.browser.js +2 -0
- package/dist/node_modules/unified/node_modules/vfile/lib/minproc.browser.js.map +1 -0
- package/dist/node_modules/unified/node_modules/vfile/lib/minurl.browser.js +2 -0
- package/dist/node_modules/unified/node_modules/vfile/lib/minurl.browser.js.map +1 -0
- package/dist/node_modules/unified/node_modules/vfile/lib/minurl.shared.js +2 -0
- package/dist/node_modules/unified/node_modules/vfile/lib/minurl.shared.js.map +1 -0
- package/dist/node_modules/unified/node_modules/vfile-message/lib/index.js +2 -0
- package/dist/node_modules/unified/node_modules/vfile-message/lib/index.js.map +1 -0
- package/dist/types/src/features/IL-OTJ/ILOTJ.d.ts +1 -0
- package/dist/types/src/features/IL-OTJ/ILOTJ.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/ILOTJTest.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/_components/ChatComponent.d.ts +1 -0
- package/dist/types/src/features/IL-OTJ/_components/ChatComponent.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/_components/CitationLink.d.ts +13 -0
- package/dist/types/src/features/IL-OTJ/_components/CitationLink.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/_components/CognitiveDecisioningCard.d.ts +3 -0
- package/dist/types/src/features/IL-OTJ/_components/CognitiveDecisioningCard.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/_components/ILPopup.styles.d.ts +1 -1
- package/dist/types/src/features/IL-OTJ/_components/ILPopup.styles.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/_components/InputDataReasoningCard.d.ts +10 -0
- package/dist/types/src/features/IL-OTJ/_components/InputDataReasoningCard.d.ts.map +1 -0
- package/dist/types/src/features/IL-OTJ/_components/MessageRendering.d.ts +3 -1
- package/dist/types/src/features/IL-OTJ/_components/MessageRendering.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/_components/_svg/RightSideIcons.d.ts +1 -0
- package/dist/types/src/features/IL-OTJ/_components/_svg/RightSideIcons.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/_components/molecules/Condition/ConditionList.d.ts +3 -1
- package/dist/types/src/features/IL-OTJ/_components/molecules/Condition/ConditionList.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/_components/organisms/ConditionSection/ConditionSection.d.ts +1 -1
- package/dist/types/src/features/IL-OTJ/_components/organisms/ConditionSection/ConditionSection.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/_components/templates/TrafficManager/CreateRule.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"syntax.js","sources":["../../../../node_modules/micromark-extension-gfm-autolink-literal/lib/syntax.js"],"sourcesContent":["/**\n * @import {Code, ConstructRecord, Event, Extension, Previous, State, TokenizeContext, Tokenizer} from 'micromark-util-types'\n */\n\nimport { asciiAlpha, asciiAlphanumeric, asciiControl, markdownLineEndingOrSpace, unicodePunctuation, unicodeWhitespace } from 'micromark-util-character';\nconst wwwPrefix = {\n tokenize: tokenizeWwwPrefix,\n partial: true\n};\nconst domain = {\n tokenize: tokenizeDomain,\n partial: true\n};\nconst path = {\n tokenize: tokenizePath,\n partial: true\n};\nconst trail = {\n tokenize: tokenizeTrail,\n partial: true\n};\nconst emailDomainDotTrail = {\n tokenize: tokenizeEmailDomainDotTrail,\n partial: true\n};\nconst wwwAutolink = {\n name: 'wwwAutolink',\n tokenize: tokenizeWwwAutolink,\n previous: previousWww\n};\nconst protocolAutolink = {\n name: 'protocolAutolink',\n tokenize: tokenizeProtocolAutolink,\n previous: previousProtocol\n};\nconst emailAutolink = {\n name: 'emailAutolink',\n tokenize: tokenizeEmailAutolink,\n previous: previousEmail\n};\n\n/** @type {ConstructRecord} */\nconst text = {};\n\n/**\n * Create an extension for `micromark` to support GitHub autolink literal\n * syntax.\n *\n * @returns {Extension}\n * Extension for `micromark` that can be passed in `extensions` to enable GFM\n * autolink literal syntax.\n */\nexport function gfmAutolinkLiteral() {\n return {\n text\n };\n}\n\n/** @type {Code} */\nlet code = 48;\n\n// Add alphanumerics.\nwhile (code < 123) {\n text[code] = emailAutolink;\n code++;\n if (code === 58) code = 65;else if (code === 91) code = 97;\n}\ntext[43] = emailAutolink;\ntext[45] = emailAutolink;\ntext[46] = emailAutolink;\ntext[95] = emailAutolink;\ntext[72] = [emailAutolink, protocolAutolink];\ntext[104] = [emailAutolink, protocolAutolink];\ntext[87] = [emailAutolink, wwwAutolink];\ntext[119] = [emailAutolink, wwwAutolink];\n\n// To do: perform email autolink literals on events, afterwards.\n// That’s where `markdown-rs` and `cmark-gfm` perform it.\n// It should look for `@`, then for atext backwards, and then for a label\n// forwards.\n// To do: `mailto:`, `xmpp:` protocol as prefix.\n\n/**\n * Email autolink literal.\n *\n * ```markdown\n * > | a contact@example.org b\n * ^^^^^^^^^^^^^^^^^^^\n * ```\n *\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeEmailAutolink(effects, ok, nok) {\n const self = this;\n /** @type {boolean | undefined} */\n let dot;\n /** @type {boolean} */\n let data;\n return start;\n\n /**\n * Start of email autolink literal.\n *\n * ```markdown\n * > | a contact@example.org b\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n if (!gfmAtext(code) || !previousEmail.call(self, self.previous) || previousUnbalanced(self.events)) {\n return nok(code);\n }\n effects.enter('literalAutolink');\n effects.enter('literalAutolinkEmail');\n return atext(code);\n }\n\n /**\n * In email atext.\n *\n * ```markdown\n * > | a contact@example.org b\n * ^\n * ```\n *\n * @type {State}\n */\n function atext(code) {\n if (gfmAtext(code)) {\n effects.consume(code);\n return atext;\n }\n if (code === 64) {\n effects.consume(code);\n return emailDomain;\n }\n return nok(code);\n }\n\n /**\n * In email domain.\n *\n * The reference code is a bit overly complex as it handles the `@`, of which\n * there may be just one.\n * Source: <https://github.com/github/cmark-gfm/blob/ef1cfcb/extensions/autolink.c#L318>\n *\n * ```markdown\n * > | a contact@example.org b\n * ^\n * ```\n *\n * @type {State}\n */\n function emailDomain(code) {\n // Dot followed by alphanumerical (not `-` or `_`).\n if (code === 46) {\n return effects.check(emailDomainDotTrail, emailDomainAfter, emailDomainDot)(code);\n }\n\n // Alphanumerical, `-`, and `_`.\n if (code === 45 || code === 95 || asciiAlphanumeric(code)) {\n data = true;\n effects.consume(code);\n return emailDomain;\n }\n\n // To do: `/` if xmpp.\n\n // Note: normally we’d truncate trailing punctuation from the link.\n // However, email autolink literals cannot contain any of those markers,\n // except for `.`, but that can only occur if it isn’t trailing.\n // So we can ignore truncating!\n return emailDomainAfter(code);\n }\n\n /**\n * In email domain, on dot that is not a trail.\n *\n * ```markdown\n * > | a contact@example.org b\n * ^\n * ```\n *\n * @type {State}\n */\n function emailDomainDot(code) {\n effects.consume(code);\n dot = true;\n return emailDomain;\n }\n\n /**\n * After email domain.\n *\n * ```markdown\n * > | a contact@example.org b\n * ^\n * ```\n *\n * @type {State}\n */\n function emailDomainAfter(code) {\n // Domain must not be empty, must include a dot, and must end in alphabetical.\n // Source: <https://github.com/github/cmark-gfm/blob/ef1cfcb/extensions/autolink.c#L332>.\n if (data && dot && asciiAlpha(self.previous)) {\n effects.exit('literalAutolinkEmail');\n effects.exit('literalAutolink');\n return ok(code);\n }\n return nok(code);\n }\n}\n\n/**\n * `www` autolink literal.\n *\n * ```markdown\n * > | a www.example.org b\n * ^^^^^^^^^^^^^^^\n * ```\n *\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeWwwAutolink(effects, ok, nok) {\n const self = this;\n return wwwStart;\n\n /**\n * Start of www autolink literal.\n *\n * ```markdown\n * > | www.example.com/a?b#c\n * ^\n * ```\n *\n * @type {State}\n */\n function wwwStart(code) {\n if (code !== 87 && code !== 119 || !previousWww.call(self, self.previous) || previousUnbalanced(self.events)) {\n return nok(code);\n }\n effects.enter('literalAutolink');\n effects.enter('literalAutolinkWww');\n // Note: we *check*, so we can discard the `www.` we parsed.\n // If it worked, we consider it as a part of the domain.\n return effects.check(wwwPrefix, effects.attempt(domain, effects.attempt(path, wwwAfter), nok), nok)(code);\n }\n\n /**\n * After a www autolink literal.\n *\n * ```markdown\n * > | www.example.com/a?b#c\n * ^\n * ```\n *\n * @type {State}\n */\n function wwwAfter(code) {\n effects.exit('literalAutolinkWww');\n effects.exit('literalAutolink');\n return ok(code);\n }\n}\n\n/**\n * Protocol autolink literal.\n *\n * ```markdown\n * > | a https://example.org b\n * ^^^^^^^^^^^^^^^^^^^\n * ```\n *\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeProtocolAutolink(effects, ok, nok) {\n const self = this;\n let buffer = '';\n let seen = false;\n return protocolStart;\n\n /**\n * Start of protocol autolink literal.\n *\n * ```markdown\n * > | https://example.com/a?b#c\n * ^\n * ```\n *\n * @type {State}\n */\n function protocolStart(code) {\n if ((code === 72 || code === 104) && previousProtocol.call(self, self.previous) && !previousUnbalanced(self.events)) {\n effects.enter('literalAutolink');\n effects.enter('literalAutolinkHttp');\n buffer += String.fromCodePoint(code);\n effects.consume(code);\n return protocolPrefixInside;\n }\n return nok(code);\n }\n\n /**\n * In protocol.\n *\n * ```markdown\n * > | https://example.com/a?b#c\n * ^^^^^\n * ```\n *\n * @type {State}\n */\n function protocolPrefixInside(code) {\n // `5` is size of `https`\n if (asciiAlpha(code) && buffer.length < 5) {\n // @ts-expect-error: definitely number.\n buffer += String.fromCodePoint(code);\n effects.consume(code);\n return protocolPrefixInside;\n }\n if (code === 58) {\n const protocol = buffer.toLowerCase();\n if (protocol === 'http' || protocol === 'https') {\n effects.consume(code);\n return protocolSlashesInside;\n }\n }\n return nok(code);\n }\n\n /**\n * In slashes.\n *\n * ```markdown\n * > | https://example.com/a?b#c\n * ^^\n * ```\n *\n * @type {State}\n */\n function protocolSlashesInside(code) {\n if (code === 47) {\n effects.consume(code);\n if (seen) {\n return afterProtocol;\n }\n seen = true;\n return protocolSlashesInside;\n }\n return nok(code);\n }\n\n /**\n * After protocol, before domain.\n *\n * ```markdown\n * > | https://example.com/a?b#c\n * ^\n * ```\n *\n * @type {State}\n */\n function afterProtocol(code) {\n // To do: this is different from `markdown-rs`:\n // https://github.com/wooorm/markdown-rs/blob/b3a921c761309ae00a51fe348d8a43adbc54b518/src/construct/gfm_autolink_literal.rs#L172-L182\n return code === null || asciiControl(code) || markdownLineEndingOrSpace(code) || unicodeWhitespace(code) || unicodePunctuation(code) ? nok(code) : effects.attempt(domain, effects.attempt(path, protocolAfter), nok)(code);\n }\n\n /**\n * After a protocol autolink literal.\n *\n * ```markdown\n * > | https://example.com/a?b#c\n * ^\n * ```\n *\n * @type {State}\n */\n function protocolAfter(code) {\n effects.exit('literalAutolinkHttp');\n effects.exit('literalAutolink');\n return ok(code);\n }\n}\n\n/**\n * `www` prefix.\n *\n * ```markdown\n * > | a www.example.org b\n * ^^^^\n * ```\n *\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeWwwPrefix(effects, ok, nok) {\n let size = 0;\n return wwwPrefixInside;\n\n /**\n * In www prefix.\n *\n * ```markdown\n * > | www.example.com\n * ^^^^\n * ```\n *\n * @type {State}\n */\n function wwwPrefixInside(code) {\n if ((code === 87 || code === 119) && size < 3) {\n size++;\n effects.consume(code);\n return wwwPrefixInside;\n }\n if (code === 46 && size === 3) {\n effects.consume(code);\n return wwwPrefixAfter;\n }\n return nok(code);\n }\n\n /**\n * After www prefix.\n *\n * ```markdown\n * > | www.example.com\n * ^\n * ```\n *\n * @type {State}\n */\n function wwwPrefixAfter(code) {\n // If there is *anything*, we can link.\n return code === null ? nok(code) : ok(code);\n }\n}\n\n/**\n * Domain.\n *\n * ```markdown\n * > | a https://example.org b\n * ^^^^^^^^^^^\n * ```\n *\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeDomain(effects, ok, nok) {\n /** @type {boolean | undefined} */\n let underscoreInLastSegment;\n /** @type {boolean | undefined} */\n let underscoreInLastLastSegment;\n /** @type {boolean | undefined} */\n let seen;\n return domainInside;\n\n /**\n * In domain.\n *\n * ```markdown\n * > | https://example.com/a\n * ^^^^^^^^^^^\n * ```\n *\n * @type {State}\n */\n function domainInside(code) {\n // Check whether this marker, which is a trailing punctuation\n // marker, optionally followed by more trailing markers, and then\n // followed by an end.\n if (code === 46 || code === 95) {\n return effects.check(trail, domainAfter, domainAtPunctuation)(code);\n }\n\n // GH documents that only alphanumerics (other than `-`, `.`, and `_`) can\n // occur, which sounds like ASCII only, but they also support `www.點看.com`,\n // so that’s Unicode.\n // Instead of some new production for Unicode alphanumerics, markdown\n // already has that for Unicode punctuation and whitespace, so use those.\n // Source: <https://github.com/github/cmark-gfm/blob/ef1cfcb/extensions/autolink.c#L12>.\n if (code === null || markdownLineEndingOrSpace(code) || unicodeWhitespace(code) || code !== 45 && unicodePunctuation(code)) {\n return domainAfter(code);\n }\n seen = true;\n effects.consume(code);\n return domainInside;\n }\n\n /**\n * In domain, at potential trailing punctuation, that was not trailing.\n *\n * ```markdown\n * > | https://example.com\n * ^\n * ```\n *\n * @type {State}\n */\n function domainAtPunctuation(code) {\n // There is an underscore in the last segment of the domain\n if (code === 95) {\n underscoreInLastSegment = true;\n }\n // Otherwise, it’s a `.`: save the last segment underscore in the\n // penultimate segment slot.\n else {\n underscoreInLastLastSegment = underscoreInLastSegment;\n underscoreInLastSegment = undefined;\n }\n effects.consume(code);\n return domainInside;\n }\n\n /**\n * After domain.\n *\n * ```markdown\n * > | https://example.com/a\n * ^\n * ```\n *\n * @type {State} */\n function domainAfter(code) {\n // Note: that’s GH says a dot is needed, but it’s not true:\n // <https://github.com/github/cmark-gfm/issues/279>\n if (underscoreInLastLastSegment || underscoreInLastSegment || !seen) {\n return nok(code);\n }\n return ok(code);\n }\n}\n\n/**\n * Path.\n *\n * ```markdown\n * > | a https://example.org/stuff b\n * ^^^^^^\n * ```\n *\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizePath(effects, ok) {\n let sizeOpen = 0;\n let sizeClose = 0;\n return pathInside;\n\n /**\n * In path.\n *\n * ```markdown\n * > | https://example.com/a\n * ^^\n * ```\n *\n * @type {State}\n */\n function pathInside(code) {\n if (code === 40) {\n sizeOpen++;\n effects.consume(code);\n return pathInside;\n }\n\n // To do: `markdown-rs` also needs this.\n // If this is a paren, and there are less closings than openings,\n // we don’t check for a trail.\n if (code === 41 && sizeClose < sizeOpen) {\n return pathAtPunctuation(code);\n }\n\n // Check whether this trailing punctuation marker is optionally\n // followed by more trailing markers, and then followed\n // by an end.\n if (code === 33 || code === 34 || code === 38 || code === 39 || code === 41 || code === 42 || code === 44 || code === 46 || code === 58 || code === 59 || code === 60 || code === 63 || code === 93 || code === 95 || code === 126) {\n return effects.check(trail, ok, pathAtPunctuation)(code);\n }\n if (code === null || markdownLineEndingOrSpace(code) || unicodeWhitespace(code)) {\n return ok(code);\n }\n effects.consume(code);\n return pathInside;\n }\n\n /**\n * In path, at potential trailing punctuation, that was not trailing.\n *\n * ```markdown\n * > | https://example.com/a\"b\n * ^\n * ```\n *\n * @type {State}\n */\n function pathAtPunctuation(code) {\n // Count closing parens.\n if (code === 41) {\n sizeClose++;\n }\n effects.consume(code);\n return pathInside;\n }\n}\n\n/**\n * Trail.\n *\n * This calls `ok` if this *is* the trail, followed by an end, which means\n * the entire trail is not part of the link.\n * It calls `nok` if this *is* part of the link.\n *\n * ```markdown\n * > | https://example.com\").\n * ^^^\n * ```\n *\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeTrail(effects, ok, nok) {\n return trail;\n\n /**\n * In trail of domain or path.\n *\n * ```markdown\n * > | https://example.com\").\n * ^\n * ```\n *\n * @type {State}\n */\n function trail(code) {\n // Regular trailing punctuation.\n if (code === 33 || code === 34 || code === 39 || code === 41 || code === 42 || code === 44 || code === 46 || code === 58 || code === 59 || code === 63 || code === 95 || code === 126) {\n effects.consume(code);\n return trail;\n }\n\n // `&` followed by one or more alphabeticals and then a `;`, is\n // as a whole considered as trailing punctuation.\n // In all other cases, it is considered as continuation of the URL.\n if (code === 38) {\n effects.consume(code);\n return trailCharacterReferenceStart;\n }\n\n // Needed because we allow literals after `[`, as we fix:\n // <https://github.com/github/cmark-gfm/issues/278>.\n // Check that it is not followed by `(` or `[`.\n if (code === 93) {\n effects.consume(code);\n return trailBracketAfter;\n }\n if (\n // `<` is an end.\n code === 60 ||\n // So is whitespace.\n code === null || markdownLineEndingOrSpace(code) || unicodeWhitespace(code)) {\n return ok(code);\n }\n return nok(code);\n }\n\n /**\n * In trail, after `]`.\n *\n * > 👉 **Note**: this deviates from `cmark-gfm` to fix a bug.\n * > See end of <https://github.com/github/cmark-gfm/issues/278> for more.\n *\n * ```markdown\n * > | https://example.com](\n * ^\n * ```\n *\n * @type {State}\n */\n function trailBracketAfter(code) {\n // Whitespace or something that could start a resource or reference is the end.\n // Switch back to trail otherwise.\n if (code === null || code === 40 || code === 91 || markdownLineEndingOrSpace(code) || unicodeWhitespace(code)) {\n return ok(code);\n }\n return trail(code);\n }\n\n /**\n * In character-reference like trail, after `&`.\n *\n * ```markdown\n * > | https://example.com&).\n * ^\n * ```\n *\n * @type {State}\n */\n function trailCharacterReferenceStart(code) {\n // When non-alpha, it’s not a trail.\n return asciiAlpha(code) ? trailCharacterReferenceInside(code) : nok(code);\n }\n\n /**\n * In character-reference like trail.\n *\n * ```markdown\n * > | https://example.com&).\n * ^\n * ```\n *\n * @type {State}\n */\n function trailCharacterReferenceInside(code) {\n // Switch back to trail if this is well-formed.\n if (code === 59) {\n effects.consume(code);\n return trail;\n }\n if (asciiAlpha(code)) {\n effects.consume(code);\n return trailCharacterReferenceInside;\n }\n\n // It’s not a trail.\n return nok(code);\n }\n}\n\n/**\n * Dot in email domain trail.\n *\n * This calls `ok` if this *is* the trail, followed by an end, which means\n * the trail is not part of the link.\n * It calls `nok` if this *is* part of the link.\n *\n * ```markdown\n * > | contact@example.org.\n * ^\n * ```\n *\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeEmailDomainDotTrail(effects, ok, nok) {\n return start;\n\n /**\n * Dot.\n *\n * ```markdown\n * > | contact@example.org.\n * ^ ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n // Must be dot.\n effects.consume(code);\n return after;\n }\n\n /**\n * After dot.\n *\n * ```markdown\n * > | contact@example.org.\n * ^ ^\n * ```\n *\n * @type {State}\n */\n function after(code) {\n // Not a trail if alphanumeric.\n return asciiAlphanumeric(code) ? nok(code) : ok(code);\n }\n}\n\n/**\n * See:\n * <https://github.com/github/cmark-gfm/blob/ef1cfcb/extensions/autolink.c#L156>.\n *\n * @type {Previous}\n */\nfunction previousWww(code) {\n return code === null || code === 40 || code === 42 || code === 95 || code === 91 || code === 93 || code === 126 || markdownLineEndingOrSpace(code);\n}\n\n/**\n * See:\n * <https://github.com/github/cmark-gfm/blob/ef1cfcb/extensions/autolink.c#L214>.\n *\n * @type {Previous}\n */\nfunction previousProtocol(code) {\n return !asciiAlpha(code);\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Previous}\n */\nfunction previousEmail(code) {\n // Do not allow a slash “inside” atext.\n // The reference code is a bit weird, but that’s what it results in.\n // Source: <https://github.com/github/cmark-gfm/blob/ef1cfcb/extensions/autolink.c#L307>.\n // Other than slash, every preceding character is allowed.\n return !(code === 47 || gfmAtext(code));\n}\n\n/**\n * @param {Code} code\n * @returns {boolean}\n */\nfunction gfmAtext(code) {\n return code === 43 || code === 45 || code === 46 || code === 95 || asciiAlphanumeric(code);\n}\n\n/**\n * @param {Array<Event>} events\n * @returns {boolean}\n */\nfunction previousUnbalanced(events) {\n let index = events.length;\n let result = false;\n while (index--) {\n const token = events[index][1];\n if ((token.type === 'labelLink' || token.type === 'labelImage') && !token._balanced) {\n result = true;\n break;\n }\n\n // If we’ve seen this token, and it was marked as not having any unbalanced\n // bracket before it, we can exit.\n if (token._gfmAutolinkLiteralWalkedInto) {\n result = false;\n break;\n }\n }\n if (events.length > 0 && !result) {\n // Mark the last token as “walked into” w/o finding\n // anything.\n events[events.length - 1][1]._gfmAutolinkLiteralWalkedInto = true;\n }\n return result;\n}"],"names":["wwwPrefix","tokenize","effects","ok","nok","size","wwwPrefixInside","code","consume","wwwPrefixAfter","partial","domain","underscoreInLastSegment","underscoreInLastLastSegment","seen","domainInside","check","trail","domainAfter","domainAtPunctuation","markdownLineEndingOrSpace","unicodeWhitespace","unicodePunctuation","undefined","path","sizeOpen","sizeClose","pathInside","pathAtPunctuation","trailCharacterReferenceStart","trailBracketAfter","asciiAlpha","trailCharacterReferenceInside","emailDomainDotTrail","after","asciiAlphanumeric","wwwAutolink","name","self","this","previousWww","call","previous","previousUnbalanced","events","enter","attempt","wwwAfter","exit","protocolAutolink","buffer","previousProtocol","String","fromCodePoint","protocolPrefixInside","length","protocol","toLowerCase","protocolSlashesInside","afterProtocol","asciiControl","protocolAfter","emailAutolink","dot","data","gfmAtext","previousEmail","atext","emailDomain","emailDomainAfter","emailDomainDot","text","gfmAutolinkLiteral","index","result","token","type","_balanced","_gfmAutolinkLiteralW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XS,EAAK,IAAM,CAACT,EAAeb,GAC3BsB,EAAK,KAAO,CAACT,EAAeb,GAC5BsB,EAAK,IAAM,CAACT,EAAe1B,GAC3BmC,EAAK,KAAO,CAACT,EAAe1B"}
|
|
1
|
+
{"version":3,"file":"syntax.js","sources":["../../../../node_modules/micromark-extension-gfm-autolink-literal/lib/syntax.js"],"sourcesContent":["/**\n * @typedef {import('micromark-util-types').Code} Code\n * @typedef {import('micromark-util-types').ConstructRecord} ConstructRecord\n * @typedef {import('micromark-util-types').Event} Event\n * @typedef {import('micromark-util-types').Extension} Extension\n * @typedef {import('micromark-util-types').Previous} Previous\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n */\n\nimport {\n asciiAlpha,\n asciiAlphanumeric,\n asciiControl,\n markdownLineEndingOrSpace,\n unicodePunctuation,\n unicodeWhitespace\n} from 'micromark-util-character'\nconst wwwPrefix = {\n tokenize: tokenizeWwwPrefix,\n partial: true\n}\nconst domain = {\n tokenize: tokenizeDomain,\n partial: true\n}\nconst path = {\n tokenize: tokenizePath,\n partial: true\n}\nconst trail = {\n tokenize: tokenizeTrail,\n partial: true\n}\nconst emailDomainDotTrail = {\n tokenize: tokenizeEmailDomainDotTrail,\n partial: true\n}\nconst wwwAutolink = {\n tokenize: tokenizeWwwAutolink,\n previous: previousWww\n}\nconst protocolAutolink = {\n tokenize: tokenizeProtocolAutolink,\n previous: previousProtocol\n}\nconst emailAutolink = {\n tokenize: tokenizeEmailAutolink,\n previous: previousEmail\n}\n\n/** @type {ConstructRecord} */\nconst text = {}\n\n// To do: next major: expose functions that yields extension.\n\n/**\n * Extension for `micromark` that can be passed in `extensions` to enable GFM\n * autolink literal syntax.\n *\n * @type {Extension}\n */\nexport const gfmAutolinkLiteral = {\n text\n}\n\n/** @type {Code} */\nlet code = 48\n\n// Add alphanumerics.\nwhile (code < 123) {\n text[code] = emailAutolink\n code++\n if (code === 58) code = 65\n else if (code === 91) code = 97\n}\ntext[43] = emailAutolink\ntext[45] = emailAutolink\ntext[46] = emailAutolink\ntext[95] = emailAutolink\ntext[72] = [emailAutolink, protocolAutolink]\ntext[104] = [emailAutolink, protocolAutolink]\ntext[87] = [emailAutolink, wwwAutolink]\ntext[119] = [emailAutolink, wwwAutolink]\n\n// To do: perform email autolink literals on events, afterwards.\n// That’s where `markdown-rs` and `cmark-gfm` perform it.\n// It should look for `@`, then for atext backwards, and then for a label\n// forwards.\n// To do: `mailto:`, `xmpp:` protocol as prefix.\n\n/**\n * Email autolink literal.\n *\n * ```markdown\n * > | a contact@example.org b\n * ^^^^^^^^^^^^^^^^^^^\n * ```\n *\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeEmailAutolink(effects, ok, nok) {\n const self = this\n /** @type {boolean | undefined} */\n let dot\n /** @type {boolean} */\n let data\n return start\n\n /**\n * Start of email autolink literal.\n *\n * ```markdown\n * > | a contact@example.org b\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n if (\n !gfmAtext(code) ||\n !previousEmail.call(self, self.previous) ||\n previousUnbalanced(self.events)\n ) {\n return nok(code)\n }\n effects.enter('literalAutolink')\n effects.enter('literalAutolinkEmail')\n return atext(code)\n }\n\n /**\n * In email atext.\n *\n * ```markdown\n * > | a contact@example.org b\n * ^\n * ```\n *\n * @type {State}\n */\n function atext(code) {\n if (gfmAtext(code)) {\n effects.consume(code)\n return atext\n }\n if (code === 64) {\n effects.consume(code)\n return emailDomain\n }\n return nok(code)\n }\n\n /**\n * In email domain.\n *\n * The reference code is a bit overly complex as it handles the `@`, of which\n * there may be just one.\n * Source: <https://github.com/github/cmark-gfm/blob/ef1cfcb/extensions/autolink.c#L318>\n *\n * ```markdown\n * > | a contact@example.org b\n * ^\n * ```\n *\n * @type {State}\n */\n function emailDomain(code) {\n // Dot followed by alphanumerical (not `-` or `_`).\n if (code === 46) {\n return effects.check(\n emailDomainDotTrail,\n emailDomainAfter,\n emailDomainDot\n )(code)\n }\n\n // Alphanumerical, `-`, and `_`.\n if (code === 45 || code === 95 || asciiAlphanumeric(code)) {\n data = true\n effects.consume(code)\n return emailDomain\n }\n\n // To do: `/` if xmpp.\n\n // Note: normally we’d truncate trailing punctuation from the link.\n // However, email autolink literals cannot contain any of those markers,\n // except for `.`, but that can only occur if it isn’t trailing.\n // So we can ignore truncating!\n return emailDomainAfter(code)\n }\n\n /**\n * In email domain, on dot that is not a trail.\n *\n * ```markdown\n * > | a contact@example.org b\n * ^\n * ```\n *\n * @type {State}\n */\n function emailDomainDot(code) {\n effects.consume(code)\n dot = true\n return emailDomain\n }\n\n /**\n * After email domain.\n *\n * ```markdown\n * > | a contact@example.org b\n * ^\n * ```\n *\n * @type {State}\n */\n function emailDomainAfter(code) {\n // Domain must not be empty, must include a dot, and must end in alphabetical.\n // Source: <https://github.com/github/cmark-gfm/blob/ef1cfcb/extensions/autolink.c#L332>.\n if (data && dot && asciiAlpha(self.previous)) {\n effects.exit('literalAutolinkEmail')\n effects.exit('literalAutolink')\n return ok(code)\n }\n return nok(code)\n }\n}\n\n/**\n * `www` autolink literal.\n *\n * ```markdown\n * > | a www.example.org b\n * ^^^^^^^^^^^^^^^\n * ```\n *\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeWwwAutolink(effects, ok, nok) {\n const self = this\n return wwwStart\n\n /**\n * Start of www autolink literal.\n *\n * ```markdown\n * > | www.example.com/a?b#c\n * ^\n * ```\n *\n * @type {State}\n */\n function wwwStart(code) {\n if (\n (code !== 87 && code !== 119) ||\n !previousWww.call(self, self.previous) ||\n previousUnbalanced(self.events)\n ) {\n return nok(code)\n }\n effects.enter('literalAutolink')\n effects.enter('literalAutolinkWww')\n // Note: we *check*, so we can discard the `www.` we parsed.\n // If it worked, we consider it as a part of the domain.\n return effects.check(\n wwwPrefix,\n effects.attempt(domain, effects.attempt(path, wwwAfter), nok),\n nok\n )(code)\n }\n\n /**\n * After a www autolink literal.\n *\n * ```markdown\n * > | www.example.com/a?b#c\n * ^\n * ```\n *\n * @type {State}\n */\n function wwwAfter(code) {\n effects.exit('literalAutolinkWww')\n effects.exit('literalAutolink')\n return ok(code)\n }\n}\n\n/**\n * Protocol autolink literal.\n *\n * ```markdown\n * > | a https://example.org b\n * ^^^^^^^^^^^^^^^^^^^\n * ```\n *\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeProtocolAutolink(effects, ok, nok) {\n const self = this\n let buffer = ''\n let seen = false\n return protocolStart\n\n /**\n * Start of protocol autolink literal.\n *\n * ```markdown\n * > | https://example.com/a?b#c\n * ^\n * ```\n *\n * @type {State}\n */\n function protocolStart(code) {\n if (\n (code === 72 || code === 104) &&\n previousProtocol.call(self, self.previous) &&\n !previousUnbalanced(self.events)\n ) {\n effects.enter('literalAutolink')\n effects.enter('literalAutolinkHttp')\n buffer += String.fromCodePoint(code)\n effects.consume(code)\n return protocolPrefixInside\n }\n return nok(code)\n }\n\n /**\n * In protocol.\n *\n * ```markdown\n * > | https://example.com/a?b#c\n * ^^^^^\n * ```\n *\n * @type {State}\n */\n function protocolPrefixInside(code) {\n // `5` is size of `https`\n if (asciiAlpha(code) && buffer.length < 5) {\n // @ts-expect-error: definitely number.\n buffer += String.fromCodePoint(code)\n effects.consume(code)\n return protocolPrefixInside\n }\n if (code === 58) {\n const protocol = buffer.toLowerCase()\n if (protocol === 'http' || protocol === 'https') {\n effects.consume(code)\n return protocolSlashesInside\n }\n }\n return nok(code)\n }\n\n /**\n * In slashes.\n *\n * ```markdown\n * > | https://example.com/a?b#c\n * ^^\n * ```\n *\n * @type {State}\n */\n function protocolSlashesInside(code) {\n if (code === 47) {\n effects.consume(code)\n if (seen) {\n return afterProtocol\n }\n seen = true\n return protocolSlashesInside\n }\n return nok(code)\n }\n\n /**\n * After protocol, before domain.\n *\n * ```markdown\n * > | https://example.com/a?b#c\n * ^\n * ```\n *\n * @type {State}\n */\n function afterProtocol(code) {\n // To do: this is different from `markdown-rs`:\n // https://github.com/wooorm/markdown-rs/blob/b3a921c761309ae00a51fe348d8a43adbc54b518/src/construct/gfm_autolink_literal.rs#L172-L182\n return code === null ||\n asciiControl(code) ||\n markdownLineEndingOrSpace(code) ||\n unicodeWhitespace(code) ||\n unicodePunctuation(code)\n ? nok(code)\n : effects.attempt(domain, effects.attempt(path, protocolAfter), nok)(code)\n }\n\n /**\n * After a protocol autolink literal.\n *\n * ```markdown\n * > | https://example.com/a?b#c\n * ^\n * ```\n *\n * @type {State}\n */\n function protocolAfter(code) {\n effects.exit('literalAutolinkHttp')\n effects.exit('literalAutolink')\n return ok(code)\n }\n}\n\n/**\n * `www` prefix.\n *\n * ```markdown\n * > | a www.example.org b\n * ^^^^\n * ```\n *\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeWwwPrefix(effects, ok, nok) {\n let size = 0\n return wwwPrefixInside\n\n /**\n * In www prefix.\n *\n * ```markdown\n * > | www.example.com\n * ^^^^\n * ```\n *\n * @type {State}\n */\n function wwwPrefixInside(code) {\n if ((code === 87 || code === 119) && size < 3) {\n size++\n effects.consume(code)\n return wwwPrefixInside\n }\n if (code === 46 && size === 3) {\n effects.consume(code)\n return wwwPrefixAfter\n }\n return nok(code)\n }\n\n /**\n * After www prefix.\n *\n * ```markdown\n * > | www.example.com\n * ^\n * ```\n *\n * @type {State}\n */\n function wwwPrefixAfter(code) {\n // If there is *anything*, we can link.\n return code === null ? nok(code) : ok(code)\n }\n}\n\n/**\n * Domain.\n *\n * ```markdown\n * > | a https://example.org b\n * ^^^^^^^^^^^\n * ```\n *\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeDomain(effects, ok, nok) {\n /** @type {boolean | undefined} */\n let underscoreInLastSegment\n /** @type {boolean | undefined} */\n let underscoreInLastLastSegment\n /** @type {boolean | undefined} */\n let seen\n return domainInside\n\n /**\n * In domain.\n *\n * ```markdown\n * > | https://example.com/a\n * ^^^^^^^^^^^\n * ```\n *\n * @type {State}\n */\n function domainInside(code) {\n // Check whether this marker, which is a trailing punctuation\n // marker, optionally followed by more trailing markers, and then\n // followed by an end.\n if (code === 46 || code === 95) {\n return effects.check(trail, domainAfter, domainAtPunctuation)(code)\n }\n\n // GH documents that only alphanumerics (other than `-`, `.`, and `_`) can\n // occur, which sounds like ASCII only, but they also support `www.點看.com`,\n // so that’s Unicode.\n // Instead of some new production for Unicode alphanumerics, markdown\n // already has that for Unicode punctuation and whitespace, so use those.\n // Source: <https://github.com/github/cmark-gfm/blob/ef1cfcb/extensions/autolink.c#L12>.\n if (\n code === null ||\n markdownLineEndingOrSpace(code) ||\n unicodeWhitespace(code) ||\n (code !== 45 && unicodePunctuation(code))\n ) {\n return domainAfter(code)\n }\n seen = true\n effects.consume(code)\n return domainInside\n }\n\n /**\n * In domain, at potential trailing punctuation, that was not trailing.\n *\n * ```markdown\n * > | https://example.com\n * ^\n * ```\n *\n * @type {State}\n */\n function domainAtPunctuation(code) {\n // There is an underscore in the last segment of the domain\n if (code === 95) {\n underscoreInLastSegment = true\n }\n // Otherwise, it’s a `.`: save the last segment underscore in the\n // penultimate segment slot.\n else {\n underscoreInLastLastSegment = underscoreInLastSegment\n underscoreInLastSegment = undefined\n }\n effects.consume(code)\n return domainInside\n }\n\n /**\n * After domain.\n *\n * ```markdown\n * > | https://example.com/a\n * ^\n * ```\n *\n * @type {State} */\n function domainAfter(code) {\n // Note: that’s GH says a dot is needed, but it’s not true:\n // <https://github.com/github/cmark-gfm/issues/279>\n if (underscoreInLastLastSegment || underscoreInLastSegment || !seen) {\n return nok(code)\n }\n return ok(code)\n }\n}\n\n/**\n * Path.\n *\n * ```markdown\n * > | a https://example.org/stuff b\n * ^^^^^^\n * ```\n *\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizePath(effects, ok) {\n let sizeOpen = 0\n let sizeClose = 0\n return pathInside\n\n /**\n * In path.\n *\n * ```markdown\n * > | https://example.com/a\n * ^^\n * ```\n *\n * @type {State}\n */\n function pathInside(code) {\n if (code === 40) {\n sizeOpen++\n effects.consume(code)\n return pathInside\n }\n\n // To do: `markdown-rs` also needs this.\n // If this is a paren, and there are less closings than openings,\n // we don’t check for a trail.\n if (code === 41 && sizeClose < sizeOpen) {\n return pathAtPunctuation(code)\n }\n\n // Check whether this trailing punctuation marker is optionally\n // followed by more trailing markers, and then followed\n // by an end.\n if (\n code === 33 ||\n code === 34 ||\n code === 38 ||\n code === 39 ||\n code === 41 ||\n code === 42 ||\n code === 44 ||\n code === 46 ||\n code === 58 ||\n code === 59 ||\n code === 60 ||\n code === 63 ||\n code === 93 ||\n code === 95 ||\n code === 126\n ) {\n return effects.check(trail, ok, pathAtPunctuation)(code)\n }\n if (\n code === null ||\n markdownLineEndingOrSpace(code) ||\n unicodeWhitespace(code)\n ) {\n return ok(code)\n }\n effects.consume(code)\n return pathInside\n }\n\n /**\n * In path, at potential trailing punctuation, that was not trailing.\n *\n * ```markdown\n * > | https://example.com/a\"b\n * ^\n * ```\n *\n * @type {State}\n */\n function pathAtPunctuation(code) {\n // Count closing parens.\n if (code === 41) {\n sizeClose++\n }\n effects.consume(code)\n return pathInside\n }\n}\n\n/**\n * Trail.\n *\n * This calls `ok` if this *is* the trail, followed by an end, which means\n * the entire trail is not part of the link.\n * It calls `nok` if this *is* part of the link.\n *\n * ```markdown\n * > | https://example.com\").\n * ^^^\n * ```\n *\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeTrail(effects, ok, nok) {\n return trail\n\n /**\n * In trail of domain or path.\n *\n * ```markdown\n * > | https://example.com\").\n * ^\n * ```\n *\n * @type {State}\n */\n function trail(code) {\n // Regular trailing punctuation.\n if (\n code === 33 ||\n code === 34 ||\n code === 39 ||\n code === 41 ||\n code === 42 ||\n code === 44 ||\n code === 46 ||\n code === 58 ||\n code === 59 ||\n code === 63 ||\n code === 95 ||\n code === 126\n ) {\n effects.consume(code)\n return trail\n }\n\n // `&` followed by one or more alphabeticals and then a `;`, is\n // as a whole considered as trailing punctuation.\n // In all other cases, it is considered as continuation of the URL.\n if (code === 38) {\n effects.consume(code)\n return trailCharRefStart\n }\n\n // Needed because we allow literals after `[`, as we fix:\n // <https://github.com/github/cmark-gfm/issues/278>.\n // Check that it is not followed by `(` or `[`.\n if (code === 93) {\n effects.consume(code)\n return trailBracketAfter\n }\n if (\n // `<` is an end.\n code === 60 ||\n // So is whitespace.\n code === null ||\n markdownLineEndingOrSpace(code) ||\n unicodeWhitespace(code)\n ) {\n return ok(code)\n }\n return nok(code)\n }\n\n /**\n * In trail, after `]`.\n *\n * > 👉 **Note**: this deviates from `cmark-gfm` to fix a bug.\n * > See end of <https://github.com/github/cmark-gfm/issues/278> for more.\n *\n * ```markdown\n * > | https://example.com](\n * ^\n * ```\n *\n * @type {State}\n */\n function trailBracketAfter(code) {\n // Whitespace or something that could start a resource or reference is the end.\n // Switch back to trail otherwise.\n if (\n code === null ||\n code === 40 ||\n code === 91 ||\n markdownLineEndingOrSpace(code) ||\n unicodeWhitespace(code)\n ) {\n return ok(code)\n }\n return trail(code)\n }\n\n /**\n * In character-reference like trail, after `&`.\n *\n * ```markdown\n * > | https://example.com&).\n * ^\n * ```\n *\n * @type {State}\n */\n function trailCharRefStart(code) {\n // When non-alpha, it’s not a trail.\n return asciiAlpha(code) ? trailCharRefInside(code) : nok(code)\n }\n\n /**\n * In character-reference like trail.\n *\n * ```markdown\n * > | https://example.com&).\n * ^\n * ```\n *\n * @type {State}\n */\n function trailCharRefInside(code) {\n // Switch back to trail if this is well-formed.\n if (code === 59) {\n effects.consume(code)\n return trail\n }\n if (asciiAlpha(code)) {\n effects.consume(code)\n return trailCharRefInside\n }\n\n // It’s not a trail.\n return nok(code)\n }\n}\n\n/**\n * Dot in email domain trail.\n *\n * This calls `ok` if this *is* the trail, followed by an end, which means\n * the trail is not part of the link.\n * It calls `nok` if this *is* part of the link.\n *\n * ```markdown\n * > | contact@example.org.\n * ^\n * ```\n *\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeEmailDomainDotTrail(effects, ok, nok) {\n return start\n\n /**\n * Dot.\n *\n * ```markdown\n * > | contact@example.org.\n * ^ ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n // Must be dot.\n effects.consume(code)\n return after\n }\n\n /**\n * After dot.\n *\n * ```markdown\n * > | contact@example.org.\n * ^ ^\n * ```\n *\n * @type {State}\n */\n function after(code) {\n // Not a trail if alphanumeric.\n return asciiAlphanumeric(code) ? nok(code) : ok(code)\n }\n}\n\n/**\n * See:\n * <https://github.com/github/cmark-gfm/blob/ef1cfcb/extensions/autolink.c#L156>.\n *\n * @type {Previous}\n */\nfunction previousWww(code) {\n return (\n code === null ||\n code === 40 ||\n code === 42 ||\n code === 95 ||\n code === 91 ||\n code === 93 ||\n code === 126 ||\n markdownLineEndingOrSpace(code)\n )\n}\n\n/**\n * See:\n * <https://github.com/github/cmark-gfm/blob/ef1cfcb/extensions/autolink.c#L214>.\n *\n * @type {Previous}\n */\nfunction previousProtocol(code) {\n return !asciiAlpha(code)\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Previous}\n */\nfunction previousEmail(code) {\n // Do not allow a slash “inside” atext.\n // The reference code is a bit weird, but that’s what it results in.\n // Source: <https://github.com/github/cmark-gfm/blob/ef1cfcb/extensions/autolink.c#L307>.\n // Other than slash, every preceding character is allowed.\n return !(code === 47 || gfmAtext(code))\n}\n\n/**\n * @param {Code} code\n * @returns {boolean}\n */\nfunction gfmAtext(code) {\n return (\n code === 43 ||\n code === 45 ||\n code === 46 ||\n code === 95 ||\n asciiAlphanumeric(code)\n )\n}\n\n/**\n * @param {Array<Event>} events\n * @returns {boolean}\n */\nfunction previousUnbalanced(events) {\n let index = events.length\n let result = false\n while (index--) {\n const token = events[index][1]\n if (\n (token.type === 'labelLink' || token.type === 'labelImage') &&\n !token._balanced\n ) {\n result = true\n break\n }\n\n // If we’ve seen this token, and it was marked as not having any unbalanced\n // bracket before it, we can exit.\n if (token._gfmAutolinkLiteralWalkedInto) {\n result = false\n break\n }\n }\n if (events.length > 0 && !result) {\n // Mark the last token as “walked into” w/o finding\n // anything.\n events[events.length - 1][1]._gfmAutolinkLiteralWalkedInto = true\n }\n return result\n}\n"],"names":["wwwPrefix","tokenize","effects","ok","nok","size","wwwPrefixInside","code","consume","wwwPrefixAfter","partial","domain","underscoreInLastSegment","underscoreInLastLastSegment","seen","domainInside","check","trail","domainAfter","domainAtPunctuation","markdownLineEndingOrSpace","unicodeWhitespace","unicodePunctuation","undefined","path","sizeOpen","sizeClose","pathInside","pathAtPunctuation","trailCharRefStart","trailBracketAfter","asciiAlpha","trailCharRefInside","emailDomainDotTrail","after","asciiAlphanumeric","wwwAutolink","self","this","previousWww","call","previous","previousUnbalanced","events","enter","attempt","wwwAfter","exit","protocolAutolink","buffer","previousProtocol","String","fromCodePoint","protocolPrefixInside","length","protocol","toLowerCase","protocolSlashesInside","afterProtocol","asciiControl","protocolAfter","emailAutolink","dot","data","gfmAtext","previousEmail","atext","emailDomain","emailDomainAfter","emailDomainDot","text","gfmAutolinkLiteral","index","result","token","type","_balanced","_gfmAutolinkLiteralWalkedInto"],"mappings":"sMAmBA,MAAMA,EAAY,CAChBC,SAiaF,SAA2BC,EAASC,EAAIC,GACtC,IAAIC,EAAO,EACX,OAYA,SAASC,EAAgBC,GACvB,IAAc,KAATA,GAAwB,MAATA,IAAiBF,EAAO,EAG1C,OAFAA,IACAH,EAAQM,QAAQD,GACTD,EAET,GAAa,KAATC,GAAwB,IAATF,EAEjB,OADAH,EAAQM,QAAQD,GACTE,EAET,OAAOL,EAAIG,EACZ,EAYD,SAASE,EAAeF,GAEtB,OAAgB,OAATA,EAAgBH,EAAIG,GAAQJ,EAAGI,EACvC,CACH,EAzcEG,SAAS,GAELC,EAAS,CACbV,SAmdF,SAAwBC,EAASC,EAAIC,GAEnC,IAAIQ,EAEAC,EAEAC,EACJ,OAAOC,EAYP,SAASA,EAAaR,GAIpB,OAAa,KAATA,GAAwB,KAATA,E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GAChB,OACW,KAATA,GACS,KAATA,GACS,KAATA,GACS,KAATA,GACA4B,EAAkB5B,EAEtB,CAMA,SAASmC,EAAmBC,GAC1B,IAAI6B,EAAQ7B,EAAOW,OACfmB,GAAS,EACb,KAAOD,KAAS,CACd,MAAME,EAAQ/B,EAAO6B,GAAO,GAC5B,IACkB,cAAfE,EAAMC,MAAuC,eAAfD,EAAMC,QACpCD,EAAME,UACP,CACAH,GAAS,EACT,KACD,CAID,GAAIC,EAAMG,8BAA+B,CACvCJ,GAAS,EACT,KACD,CACF,CAMD,OALI9B,EAAOW,OAAS,IAAMmB,IAGxB9B,EAAOA,EAAOW,OAAS,GAAG,GAAGuB,+BAAgC,GAExDJ,CACT,CA72BAH,EAAK,IAAMT,EACXS,EAAK,IAAMT,EACXS,EAAK,IAAMT,EACXS,EAAK,IAAMT,EACXS,EAAK,IAAM,CAACT,EAAeb,GAC3BsB,EAAK,KAAO,CAACT,EAAeb,GAC5BsB,EAAK,IAAM,CAACT,EAAezB,GAC3BkC,EAAK,KAAO,CAACT,EAAezB"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{unicodePunctuationRegex as n}from"./lib/unicode-punctuation-regex.js";const t=c(/[A-Za-z]/),r=c(/[\dA-Za-z]/);function u(n){return null!==n&&(n<32||127===n)}function o(n){return null!==n&&(n<0||32===n)}const e=c(n),i=c(/\s/);function c(n){return function(t){return null!==t&&n.test(String.fromCharCode(t))}}export{t as asciiAlpha,r as asciiAlphanumeric,u as asciiControl,o as markdownLineEndingOrSpace,e as unicodePunctuation,i as unicodeWhitespace};
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../node_modules/micromark-extension-gfm-autolink-literal/node_modules/micromark-util-character/index.js"],"sourcesContent":["/**\n * @typedef {import('micromark-util-types').Code} Code\n */\n\nimport {unicodePunctuationRegex} from './lib/unicode-punctuation-regex.js'\n\n/**\n * Check whether the character code represents an ASCII alpha (`a` through `z`,\n * case insensitive).\n *\n * An **ASCII alpha** is an ASCII upper alpha or ASCII lower alpha.\n *\n * An **ASCII upper alpha** is a character in the inclusive range U+0041 (`A`)\n * to U+005A (`Z`).\n *\n * An **ASCII lower alpha** is a character in the inclusive range U+0061 (`a`)\n * to U+007A (`z`).\n *\n * @param code\n * Code.\n * @returns\n * Whether it matches.\n */\nexport const asciiAlpha = regexCheck(/[A-Za-z]/)\n\n/**\n * Check whether the character code represents an ASCII alphanumeric (`a`\n * through `z`, case insensitive, or `0` through `9`).\n *\n * An **ASCII alphanumeric** is an ASCII digit (see `asciiDigit`) or ASCII alpha\n * (see `asciiAlpha`).\n *\n * @param code\n * Code.\n * @returns\n * Whether it matches.\n */\nexport const asciiAlphanumeric = regexCheck(/[\\dA-Za-z]/)\n\n/**\n * Check whether the character code represents an ASCII atext.\n *\n * atext is an ASCII alphanumeric (see `asciiAlphanumeric`), or a character in\n * the inclusive ranges U+0023 NUMBER SIGN (`#`) to U+0027 APOSTROPHE (`'`),\n * U+002A ASTERISK (`*`), U+002B PLUS SIGN (`+`), U+002D DASH (`-`), U+002F\n * SLASH (`/`), U+003D EQUALS TO (`=`), U+003F QUESTION MARK (`?`), U+005E\n * CARET (`^`) to U+0060 GRAVE ACCENT (`` ` ``), or U+007B LEFT CURLY BRACE\n * (`{`) to U+007E TILDE (`~`).\n *\n * See:\n * **\\[RFC5322]**:\n * [Internet Message Format](https://tools.ietf.org/html/rfc5322).\n * P. Resnick.\n * IETF.\n *\n * @param code\n * Code.\n * @returns\n * Whether it matches.\n */\nexport const asciiAtext = regexCheck(/[#-'*+\\--9=?A-Z^-~]/)\n\n/**\n * Check whether a character code is an ASCII control character.\n *\n * An **ASCII control** is a character in the inclusive range U+0000 NULL (NUL)\n * to U+001F (US), or U+007F (DEL).\n *\n * @param {Code} code\n * Code.\n * @returns {boolean}\n * Whether it matches.\n */\nexport function asciiControl(code) {\n return (\n // Special whitespace codes (which have negative values), C0 and Control\n // character DEL\n code !== null && (code < 32 || code === 127)\n )\n}\n\n/**\n * Check whether the character code represents an ASCII digit (`0` through `9`).\n *\n * An **ASCII digit** is a character in the inclusive range U+0030 (`0`) to\n * U+0039 (`9`).\n *\n * @param code\n * Code.\n * @returns\n * Whether it matches.\n */\nexport const asciiDigit = regexCheck(/\\d/)\n\n/**\n * Check whether the character code represents an ASCII hex digit (`a` through\n * `f`, case insensitive, or `0` through `9`).\n *\n * An **ASCII hex digit** is an ASCII digit (see `asciiDigit`), ASCII upper hex\n * digit, or an ASCII lower hex digit.\n *\n * An **ASCII upper hex digit** is a character in the inclusive range U+0041\n * (`A`) to U+0046 (`F`).\n *\n * An **ASCII lower hex digit** is a character in the inclusive range U+0061\n * (`a`) to U+0066 (`f`).\n *\n * @param code\n * Code.\n * @returns\n * Whether it matches.\n */\nexport const asciiHexDigit = regexCheck(/[\\dA-Fa-f]/)\n\n/**\n * Check whether the character code represents ASCII punctuation.\n *\n * An **ASCII punctuation** is a character in the inclusive ranges U+0021\n * EXCLAMATION MARK (`!`) to U+002F SLASH (`/`), U+003A COLON (`:`) to U+0040 AT\n * SIGN (`@`), U+005B LEFT SQUARE BRACKET (`[`) to U+0060 GRAVE ACCENT\n * (`` ` ``), or U+007B LEFT CURLY BRACE (`{`) to U+007E TILDE (`~`).\n *\n * @param code\n * Code.\n * @returns\n * Whether it matches.\n */\nexport const asciiPunctuation = regexCheck(/[!-/:-@[-`{-~]/)\n\n/**\n * Check whether a character code is a markdown line ending.\n *\n * A **markdown line ending** is the virtual characters M-0003 CARRIAGE RETURN\n * LINE FEED (CRLF), M-0004 LINE FEED (LF) and M-0005 CARRIAGE RETURN (CR).\n *\n * In micromark, the actual character U+000A LINE FEED (LF) and U+000D CARRIAGE\n * RETURN (CR) are replaced by these virtual characters depending on whether\n * they occurred together.\n *\n * @param {Code} code\n * Code.\n * @returns {boolean}\n * Whether it matches.\n */\nexport function markdownLineEnding(code) {\n return code !== null && code < -2\n}\n\n/**\n * Check whether a character code is a markdown line ending (see\n * `markdownLineEnding`) or markdown space (see `markdownSpace`).\n *\n * @param {Code} code\n * Code.\n * @returns {boolean}\n * Whether it matches.\n */\nexport function markdownLineEndingOrSpace(code) {\n return code !== null && (code < 0 || code === 32)\n}\n\n/**\n * Check whether a character code is a markdown space.\n *\n * A **markdown space** is the concrete character U+0020 SPACE (SP) and the\n * virtual characters M-0001 VIRTUAL SPACE (VS) and M-0002 HORIZONTAL TAB (HT).\n *\n * In micromark, the actual character U+0009 CHARACTER TABULATION (HT) is\n * replaced by one M-0002 HORIZONTAL TAB (HT) and between 0 and 3 M-0001 VIRTUAL\n * SPACE (VS) characters, depending on the column at which the tab occurred.\n *\n * @param {Code} code\n * Code.\n * @returns {boolean}\n * Whether it matches.\n */\nexport function markdownSpace(code) {\n return code === -2 || code === -1 || code === 32\n}\n\n// Size note: removing ASCII from the regex and using `asciiPunctuation` here\n// In fact adds to the bundle size.\n/**\n * Check whether the character code represents Unicode punctuation.\n *\n * A **Unicode punctuation** is a character in the Unicode `Pc` (Punctuation,\n * Connector), `Pd` (Punctuation, Dash), `Pe` (Punctuation, Close), `Pf`\n * (Punctuation, Final quote), `Pi` (Punctuation, Initial quote), `Po`\n * (Punctuation, Other), or `Ps` (Punctuation, Open) categories, or an ASCII\n * punctuation (see `asciiPunctuation`).\n *\n * See:\n * **\\[UNICODE]**:\n * [The Unicode Standard](https://www.unicode.org/versions/).\n * Unicode Consortium.\n *\n * @param code\n * Code.\n * @returns\n * Whether it matches.\n */\nexport const unicodePunctuation = regexCheck(unicodePunctuationRegex)\n\n/**\n * Check whether the character code represents Unicode whitespace.\n *\n * Note that this does handle micromark specific markdown whitespace characters.\n * See `markdownLineEndingOrSpace` to check that.\n *\n * A **Unicode whitespace** is a character in the Unicode `Zs` (Separator,\n * Space) category, or U+0009 CHARACTER TABULATION (HT), U+000A LINE FEED (LF),\n * U+000C (FF), or U+000D CARRIAGE RETURN (CR) (**\\[UNICODE]**).\n *\n * See:\n * **\\[UNICODE]**:\n * [The Unicode Standard](https://www.unicode.org/versions/).\n * Unicode Consortium.\n *\n * @param code\n * Code.\n * @returns\n * Whether it matches.\n */\nexport const unicodeWhitespace = regexCheck(/\\s/)\n\n/**\n * Create a code check from a regex.\n *\n * @param {RegExp} regex\n * @returns {(code: Code) => boolean}\n */\nfunction regexCheck(regex) {\n return check\n\n /**\n * Check whether a code matches the bound regex.\n *\n * @param {Code} code\n * Character code.\n * @returns {boolean}\n * Whether the character code matches the bound regex.\n */\n function check(code) {\n return code !== null && regex.test(String.fromCharCode(code))\n }\n}\n"],"names":["asciiAlpha","regexCheck","asciiAlphanumeric","asciiControl","code","markdownLineEndingOrSpace","unicodePunctuation","unicodePunctuationRegex","unicodeWhitespace","regex","test","String","fromCharCode"],"mappings":"6EAuBY,MAACA,EAAaC,EAAW,YAcxBC,EAAoBD,EAAW,cAoCrC,SAASE,EAAaC,GAC3B,OAGW,OAATA,IAAkBA,EAAO,IAAe,MAATA,EAEnC,CA8EO,SAASC,EAA0BD,GACxC,OAAgB,OAATA,IAAkBA,EAAO,GAAc,KAATA,EACvC,CA0CY,MAACE,EAAqBL,EAAWM,GAsBhCC,EAAoBP,EAAW,MAQ5C,SAASA,EAAWQ,GAClB,OAUA,SAAeL,GACb,OAAgB,OAATA,GAAiBK,EAAMC,KAAKC,OAAOC,aAAaR,GACxD,CACH"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const u=/[!-\/:-@\[-`\{-~\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]/;export{u as unicodePunctuationRegex};
|
|
2
|
+
//# sourceMappingURL=unicode-punctuation-regex.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unicode-punctuation-regex.js","sources":["../../../../../../node_modules/micromark-extension-gfm-autolink-literal/node_modules/micromark-util-character/lib/unicode-punctuation-regex.js"],"sourcesContent":["// This module is generated by `script/`.\n//\n// CommonMark handles attention (emphasis, strong) markers based on what comes\n// before or after them.\n// One such difference is if those characters are Unicode punctuation.\n// This script is generated from the Unicode data.\n\n/**\n * Regular expression that matches a unicode punctuation character.\n */\nexport const unicodePunctuationRegex =\n /[!-\\/:-@\\[-`\\{-~\\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]/\n"],"names":["unicodePunctuationRegex"],"mappings":"AAUY,MAACA,EACX"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{blankLine as e}from"../../micromark-core-commonmark/lib/blank-line.js";import{factorySpace as t}from"../../micromark-factory-space/index.js";import"../../decode-named-character-reference/index.dom.js";import{normalizeIdentifier as n}from"../../micromark-util-normalize-identifier/index.js";import"../../micromark-core-commonmark/lib/label-start-image.js";import"../../micromark-core-commonmark/lib/label-start-link.js";import{markdownLineEndingOrSpace as o}from"../node_modules/micromark-util-character/index.js";const r={tokenize:function(e,n,o){const r=this;return t(e,(function(e){const t=r.events[r.events.length-1];return t&&"gfmFootnoteDefinitionIndent"===t[1].type&&4===t[2].sliceSerialize(t[1],!0).length?n(e):o(e)}),"gfmFootnoteDefinitionIndent",5)},partial:!0};function i(){return{document:{91:{tokenize:f,continuation:{tokenize:s},exit:m}},text:{91:{tokenize:c},93:{add:"after",tokenize:a,resolveTo:l}}}}function a(e,t,o){const r=this;let i=r.events.length;const a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l;for(;i--;){const e=r.events[i][1];if("labelImage"===e.type){l=e;break}if("gfmFootnoteCall"===e.type||"labelLink"===e.type||"label"===e.type||"image"===e.type||"link"===e.type)break}return function(i){if(!l||!l._balanced)return o(i);const c=n(r.sliceSerialize({start:l.end,end:r.now()}));if(94!==c.codePointAt(0)||!a.includes(c.slice(1)))return o(i);return e.enter("gfmFootnoteCallLabelMarker"),e.consume(i),e.exit("gfmFootnoteCallLabelMarker"),t(i)}}function l(e,t){let n=e.length;for(;n--;)if("labelImage"===e[n][1].type&&"enter"===e[n][0]){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const o={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},r={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};r.end.column++,r.end.offset++,r.end._bufferIndex++;const i={type:"gfmFootnoteCallString",start:Object.assign({},r.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},i.start),end:Object.assign({},i.end)},l=[e[n+1],e[n+2],["enter",o,t],e[n+3],e[n+4],["enter",r,t],["exit",r,t],["enter",i,t],["enter",a,t],["exit",a,t],["exit",i,t],e[e.length-2],e[e.length-1],["exit",o,t]];return e.splice(n,e.length-n+1,...l),e}function c(e,t,r){const i=this,a=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let l,c=0;return function(t){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(t),e.exit("gfmFootnoteCallLabelMarker"),f};function f(t){return 94!==t?r(t):(e.enter("gfmFootnoteCallMarker"),e.consume(t),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",s)}function s(f){if(c>999||93===f&&!l||null===f||91===f||o(f))return r(f);if(93===f){e.exit("chunkString");const o=e.exit("gfmFootnoteCallString");return a.includes(n(i.sliceSerialize(o)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):r(f)}return o(f)||(l=!0),c++,e.consume(f),92===f?m:s}function m(t){return 91===t||92===t||93===t?(e.consume(t),c++,s):s(t)}}function f(e,r,i){const a=this,l=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let c,f,s=0;return function(t){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionLabelMarker"),m};function m(t){return 94===t?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",u):i(t)}function u(t){if(s>999||93===t&&!f||null===t||91===t||o(t))return i(t);if(93===t){e.exit("chunkString");const o=e.exit("gfmFootnoteDefinitionLabelString");return c=n(a.sliceSerialize(o)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),k}return o(t)||(f=!0),s++,e.consume(t),92===t?g:u}function g(t){return 91===t||92===t||93===t?(e.consume(t),s++,u):u(t)}function k(n){return 58===n?(e.enter("definitionMarker"),e.consume(n),e.exit("definitionMarker"),l.includes(c)||l.push(c),t(e,d,"gfmFootnoteDefinitionWhitespace")):i(n)}function d(e){return r(e)}}function s(t,n,o){return t.check(e,n,t.attempt(r,n,o))}function m(e){e.exit("gfmFootnoteDefinition")}export{i as gfmFootnote};
|
|
2
2
|
//# sourceMappingURL=syntax.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"syntax.js","sources":["../../../../node_modules/micromark-extension-gfm-footnote/lib/syntax.js"],"sourcesContent":["/**\n * @import {Event, Exiter, Extension, Resolver, State, Token, TokenizeContext, Tokenizer} from 'micromark-util-types'\n */\n\nimport { blankLine } from 'micromark-core-commonmark';\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownLineEndingOrSpace } from 'micromark-util-character';\nimport { normalizeIdentifier } from 'micromark-util-normalize-identifier';\nconst indent = {\n tokenize: tokenizeIndent,\n partial: true\n};\n\n// To do: micromark should support a `_hiddenGfmFootnoteSupport`, which only\n// affects label start (image).\n// That will let us drop `tokenizePotentialGfmFootnote*`.\n// It currently has a `_hiddenFootnoteSupport`, which affects that and more.\n// That can be removed when `micromark-extension-footnote` is archived.\n\n/**\n * Create an extension for `micromark` to enable GFM footnote syntax.\n *\n * @returns {Extension}\n * Extension for `micromark` that can be passed in `extensions` to\n * enable GFM footnote syntax.\n */\nexport function gfmFootnote() {\n /** @type {Extension} */\n return {\n document: {\n [91]: {\n name: 'gfmFootnoteDefinition',\n tokenize: tokenizeDefinitionStart,\n continuation: {\n tokenize: tokenizeDefinitionContinuation\n },\n exit: gfmFootnoteDefinitionEnd\n }\n },\n text: {\n [91]: {\n name: 'gfmFootnoteCall',\n tokenize: tokenizeGfmFootnoteCall\n },\n [93]: {\n name: 'gfmPotentialFootnoteCall',\n add: 'after',\n tokenize: tokenizePotentialGfmFootnoteCall,\n resolveTo: resolveToPotentialGfmFootnoteCall\n }\n }\n };\n}\n\n// To do: remove after micromark update.\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizePotentialGfmFootnoteCall(effects, ok, nok) {\n const self = this;\n let index = self.events.length;\n const defined = self.parser.gfmFootnotes || (self.parser.gfmFootnotes = []);\n /** @type {Token} */\n let labelStart;\n\n // Find an opening.\n while (index--) {\n const token = self.events[index][1];\n if (token.type === \"labelImage\") {\n labelStart = token;\n break;\n }\n\n // Exit if we’ve walked far enough.\n if (token.type === 'gfmFootnoteCall' || token.type === \"labelLink\" || token.type === \"label\" || token.type === \"image\" || token.type === \"link\") {\n break;\n }\n }\n return start;\n\n /**\n * @type {State}\n */\n function start(code) {\n if (!labelStart || !labelStart._balanced) {\n return nok(code);\n }\n const id = normalizeIdentifier(self.sliceSerialize({\n start: labelStart.end,\n end: self.now()\n }));\n if (id.codePointAt(0) !== 94 || !defined.includes(id.slice(1))) {\n return nok(code);\n }\n effects.enter('gfmFootnoteCallLabelMarker');\n effects.consume(code);\n effects.exit('gfmFootnoteCallLabelMarker');\n return ok(code);\n }\n}\n\n// To do: remove after micromark update.\n/** @type {Resolver} */\nfunction resolveToPotentialGfmFootnoteCall(events, context) {\n let index = events.length;\n /** @type {Token | undefined} */\n let labelStart;\n\n // Find an opening.\n while (index--) {\n if (events[index][1].type === \"labelImage\" && events[index][0] === 'enter') {\n labelStart = events[index][1];\n break;\n }\n }\n // Change the `labelImageMarker` to a `data`.\n events[index + 1][1].type = \"data\";\n events[index + 3][1].type = 'gfmFootnoteCallLabelMarker';\n\n // The whole (without `!`):\n /** @type {Token} */\n const call = {\n type: 'gfmFootnoteCall',\n start: Object.assign({}, events[index + 3][1].start),\n end: Object.assign({}, events[events.length - 1][1].end)\n };\n // The `^` marker\n /** @type {Token} */\n const marker = {\n type: 'gfmFootnoteCallMarker',\n start: Object.assign({}, events[index + 3][1].end),\n end: Object.assign({}, events[index + 3][1].end)\n };\n // Increment the end 1 character.\n marker.end.column++;\n marker.end.offset++;\n marker.end._bufferIndex++;\n /** @type {Token} */\n const string = {\n type: 'gfmFootnoteCallString',\n start: Object.assign({}, marker.end),\n end: Object.assign({}, events[events.length - 1][1].start)\n };\n /** @type {Token} */\n const chunk = {\n type: \"chunkString\",\n contentType: 'string',\n start: Object.assign({}, string.start),\n end: Object.assign({}, string.end)\n };\n\n /** @type {Array<Event>} */\n const replacement = [\n // Take the `labelImageMarker` (now `data`, the `!`)\n events[index + 1], events[index + 2], ['enter', call, context],\n // The `[`\n events[index + 3], events[index + 4],\n // The `^`.\n ['enter', marker, context], ['exit', marker, context],\n // Everything in between.\n ['enter', string, context], ['enter', chunk, context], ['exit', chunk, context], ['exit', string, context],\n // The ending (`]`, properly parsed and labelled).\n events[events.length - 2], events[events.length - 1], ['exit', call, context]];\n events.splice(index, events.length - index + 1, ...replacement);\n return events;\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeGfmFootnoteCall(effects, ok, nok) {\n const self = this;\n const defined = self.parser.gfmFootnotes || (self.parser.gfmFootnotes = []);\n let size = 0;\n /** @type {boolean} */\n let data;\n\n // Note: the implementation of `markdown-rs` is different, because it houses\n // core *and* extensions in one project.\n // Therefore, it can include footnote logic inside `label-end`.\n // We can’t do that, but luckily, we can parse footnotes in a simpler way than\n // needed for labels.\n return start;\n\n /**\n * Start of footnote label.\n *\n * ```markdown\n * > | a [^b] c\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter('gfmFootnoteCall');\n effects.enter('gfmFootnoteCallLabelMarker');\n effects.consume(code);\n effects.exit('gfmFootnoteCallLabelMarker');\n return callStart;\n }\n\n /**\n * After `[`, at `^`.\n *\n * ```markdown\n * > | a [^b] c\n * ^\n * ```\n *\n * @type {State}\n */\n function callStart(code) {\n if (code !== 94) return nok(code);\n effects.enter('gfmFootnoteCallMarker');\n effects.consume(code);\n effects.exit('gfmFootnoteCallMarker');\n effects.enter('gfmFootnoteCallString');\n effects.enter('chunkString').contentType = 'string';\n return callData;\n }\n\n /**\n * In label.\n *\n * ```markdown\n * > | a [^b] c\n * ^\n * ```\n *\n * @type {State}\n */\n function callData(code) {\n if (\n // Too long.\n size > 999 ||\n // Closing brace with nothing.\n code === 93 && !data ||\n // Space or tab is not supported by GFM for some reason.\n // `\\n` and `[` not being supported makes sense.\n code === null || code === 91 || markdownLineEndingOrSpace(code)) {\n return nok(code);\n }\n if (code === 93) {\n effects.exit('chunkString');\n const token = effects.exit('gfmFootnoteCallString');\n if (!defined.includes(normalizeIdentifier(self.sliceSerialize(token)))) {\n return nok(code);\n }\n effects.enter('gfmFootnoteCallLabelMarker');\n effects.consume(code);\n effects.exit('gfmFootnoteCallLabelMarker');\n effects.exit('gfmFootnoteCall');\n return ok;\n }\n if (!markdownLineEndingOrSpace(code)) {\n data = true;\n }\n size++;\n effects.consume(code);\n return code === 92 ? callEscape : callData;\n }\n\n /**\n * On character after escape.\n *\n * ```markdown\n * > | a [^b\\c] d\n * ^\n * ```\n *\n * @type {State}\n */\n function callEscape(code) {\n if (code === 91 || code === 92 || code === 93) {\n effects.consume(code);\n size++;\n return callData;\n }\n return callData(code);\n }\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeDefinitionStart(effects, ok, nok) {\n const self = this;\n const defined = self.parser.gfmFootnotes || (self.parser.gfmFootnotes = []);\n /** @type {string} */\n let identifier;\n let size = 0;\n /** @type {boolean | undefined} */\n let data;\n return start;\n\n /**\n * Start of GFM footnote definition.\n *\n * ```markdown\n * > | [^a]: b\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter('gfmFootnoteDefinition')._container = true;\n effects.enter('gfmFootnoteDefinitionLabel');\n effects.enter('gfmFootnoteDefinitionLabelMarker');\n effects.consume(code);\n effects.exit('gfmFootnoteDefinitionLabelMarker');\n return labelAtMarker;\n }\n\n /**\n * In label, at caret.\n *\n * ```markdown\n * > | [^a]: b\n * ^\n * ```\n *\n * @type {State}\n */\n function labelAtMarker(code) {\n if (code === 94) {\n effects.enter('gfmFootnoteDefinitionMarker');\n effects.consume(code);\n effects.exit('gfmFootnoteDefinitionMarker');\n effects.enter('gfmFootnoteDefinitionLabelString');\n effects.enter('chunkString').contentType = 'string';\n return labelInside;\n }\n return nok(code);\n }\n\n /**\n * In label.\n *\n * > 👉 **Note**: `cmark-gfm` prevents whitespace from occurring in footnote\n * > definition labels.\n *\n * ```markdown\n * > | [^a]: b\n * ^\n * ```\n *\n * @type {State}\n */\n function labelInside(code) {\n if (\n // Too long.\n size > 999 ||\n // Closing brace with nothing.\n code === 93 && !data ||\n // Space or tab is not supported by GFM for some reason.\n // `\\n` and `[` not being supported makes sense.\n code === null || code === 91 || markdownLineEndingOrSpace(code)) {\n return nok(code);\n }\n if (code === 93) {\n effects.exit('chunkString');\n const token = effects.exit('gfmFootnoteDefinitionLabelString');\n identifier = normalizeIdentifier(self.sliceSerialize(token));\n effects.enter('gfmFootnoteDefinitionLabelMarker');\n effects.consume(code);\n effects.exit('gfmFootnoteDefinitionLabelMarker');\n effects.exit('gfmFootnoteDefinitionLabel');\n return labelAfter;\n }\n if (!markdownLineEndingOrSpace(code)) {\n data = true;\n }\n size++;\n effects.consume(code);\n return code === 92 ? labelEscape : labelInside;\n }\n\n /**\n * After `\\`, at a special character.\n *\n * > 👉 **Note**: `cmark-gfm` currently does not support escaped brackets:\n * > <https://github.com/github/cmark-gfm/issues/240>\n *\n * ```markdown\n * > | [^a\\*b]: c\n * ^\n * ```\n *\n * @type {State}\n */\n function labelEscape(code) {\n if (code === 91 || code === 92 || code === 93) {\n effects.consume(code);\n size++;\n return labelInside;\n }\n return labelInside(code);\n }\n\n /**\n * After definition label.\n *\n * ```markdown\n * > | [^a]: b\n * ^\n * ```\n *\n * @type {State}\n */\n function labelAfter(code) {\n if (code === 58) {\n effects.enter('definitionMarker');\n effects.consume(code);\n effects.exit('definitionMarker');\n if (!defined.includes(identifier)) {\n defined.push(identifier);\n }\n\n // Any whitespace after the marker is eaten, forming indented code\n // is not possible.\n // No space is also fine, just like a block quote marker.\n return factorySpace(effects, whitespaceAfter, 'gfmFootnoteDefinitionWhitespace');\n }\n return nok(code);\n }\n\n /**\n * After definition prefix.\n *\n * ```markdown\n * > | [^a]: b\n * ^\n * ```\n *\n * @type {State}\n */\n function whitespaceAfter(code) {\n // `markdown-rs` has a wrapping token for the prefix that is closed here.\n return ok(code);\n }\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeDefinitionContinuation(effects, ok, nok) {\n /// Start of footnote definition continuation.\n ///\n /// ```markdown\n /// | [^a]: b\n /// > | c\n /// ^\n /// ```\n //\n // Either a blank line, which is okay, or an indented thing.\n return effects.check(blankLine, ok, effects.attempt(indent, ok, nok));\n}\n\n/** @type {Exiter} */\nfunction gfmFootnoteDefinitionEnd(effects) {\n effects.exit('gfmFootnoteDefinition');\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeIndent(effects, ok, nok) {\n const self = this;\n return factorySpace(effects, afterPrefix, 'gfmFootnoteDefinitionIndent', 4 + 1);\n\n /**\n * @type {State}\n */\n function afterPrefix(code) {\n const tail = self.events[self.events.length - 1];\n return tail && tail[1].type === 'gfmFootnoteDefinitionIndent' && tail[2].sliceSerialize(tail[1], true).length === 4 ? ok(code) : nok(code);\n }\n}"],"names":["indent","tokenize","effects","ok","nok","self","this","factorySpace","code","tail","events","length","type","sliceSerialize","partial","gfmFootnote","document","name","tokenizeDefinitionStart","continuation","tokenizeDefinitionContinuation","exit","gfmFootnoteDefinitionEnd","text","tokenizeGfmFootnoteCall","add","tokenizePotentialGfmFootnoteCall","resolveTo","resolveToPotentialGfmFootnoteCall","index","defined","parser","gfmFootnotes","labelStart","token","_balanced","id","normalizeIdentifier","start","end","now","codePointAt","includes","slice","enter","consume","context","call","Object","assign","marker","column","offset","_bufferIndex","string","chunk","contentType","replacement","splice","data","size","callStart","callData","markdownLineEndingOrSpace","callEscape","identifier","_container","labelAtMarker","labelInside","labelAfter","labelEscape","push","whitespaceAfter","check","blankLine","attempt"],"mappings":"6XAQA,MAAMA,EAAS,CACbC,SAgdF,SAAwBC,EAASC,EAAIC,GACnC,MAAMC,EAAOC,KACb,OAAOC,EAAaL,GAKpB,SAAqBM,GACnB,MAAMC,EAAOJ,EAAKK,OAAOL,EAAKK,OAAOC,OAAS,GAC9C,OAAOF,GAAyB,gCAAjBA,EAAK,GAAGG,MAA2F,IAAjDH,EAAK,GAAGI,eAAeJ,EAAK,IAAI,GAAME,OAAeR,EAAGK,GAAQJ,EAAII,EACtI,GARyC,8BAA+B,EAS3E,EA1dEM,SAAS,GAgBJ,SAASC,IAEd,MAAO,CACLC,SAAU,CACR,GAAM,CACJC,KAAM,wBACNhB,SAAUiB,EACVC,aAAc,CACZlB,SAAUmB,GAEZC,KAAMC,IAGVC,KAAM,CACJ,GA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Q3E,EAAQG,EAAIC,GAClE,CAGA,SAASkB,EAAyBpB,GAChCA,EAAQmB,KAAK,wBACf"}
|
|
1
|
+
{"version":3,"file":"syntax.js","sources":["../../../../node_modules/micromark-extension-gfm-footnote/lib/syntax.js"],"sourcesContent":["/**\n * @typedef {import('micromark-util-types').Event} Event\n * @typedef {import('micromark-util-types').Exiter} Exiter\n * @typedef {import('micromark-util-types').Extension} Extension\n * @typedef {import('micromark-util-types').Resolver} Resolver\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').Token} Token\n * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n */\n\nimport {blankLine} from 'micromark-core-commonmark'\nimport {factorySpace} from 'micromark-factory-space'\nimport {markdownLineEndingOrSpace} from 'micromark-util-character'\nimport {normalizeIdentifier} from 'micromark-util-normalize-identifier'\nconst indent = {\n tokenize: tokenizeIndent,\n partial: true\n}\n\n// To do: micromark should support a `_hiddenGfmFootnoteSupport`, which only\n// affects label start (image).\n// That will let us drop `tokenizePotentialGfmFootnote*`.\n// It currently has a `_hiddenFootnoteSupport`, which affects that and more.\n// That can be removed when `micromark-extension-footnote` is archived.\n\n/**\n * Create an extension for `micromark` to enable GFM footnote syntax.\n *\n * @returns {Extension}\n * Extension for `micromark` that can be passed in `extensions` to\n * enable GFM footnote syntax.\n */\nexport function gfmFootnote() {\n /** @type {Extension} */\n return {\n document: {\n [91]: {\n tokenize: tokenizeDefinitionStart,\n continuation: {\n tokenize: tokenizeDefinitionContinuation\n },\n exit: gfmFootnoteDefinitionEnd\n }\n },\n text: {\n [91]: {\n tokenize: tokenizeGfmFootnoteCall\n },\n [93]: {\n add: 'after',\n tokenize: tokenizePotentialGfmFootnoteCall,\n resolveTo: resolveToPotentialGfmFootnoteCall\n }\n }\n }\n}\n\n// To do: remove after micromark update.\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizePotentialGfmFootnoteCall(effects, ok, nok) {\n const self = this\n let index = self.events.length\n /** @type {Array<string>} */\n // @ts-expect-error It’s fine!\n const defined = self.parser.gfmFootnotes || (self.parser.gfmFootnotes = [])\n /** @type {Token} */\n let labelStart\n\n // Find an opening.\n while (index--) {\n const token = self.events[index][1]\n if (token.type === 'labelImage') {\n labelStart = token\n break\n }\n\n // Exit if we’ve walked far enough.\n if (\n token.type === 'gfmFootnoteCall' ||\n token.type === 'labelLink' ||\n token.type === 'label' ||\n token.type === 'image' ||\n token.type === 'link'\n ) {\n break\n }\n }\n return start\n\n /**\n * @type {State}\n */\n function start(code) {\n if (!labelStart || !labelStart._balanced) {\n return nok(code)\n }\n const id = normalizeIdentifier(\n self.sliceSerialize({\n start: labelStart.end,\n end: self.now()\n })\n )\n if (id.codePointAt(0) !== 94 || !defined.includes(id.slice(1))) {\n return nok(code)\n }\n effects.enter('gfmFootnoteCallLabelMarker')\n effects.consume(code)\n effects.exit('gfmFootnoteCallLabelMarker')\n return ok(code)\n }\n}\n\n// To do: remove after micromark update.\n/** @type {Resolver} */\nfunction resolveToPotentialGfmFootnoteCall(events, context) {\n let index = events.length\n /** @type {Token | undefined} */\n let labelStart\n\n // Find an opening.\n while (index--) {\n if (\n events[index][1].type === 'labelImage' &&\n events[index][0] === 'enter'\n ) {\n labelStart = events[index][1]\n break\n }\n }\n // Change the `labelImageMarker` to a `data`.\n events[index + 1][1].type = 'data'\n events[index + 3][1].type = 'gfmFootnoteCallLabelMarker'\n\n // The whole (without `!`):\n /** @type {Token} */\n const call = {\n type: 'gfmFootnoteCall',\n start: Object.assign({}, events[index + 3][1].start),\n end: Object.assign({}, events[events.length - 1][1].end)\n }\n // The `^` marker\n /** @type {Token} */\n const marker = {\n type: 'gfmFootnoteCallMarker',\n start: Object.assign({}, events[index + 3][1].end),\n end: Object.assign({}, events[index + 3][1].end)\n }\n // Increment the end 1 character.\n marker.end.column++\n marker.end.offset++\n marker.end._bufferIndex++\n /** @type {Token} */\n const string = {\n type: 'gfmFootnoteCallString',\n start: Object.assign({}, marker.end),\n end: Object.assign({}, events[events.length - 1][1].start)\n }\n /** @type {Token} */\n const chunk = {\n type: 'chunkString',\n contentType: 'string',\n start: Object.assign({}, string.start),\n end: Object.assign({}, string.end)\n }\n\n /** @type {Array<Event>} */\n const replacement = [\n // Take the `labelImageMarker` (now `data`, the `!`)\n events[index + 1],\n events[index + 2],\n ['enter', call, context],\n // The `[`\n events[index + 3],\n events[index + 4],\n // The `^`.\n ['enter', marker, context],\n ['exit', marker, context],\n // Everything in between.\n ['enter', string, context],\n ['enter', chunk, context],\n ['exit', chunk, context],\n ['exit', string, context],\n // The ending (`]`, properly parsed and labelled).\n events[events.length - 2],\n events[events.length - 1],\n ['exit', call, context]\n ]\n events.splice(index, events.length - index + 1, ...replacement)\n return events\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeGfmFootnoteCall(effects, ok, nok) {\n const self = this\n /** @type {Array<string>} */\n // @ts-expect-error It’s fine!\n const defined = self.parser.gfmFootnotes || (self.parser.gfmFootnotes = [])\n let size = 0\n /** @type {boolean} */\n let data\n\n // Note: the implementation of `markdown-rs` is different, because it houses\n // core *and* extensions in one project.\n // Therefore, it can include footnote logic inside `label-end`.\n // We can’t do that, but luckily, we can parse footnotes in a simpler way than\n // needed for labels.\n return start\n\n /**\n * Start of footnote label.\n *\n * ```markdown\n * > | a [^b] c\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter('gfmFootnoteCall')\n effects.enter('gfmFootnoteCallLabelMarker')\n effects.consume(code)\n effects.exit('gfmFootnoteCallLabelMarker')\n return callStart\n }\n\n /**\n * After `[`, at `^`.\n *\n * ```markdown\n * > | a [^b] c\n * ^\n * ```\n *\n * @type {State}\n */\n function callStart(code) {\n if (code !== 94) return nok(code)\n effects.enter('gfmFootnoteCallMarker')\n effects.consume(code)\n effects.exit('gfmFootnoteCallMarker')\n effects.enter('gfmFootnoteCallString')\n effects.enter('chunkString').contentType = 'string'\n return callData\n }\n\n /**\n * In label.\n *\n * ```markdown\n * > | a [^b] c\n * ^\n * ```\n *\n * @type {State}\n */\n function callData(code) {\n if (\n // Too long.\n size > 999 ||\n // Closing brace with nothing.\n (code === 93 && !data) ||\n // Space or tab is not supported by GFM for some reason.\n // `\\n` and `[` not being supported makes sense.\n code === null ||\n code === 91 ||\n markdownLineEndingOrSpace(code)\n ) {\n return nok(code)\n }\n if (code === 93) {\n effects.exit('chunkString')\n const token = effects.exit('gfmFootnoteCallString')\n if (!defined.includes(normalizeIdentifier(self.sliceSerialize(token)))) {\n return nok(code)\n }\n effects.enter('gfmFootnoteCallLabelMarker')\n effects.consume(code)\n effects.exit('gfmFootnoteCallLabelMarker')\n effects.exit('gfmFootnoteCall')\n return ok\n }\n if (!markdownLineEndingOrSpace(code)) {\n data = true\n }\n size++\n effects.consume(code)\n return code === 92 ? callEscape : callData\n }\n\n /**\n * On character after escape.\n *\n * ```markdown\n * > | a [^b\\c] d\n * ^\n * ```\n *\n * @type {State}\n */\n function callEscape(code) {\n if (code === 91 || code === 92 || code === 93) {\n effects.consume(code)\n size++\n return callData\n }\n return callData(code)\n }\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeDefinitionStart(effects, ok, nok) {\n const self = this\n /** @type {Array<string>} */\n // @ts-expect-error It’s fine!\n const defined = self.parser.gfmFootnotes || (self.parser.gfmFootnotes = [])\n /** @type {string} */\n let identifier\n let size = 0\n /** @type {boolean | undefined} */\n let data\n return start\n\n /**\n * Start of GFM footnote definition.\n *\n * ```markdown\n * > | [^a]: b\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter('gfmFootnoteDefinition')._container = true\n effects.enter('gfmFootnoteDefinitionLabel')\n effects.enter('gfmFootnoteDefinitionLabelMarker')\n effects.consume(code)\n effects.exit('gfmFootnoteDefinitionLabelMarker')\n return labelAtMarker\n }\n\n /**\n * In label, at caret.\n *\n * ```markdown\n * > | [^a]: b\n * ^\n * ```\n *\n * @type {State}\n */\n function labelAtMarker(code) {\n if (code === 94) {\n effects.enter('gfmFootnoteDefinitionMarker')\n effects.consume(code)\n effects.exit('gfmFootnoteDefinitionMarker')\n effects.enter('gfmFootnoteDefinitionLabelString')\n effects.enter('chunkString').contentType = 'string'\n return labelInside\n }\n return nok(code)\n }\n\n /**\n * In label.\n *\n * > 👉 **Note**: `cmark-gfm` prevents whitespace from occurring in footnote\n * > definition labels.\n *\n * ```markdown\n * > | [^a]: b\n * ^\n * ```\n *\n * @type {State}\n */\n function labelInside(code) {\n if (\n // Too long.\n size > 999 ||\n // Closing brace with nothing.\n (code === 93 && !data) ||\n // Space or tab is not supported by GFM for some reason.\n // `\\n` and `[` not being supported makes sense.\n code === null ||\n code === 91 ||\n markdownLineEndingOrSpace(code)\n ) {\n return nok(code)\n }\n if (code === 93) {\n effects.exit('chunkString')\n const token = effects.exit('gfmFootnoteDefinitionLabelString')\n identifier = normalizeIdentifier(self.sliceSerialize(token))\n effects.enter('gfmFootnoteDefinitionLabelMarker')\n effects.consume(code)\n effects.exit('gfmFootnoteDefinitionLabelMarker')\n effects.exit('gfmFootnoteDefinitionLabel')\n return labelAfter\n }\n if (!markdownLineEndingOrSpace(code)) {\n data = true\n }\n size++\n effects.consume(code)\n return code === 92 ? labelEscape : labelInside\n }\n\n /**\n * After `\\`, at a special character.\n *\n * > 👉 **Note**: `cmark-gfm` currently does not support escaped brackets:\n * > <https://github.com/github/cmark-gfm/issues/240>\n *\n * ```markdown\n * > | [^a\\*b]: c\n * ^\n * ```\n *\n * @type {State}\n */\n function labelEscape(code) {\n if (code === 91 || code === 92 || code === 93) {\n effects.consume(code)\n size++\n return labelInside\n }\n return labelInside(code)\n }\n\n /**\n * After definition label.\n *\n * ```markdown\n * > | [^a]: b\n * ^\n * ```\n *\n * @type {State}\n */\n function labelAfter(code) {\n if (code === 58) {\n effects.enter('definitionMarker')\n effects.consume(code)\n effects.exit('definitionMarker')\n if (!defined.includes(identifier)) {\n defined.push(identifier)\n }\n\n // Any whitespace after the marker is eaten, forming indented code\n // is not possible.\n // No space is also fine, just like a block quote marker.\n return factorySpace(\n effects,\n whitespaceAfter,\n 'gfmFootnoteDefinitionWhitespace'\n )\n }\n return nok(code)\n }\n\n /**\n * After definition prefix.\n *\n * ```markdown\n * > | [^a]: b\n * ^\n * ```\n *\n * @type {State}\n */\n function whitespaceAfter(code) {\n // `markdown-rs` has a wrapping token for the prefix that is closed here.\n return ok(code)\n }\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeDefinitionContinuation(effects, ok, nok) {\n /// Start of footnote definition continuation.\n ///\n /// ```markdown\n /// | [^a]: b\n /// > | c\n /// ^\n /// ```\n //\n // Either a blank line, which is okay, or an indented thing.\n return effects.check(blankLine, ok, effects.attempt(indent, ok, nok))\n}\n\n/** @type {Exiter} */\nfunction gfmFootnoteDefinitionEnd(effects) {\n effects.exit('gfmFootnoteDefinition')\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeIndent(effects, ok, nok) {\n const self = this\n return factorySpace(\n effects,\n afterPrefix,\n 'gfmFootnoteDefinitionIndent',\n 4 + 1\n )\n\n /**\n * @type {State}\n */\n function afterPrefix(code) {\n const tail = self.events[self.events.length - 1]\n return tail &&\n tail[1].type === 'gfmFootnoteDefinitionIndent' &&\n tail[2].sliceSerialize(tail[1], true).length === 4\n ? ok(code)\n : nok(code)\n }\n}\n"],"names":["indent","tokenize","effects","ok","nok","self","this","factorySpace","code","tail","events","length","type","sliceSerialize","partial","gfmFootnote","document","tokenizeDefinitionStart","continuation","tokenizeDefinitionContinuation","exit","gfmFootnoteDefinitionEnd","text","tokenizeGfmFootnoteCall","add","tokenizePotentialGfmFootnoteCall","resolveTo","resolveToPotentialGfmFootnoteCall","index","defined","parser","gfmFootnotes","labelStart","token","_balanced","id","normalizeIdentifier","start","end","now","codePointAt","includes","slice","enter","consume","context","call","Object","assign","marker","column","offset","_bufferIndex","string","chunk","contentType","replacement","splice","data","size","callStart","callData","markdownLineEndingOrSpace","callEscape","identifier","_container","labelAtMarker","labelInside","labelAfter","labelEscape","push","whitespaceAfter","check","blankLine","attempt"],"mappings":"wgBAeA,MAAMA,EAAS,CACbC,SAkfF,SAAwBC,EAASC,EAAIC,GACnC,MAAMC,EAAOC,KACb,OAAOC,EACLL,GASF,SAAqBM,GACnB,MAAMC,EAAOJ,EAAKK,OAAOL,EAAKK,OAAOC,OAAS,GAC9C,OAAOF,GACY,gCAAjBA,EAAK,GAAGG,MACyC,IAAjDH,EAAK,GAAGI,eAAeJ,EAAK,IAAI,GAAME,OACpCR,EAAGK,GACHJ,EAAII,EACT,GAdC,8BACA,EAcJ,EArgBEM,SAAS,GAgBJ,SAASC,IAEd,MAAO,CACLC,SAAU,CACR,GAAM,CACJf,SAAUgB,EACVC,aAAc,CACZjB,SAAUkB,GAEZC,KAAMC,IAGVC,KAAM,CACJ,GAAM,CACJrB,SAAUsB,GAEZ,GAAM,CACJC,IAAK,QACLvB,SAAUwB,EACVC,UAAWC,IAInB,CAOA,SAASF,EAAiCvB,EAASC,EAAIC,GACrD,MAAMC,EAAOC,KACb,IAAIsB,EAAQvB,EAAKK,OAAOC,OAGxB,MAAMkB,EAAUxB,EAAKyB,OAAOC,eAAiB1B,EAAKyB,OAAOC,aAAe,IAExE,IAAIC,EAGJ,KAAOJ,KAAS,CACd,MAAMK,EAAQ5B,EAAKK,OAAOkB,GAAO,GACjC,GAAmB,eAAfK,EAAMrB,KAAuB,CAC/BoB,EAAaC,EACb,KACD,CAGD,GACiB,oBAAfA,EAAMrB,MACS,cAAfqB,EAAMrB,MACS,UAAfqB,EAAMrB,MACS,UAAfqB,EAAMrB,MACS,SAAfqB,EAAMrB,KAEN,KAEH,CACD,OAKA,SAAeJ,GACb,IAAKwB,IAAeA,EAAWE,UAC7B,OAAO9B,EAAII,GAEb,MAAM2B,EAAKC,EACT/B,EAAKQ,eAAe,CAClBwB,MAA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QpC,GACA,KAATA,EAAc6D,EAAcF,CACpC,CAeD,SAASE,EAAY7D,GACnB,OAAa,KAATA,GAAwB,KAATA,GAAwB,KAATA,GAChCN,EAAQ0C,QAAQpC,GAChBmD,IACOQ,GAEFA,EAAY3D,EACpB,CAYD,SAAS4D,EAAW5D,GAClB,OAAa,KAATA,GACFN,EAAQyC,MAAM,oBACdzC,EAAQ0C,QAAQpC,GAChBN,EAAQkB,KAAK,oBACRS,EAAQY,SAASuB,IACpBnC,EAAQyC,KAAKN,GAMRzD,EACLL,EACAqE,EACA,oCAGGnE,EAAII,EACZ,CAYD,SAAS+D,EAAgB/D,GAEvB,OAAOL,EAAGK,EACX,CACH,CAMA,SAASW,EAA+BjB,EAASC,EAAIC,GAUnD,OAAOF,EAAQsE,MAAMC,EAAWtE,EAAID,EAAQwE,QAAQ1E,EAAQG,EAAIC,GAClE,CAGA,SAASiB,EAAyBnB,GAChCA,EAAQkB,KAAK,wBACf"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../node_modules/micromark-extension-gfm-footnote/node_modules/micromark-util-character/index.js"],"sourcesContent":["/**\n * @typedef {import('micromark-util-types').Code} Code\n */\n\nimport {unicodePunctuationRegex} from './lib/unicode-punctuation-regex.js'\n\n/**\n * Check whether the character code represents an ASCII alpha (`a` through `z`,\n * case insensitive).\n *\n * An **ASCII alpha** is an ASCII upper alpha or ASCII lower alpha.\n *\n * An **ASCII upper alpha** is a character in the inclusive range U+0041 (`A`)\n * to U+005A (`Z`).\n *\n * An **ASCII lower alpha** is a character in the inclusive range U+0061 (`a`)\n * to U+007A (`z`).\n *\n * @param code\n * Code.\n * @returns\n * Whether it matches.\n */\nexport const asciiAlpha = regexCheck(/[A-Za-z]/)\n\n/**\n * Check whether the character code represents an ASCII alphanumeric (`a`\n * through `z`, case insensitive, or `0` through `9`).\n *\n * An **ASCII alphanumeric** is an ASCII digit (see `asciiDigit`) or ASCII alpha\n * (see `asciiAlpha`).\n *\n * @param code\n * Code.\n * @returns\n * Whether it matches.\n */\nexport const asciiAlphanumeric = regexCheck(/[\\dA-Za-z]/)\n\n/**\n * Check whether the character code represents an ASCII atext.\n *\n * atext is an ASCII alphanumeric (see `asciiAlphanumeric`), or a character in\n * the inclusive ranges U+0023 NUMBER SIGN (`#`) to U+0027 APOSTROPHE (`'`),\n * U+002A ASTERISK (`*`), U+002B PLUS SIGN (`+`), U+002D DASH (`-`), U+002F\n * SLASH (`/`), U+003D EQUALS TO (`=`), U+003F QUESTION MARK (`?`), U+005E\n * CARET (`^`) to U+0060 GRAVE ACCENT (`` ` ``), or U+007B LEFT CURLY BRACE\n * (`{`) to U+007E TILDE (`~`).\n *\n * See:\n * **\\[RFC5322]**:\n * [Internet Message Format](https://tools.ietf.org/html/rfc5322).\n * P. Resnick.\n * IETF.\n *\n * @param code\n * Code.\n * @returns\n * Whether it matches.\n */\nexport const asciiAtext = regexCheck(/[#-'*+\\--9=?A-Z^-~]/)\n\n/**\n * Check whether a character code is an ASCII control character.\n *\n * An **ASCII control** is a character in the inclusive range U+0000 NULL (NUL)\n * to U+001F (US), or U+007F (DEL).\n *\n * @param {Code} code\n * Code.\n * @returns {boolean}\n * Whether it matches.\n */\nexport function asciiControl(code) {\n return (\n // Special whitespace codes (which have negative values), C0 and Control\n // character DEL\n code !== null && (code < 32 || code === 127)\n )\n}\n\n/**\n * Check whether the character code represents an ASCII digit (`0` through `9`).\n *\n * An **ASCII digit** is a character in the inclusive range U+0030 (`0`) to\n * U+0039 (`9`).\n *\n * @param code\n * Code.\n * @returns\n * Whether it matches.\n */\nexport const asciiDigit = regexCheck(/\\d/)\n\n/**\n * Check whether the character code represents an ASCII hex digit (`a` through\n * `f`, case insensitive, or `0` through `9`).\n *\n * An **ASCII hex digit** is an ASCII digit (see `asciiDigit`), ASCII upper hex\n * digit, or an ASCII lower hex digit.\n *\n * An **ASCII upper hex digit** is a character in the inclusive range U+0041\n * (`A`) to U+0046 (`F`).\n *\n * An **ASCII lower hex digit** is a character in the inclusive range U+0061\n * (`a`) to U+0066 (`f`).\n *\n * @param code\n * Code.\n * @returns\n * Whether it matches.\n */\nexport const asciiHexDigit = regexCheck(/[\\dA-Fa-f]/)\n\n/**\n * Check whether the character code represents ASCII punctuation.\n *\n * An **ASCII punctuation** is a character in the inclusive ranges U+0021\n * EXCLAMATION MARK (`!`) to U+002F SLASH (`/`), U+003A COLON (`:`) to U+0040 AT\n * SIGN (`@`), U+005B LEFT SQUARE BRACKET (`[`) to U+0060 GRAVE ACCENT\n * (`` ` ``), or U+007B LEFT CURLY BRACE (`{`) to U+007E TILDE (`~`).\n *\n * @param code\n * Code.\n * @returns\n * Whether it matches.\n */\nexport const asciiPunctuation = regexCheck(/[!-/:-@[-`{-~]/)\n\n/**\n * Check whether a character code is a markdown line ending.\n *\n * A **markdown line ending** is the virtual characters M-0003 CARRIAGE RETURN\n * LINE FEED (CRLF), M-0004 LINE FEED (LF) and M-0005 CARRIAGE RETURN (CR).\n *\n * In micromark, the actual character U+000A LINE FEED (LF) and U+000D CARRIAGE\n * RETURN (CR) are replaced by these virtual characters depending on whether\n * they occurred together.\n *\n * @param {Code} code\n * Code.\n * @returns {boolean}\n * Whether it matches.\n */\nexport function markdownLineEnding(code) {\n return code !== null && code < -2\n}\n\n/**\n * Check whether a character code is a markdown line ending (see\n * `markdownLineEnding`) or markdown space (see `markdownSpace`).\n *\n * @param {Code} code\n * Code.\n * @returns {boolean}\n * Whether it matches.\n */\nexport function markdownLineEndingOrSpace(code) {\n return code !== null && (code < 0 || code === 32)\n}\n\n/**\n * Check whether a character code is a markdown space.\n *\n * A **markdown space** is the concrete character U+0020 SPACE (SP) and the\n * virtual characters M-0001 VIRTUAL SPACE (VS) and M-0002 HORIZONTAL TAB (HT).\n *\n * In micromark, the actual character U+0009 CHARACTER TABULATION (HT) is\n * replaced by one M-0002 HORIZONTAL TAB (HT) and between 0 and 3 M-0001 VIRTUAL\n * SPACE (VS) characters, depending on the column at which the tab occurred.\n *\n * @param {Code} code\n * Code.\n * @returns {boolean}\n * Whether it matches.\n */\nexport function markdownSpace(code) {\n return code === -2 || code === -1 || code === 32\n}\n\n// Size note: removing ASCII from the regex and using `asciiPunctuation` here\n// In fact adds to the bundle size.\n/**\n * Check whether the character code represents Unicode punctuation.\n *\n * A **Unicode punctuation** is a character in the Unicode `Pc` (Punctuation,\n * Connector), `Pd` (Punctuation, Dash), `Pe` (Punctuation, Close), `Pf`\n * (Punctuation, Final quote), `Pi` (Punctuation, Initial quote), `Po`\n * (Punctuation, Other), or `Ps` (Punctuation, Open) categories, or an ASCII\n * punctuation (see `asciiPunctuation`).\n *\n * See:\n * **\\[UNICODE]**:\n * [The Unicode Standard](https://www.unicode.org/versions/).\n * Unicode Consortium.\n *\n * @param code\n * Code.\n * @returns\n * Whether it matches.\n */\nexport const unicodePunctuation = regexCheck(unicodePunctuationRegex)\n\n/**\n * Check whether the character code represents Unicode whitespace.\n *\n * Note that this does handle micromark specific markdown whitespace characters.\n * See `markdownLineEndingOrSpace` to check that.\n *\n * A **Unicode whitespace** is a character in the Unicode `Zs` (Separator,\n * Space) category, or U+0009 CHARACTER TABULATION (HT), U+000A LINE FEED (LF),\n * U+000C (FF), or U+000D CARRIAGE RETURN (CR) (**\\[UNICODE]**).\n *\n * See:\n * **\\[UNICODE]**:\n * [The Unicode Standard](https://www.unicode.org/versions/).\n * Unicode Consortium.\n *\n * @param code\n * Code.\n * @returns\n * Whether it matches.\n */\nexport const unicodeWhitespace = regexCheck(/\\s/)\n\n/**\n * Create a code check from a regex.\n *\n * @param {RegExp} regex\n * @returns {(code: Code) => boolean}\n */\nfunction regexCheck(regex) {\n return check\n\n /**\n * Check whether a code matches the bound regex.\n *\n * @param {Code} code\n * Character code.\n * @returns {boolean}\n * Whether the character code matches the bound regex.\n */\n function check(code) {\n return code !== null && regex.test(String.fromCharCode(code))\n }\n}\n"],"names":["markdownLineEndingOrSpace","code"],"mappings":"AA6JO,SAASA,EAA0BC,GACxC,OAAgB,OAATA,IAAkBA,EAAO,GAAc,KAATA,EACvC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{splice as e}from"../../micromark-util-chunked/index.js";import{classifyCharacter as t}from"../../micromark-util-classify-character/index.js";import{resolveAll as r}from"../../micromark-util-resolve-all/index.js";function n(n){let o=(n||{}).singleTilde;const s={
|
|
1
|
+
import{splice as e}from"../../micromark-util-chunked/index.js";import{classifyCharacter as t}from"../../micromark-util-classify-character/index.js";import{resolveAll as r}from"../../micromark-util-resolve-all/index.js";function n(n){let o=(n||{}).singleTilde;const s={tokenize:function(e,r,n){const s=this.previous,i=this.events;let u=0;return function(t){if(126===s&&"characterEscape"!==i[i.length-1][1].type)return n(t);return e.enter("strikethroughSequenceTemporary"),c(t)};function c(i){const a=t(s);if(126===i)return u>1?n(i):(e.consume(i),u++,c);if(u<2&&!o)return n(i);const l=e.exit("strikethroughSequenceTemporary"),h=t(i);return l._open=!h||2===h&&Boolean(a),l._close=!a||2===a&&Boolean(h),r(i)}},resolveAll:function(t,n){let o=-1;for(;++o<t.length;)if("enter"===t[o][0]&&"strikethroughSequenceTemporary"===t[o][1].type&&t[o][1]._close){let s=o;for(;s--;)if("exit"===t[s][0]&&"strikethroughSequenceTemporary"===t[s][1].type&&t[s][1]._open&&t[o][1].end.offset-t[o][1].start.offset==t[s][1].end.offset-t[s][1].start.offset){t[o][1].type="strikethroughSequence",t[s][1].type="strikethroughSequence";const i={type:"strikethrough",start:Object.assign({},t[s][1].start),end:Object.assign({},t[o][1].end)},u={type:"strikethroughText",start:Object.assign({},t[s][1].end),end:Object.assign({},t[o][1].start)},c=[["enter",i,n],["enter",t[s][1],n],["exit",t[s][1],n],["enter",u,n]],a=n.parser.constructs.insideSpan.null;a&&e(c,c.length,0,r(a,t.slice(s+1,o),n)),e(c,c.length,0,[["exit",u,n],["enter",t[o][1],n],["exit",t[o][1],n],["exit",i,n]]),e(t,s-1,o-s+3,c),o=s+c.length-2;break}}o=-1;for(;++o<t.length;)"strikethroughSequenceTemporary"===t[o][1].type&&(t[o][1].type="data");return t}};return null==o&&(o=!0),{text:{126:s},insideSpan:{null:[s]},attentionMarkers:{null:[126]}}}export{n as gfmStrikethrough};
|
|
2
2
|
//# sourceMappingURL=syntax.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"syntax.js","sources":["../../../../node_modules/micromark-extension-gfm-strikethrough/lib/syntax.js"],"sourcesContent":["/**\n * @
|
|
1
|
+
{"version":3,"file":"syntax.js","sources":["../../../../node_modules/micromark-extension-gfm-strikethrough/lib/syntax.js"],"sourcesContent":["/**\n * @typedef {import('micromark-util-types').Event} Event\n * @typedef {import('micromark-util-types').Extension} Extension\n * @typedef {import('micromark-util-types').Resolver} Resolver\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').Token} Token\n * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n *\n * @typedef Options\n * Configuration (optional).\n * @property {boolean} [singleTilde=true]\n * Whether to support strikethrough with a single tilde.\n *\n * Single tildes work on github.com, but are technically prohibited by the\n * GFM spec.\n */\n\nimport {splice} from 'micromark-util-chunked'\nimport {classifyCharacter} from 'micromark-util-classify-character'\nimport {resolveAll} from 'micromark-util-resolve-all'\n/**\n * Create an extension for `micromark` to enable GFM strikethrough syntax.\n *\n * @param {Options | null | undefined} [options]\n * Configuration.\n * @returns {Extension}\n * Extension for `micromark` that can be passed in `extensions`, to\n * enable GFM strikethrough syntax.\n */\nexport function gfmStrikethrough(options) {\n const options_ = options || {}\n let single = options_.singleTilde\n const tokenizer = {\n tokenize: tokenizeStrikethrough,\n resolveAll: resolveAllStrikethrough\n }\n if (single === null || single === undefined) {\n single = true\n }\n return {\n text: {\n [126]: tokenizer\n },\n insideSpan: {\n null: [tokenizer]\n },\n attentionMarkers: {\n null: [126]\n }\n }\n\n /**\n * Take events and resolve strikethrough.\n *\n * @type {Resolver}\n */\n function resolveAllStrikethrough(events, context) {\n let index = -1\n\n // Walk through all events.\n while (++index < events.length) {\n // Find a token that can close.\n if (\n events[index][0] === 'enter' &&\n events[index][1].type === 'strikethroughSequenceTemporary' &&\n events[index][1]._close\n ) {\n let open = index\n\n // Now walk back to find an opener.\n while (open--) {\n // Find a token that can open the closer.\n if (\n events[open][0] === 'exit' &&\n events[open][1].type === 'strikethroughSequenceTemporary' &&\n events[open][1]._open &&\n // If the sizes are the same:\n events[index][1].end.offset - events[index][1].start.offset ===\n events[open][1].end.offset - events[open][1].start.offset\n ) {\n events[index][1].type = 'strikethroughSequence'\n events[open][1].type = 'strikethroughSequence'\n\n /** @type {Token} */\n const strikethrough = {\n type: 'strikethrough',\n start: Object.assign({}, events[open][1].start),\n end: Object.assign({}, events[index][1].end)\n }\n\n /** @type {Token} */\n const text = {\n type: 'strikethroughText',\n start: Object.assign({}, events[open][1].end),\n end: Object.assign({}, events[index][1].start)\n }\n\n // Opening.\n /** @type {Array<Event>} */\n const nextEvents = [\n ['enter', strikethrough, context],\n ['enter', events[open][1], context],\n ['exit', events[open][1], context],\n ['enter', text, context]\n ]\n const insideSpan = context.parser.constructs.insideSpan.null\n if (insideSpan) {\n // Between.\n splice(\n nextEvents,\n nextEvents.length,\n 0,\n resolveAll(insideSpan, events.slice(open + 1, index), context)\n )\n }\n\n // Closing.\n splice(nextEvents, nextEvents.length, 0, [\n ['exit', text, context],\n ['enter', events[index][1], context],\n ['exit', events[index][1], context],\n ['exit', strikethrough, context]\n ])\n splice(events, open - 1, index - open + 3, nextEvents)\n index = open + nextEvents.length - 2\n break\n }\n }\n }\n }\n index = -1\n while (++index < events.length) {\n if (events[index][1].type === 'strikethroughSequenceTemporary') {\n events[index][1].type = 'data'\n }\n }\n return events\n }\n\n /**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\n function tokenizeStrikethrough(effects, ok, nok) {\n const previous = this.previous\n const events = this.events\n let size = 0\n return start\n\n /** @type {State} */\n function start(code) {\n if (\n previous === 126 &&\n events[events.length - 1][1].type !== 'characterEscape'\n ) {\n return nok(code)\n }\n effects.enter('strikethroughSequenceTemporary')\n return more(code)\n }\n\n /** @type {State} */\n function more(code) {\n const before = classifyCharacter(previous)\n if (code === 126) {\n // If this is the third marker, exit.\n if (size > 1) return nok(code)\n effects.consume(code)\n size++\n return more\n }\n if (size < 2 && !single) return nok(code)\n const token = effects.exit('strikethroughSequenceTemporary')\n const after = classifyCharacter(code)\n token._open = !after || (after === 2 && Boolean(before))\n token._close = !before || (before === 2 && Boolean(after))\n return ok(code)\n }\n }\n}\n"],"names":["gfmStrikethrough","options","single","singleTilde","tokenizer","tokenize","effects","ok","nok","previous","this","events","size","code","length","type","enter","more","before","classifyCharacter","consume","token","exit","after","_open","Boolean","_close","resolveAll","context","index","open","end","offset","start","strikethrough","Object","assign","text","nextEvents","insideSpan","parser","constructs","null","splice","slice","attentionMarkers"],"mappings":"2NA8BO,SAASA,EAAiBC,GAE/B,IAAIC,GADaD,GAAW,CAAE,GACRE,YACtB,MAAMC,EAAY,CAChBC,SA8GF,SAA+BC,EAASC,EAAIC,GAC1C,MAAMC,EAAWC,KAAKD,SAChBE,EAASD,KAAKC,OACpB,IAAIC,EAAO,EACX,OAGA,SAAeC,GACb,GACe,MAAbJ,GACsC,oBAAtCE,EAAOA,EAAOG,OAAS,GAAG,GAAGC,KAE7B,OAAOP,EAAIK,GAGb,OADAP,EAAQU,MAAM,kCACPC,EAAKJ,EACb,EAGD,SAASI,EAAKJ,GACZ,MAAMK,EAASC,EAAkBV,GACjC,GAAa,MAATI,EAEF,OAAID,EAAO,EAAUJ,EAAIK,IACzBP,EAAQc,QAAQP,GAChBD,IACOK,GAET,GAAIL,EAAO,IAAMV,EAAQ,OAAOM,EAAIK,GACpC,MAAMQ,EAAQf,EAAQgB,KAAK,kCACrBC,EAAQJ,EAAkBN,GAGhC,OAFAQ,EAAMG,OAASD,GAAoB,IAAVA,GAAeE,QAAQP,GAChDG,EAAMK,QAAUR,GAAsB,IAAXA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B,OAAQ,EAAG,CACvC,CAAC,OAAQuB,EAAMT,GACf,CAAC,QAASjB,EAAOkB,GAAO,GAAID,GAC5B,CAAC,OAAQjB,EAAOkB,GAAO,GAAID,GAC3B,CAAC,OAAQM,EAAeN,KAE1Be,EAAOhC,EAAQmB,EAAO,EAAGD,EAAQC,EAAO,EAAGQ,GAC3CT,EAAQC,EAAOQ,EAAWxB,OAAS,EACnC,KACD,CAEJ,CAEHe,GAAS,EACT,OAASA,EAAQlB,EAAOG,QACQ,mCAA1BH,EAAOkB,GAAO,GAAGd,OACnBJ,EAAOkB,GAAO,GAAGd,KAAO,QAG5B,OAAOJ,CACR,GAlGD,OAHIT,UACFA,GAAS,GAEJ,CACLmC,KAAM,CACJ,IAAOjC,GAETmC,WAAY,CACVG,KAAM,CAACtC,IAETyC,iBAAkB,CAChBH,KAAM,CAAC,MAoIb"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
class t{constructor(){this.map=[]}add(t,p,
|
|
1
|
+
class t{constructor(){this.map=[]}add(t,p,h){!function(t,p,h,s){let a=0;if(0===h&&0===s.length)return;for(;a<t.map.length;){if(t.map[a][0]===p)return t.map[a][1]+=h,void t.map[a][2].push(...s);a+=1}t.map.push([p,h,s])}(this,t,p,h)}consume(t){if(this.map.sort(((t,p)=>t[0]-p[0])),0===this.map.length)return;let p=this.map.length;const h=[];for(;p>0;)p-=1,h.push(t.slice(this.map[p][0]+this.map[p][1])),h.push(this.map[p][2]),t.length=this.map[p][0];h.push([...t]),t.length=0;let s=h.pop();for(;s;)t.push(...s),s=h.pop();this.map.length=0}}export{t as EditMap};
|
|
2
2
|
//# sourceMappingURL=edit-map.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"edit-map.js","sources":["../../../../node_modules/micromark-extension-gfm-table/lib/edit-map.js"],"sourcesContent":["/**\n * @
|
|
1
|
+
{"version":3,"file":"edit-map.js","sources":["../../../../node_modules/micromark-extension-gfm-table/lib/edit-map.js"],"sourcesContent":["/**\n * @typedef {import('micromark-util-types').Event} Event\n */\n\n// Port of `edit_map.rs` from `markdown-rs`.\n// This should move to `markdown-js` later.\n\n// Deal with several changes in events, batching them together.\n//\n// Preferably, changes should be kept to a minimum.\n// Sometimes, it’s needed to change the list of events, because parsing can be\n// messy, and it helps to expose a cleaner interface of events to the compiler\n// and other users.\n// It can also help to merge many adjacent similar events.\n// And, in other cases, it’s needed to parse subcontent: pass some events\n// through another tokenizer and inject the result.\n\n/**\n * @typedef {[number, number, Array<Event>]} Change\n * @typedef {[number, number, number]} Jump\n */\n\n/**\n * Tracks a bunch of edits.\n */\nexport class EditMap {\n /**\n * Create a new edit map.\n */\n constructor() {\n /**\n * Record of changes.\n *\n * @type {Array<Change>}\n */\n this.map = []\n }\n\n /**\n * Create an edit: a remove and/or add at a certain place.\n *\n * @param {number} index\n * @param {number} remove\n * @param {Array<Event>} add\n * @returns {void}\n */\n add(index, remove, add) {\n addImpl(this, index, remove, add)\n }\n\n // To do: not used here.\n // /**\n // * Create an edit: but insert `add` before existing additions.\n // *\n // * @param {number} index\n // * @param {number} remove\n // * @param {Array<Event>} add\n // * @returns {void}\n // */\n // addBefore(index, remove, add) {\n // addImpl(this, index, remove, add, true)\n // }\n\n /**\n * Done, change the events.\n *\n * @param {Array<Event>} events\n * @returns {void}\n */\n consume(events) {\n this.map.sort((a, b) => a[0] - b[0])\n\n /* c8 ignore next 3 -- `resolve` is never called without tables, so without edits. */\n if (this.map.length === 0) {\n return\n }\n\n // To do: if links are added in events, like they are in `markdown-rs`,\n // this is needed.\n // // Calculate jumps: where items in the current list move to.\n // /** @type {Array<Jump>} */\n // const jumps = []\n // let index = 0\n // let addAcc = 0\n // let removeAcc = 0\n // while (index < this.map.length) {\n // const [at, remove, add] = this.map[index]\n // removeAcc += remove\n // addAcc += add.length\n // jumps.push([at, removeAcc, addAcc])\n // index += 1\n // }\n //\n // . shiftLinks(events, jumps)\n\n let index = this.map.length\n /** @type {Array<Array<Event>>} */\n const vecs = []\n while (index > 0) {\n index -= 1\n vecs.push(events.slice(this.map[index][0] + this.map[index][1]))\n // eslint-disable-next-line unicorn/no-array-push-push\n vecs.push(this.map[index][2])\n\n // Truncate rest.\n events.length = this.map[index][0]\n }\n vecs.push([...events])\n events.length = 0\n let slice = vecs.pop()\n while (slice) {\n events.push(...slice)\n slice = vecs.pop()\n }\n\n // Truncate everything.\n this.map.length = 0\n }\n}\n\n/**\n * Create an edit.\n *\n * @param {EditMap} editMap\n * @param {number} at\n * @param {number} remove\n * @param {Array<Event>} add\n * @returns {void}\n */\nfunction addImpl(editMap, at, remove, add) {\n let index = 0\n\n /* c8 ignore next 3 -- `resolve` is never called without tables, so without edits. */\n if (remove === 0 && add.length === 0) {\n return\n }\n while (index < editMap.map.length) {\n if (editMap.map[index][0] === at) {\n editMap.map[index][1] += remove\n\n // To do: before not used.\n // if (before) {\n // add.push(...editMap.map[index][2])\n // editMap.map[index][2] = add\n // } else {\n editMap.map[index][2].push(...add)\n // }\n\n return\n }\n index += 1\n }\n editMap.map.push([at, remove, add])\n}\n\n// /**\n// * Shift `previous` and `next` links according to `jumps`.\n// *\n// * This fixes links in case there are events removed or added between them.\n// *\n// * @param {Array<Event>} events\n// * @param {Array<Jump>} jumps\n// */\n// function shiftLinks(events, jumps) {\n// let jumpIndex = 0\n// let index = 0\n// let add = 0\n// let rm = 0\n\n// while (index < events.length) {\n// const rmCurr = rm\n\n// while (jumpIndex < jumps.length && jumps[jumpIndex][0] <= index) {\n// add = jumps[jumpIndex][2]\n// rm = jumps[jumpIndex][1]\n// jumpIndex += 1\n// }\n\n// // Ignore items that will be removed.\n// if (rm > rmCurr) {\n// index += rm - rmCurr\n// } else {\n// console.log('to do: links?', add, rmCurr)\n// // ?\n// // if let Some(link) = &events[index].link {\n// // if let Some(next) = link.next {\n// // events[next].link.as_mut().unwrap().previous = Some(index + add - rm);\n// // while jumpIndex < jumps.len() && jumps[jumpIndex].0 <= next {\n// // add = jumps[jumpIndex].2;\n// // rm = jumps[jumpIndex].1;\n// // jumpIndex += 1;\n// // }\n// // events[index].link.as_mut().unwrap().next = Some(next + add - rm);\n// // index = next;\n// // continue;\n// // }\n// // }\n// index += 1\n// }\n// }\n// }\n"],"names":["EditMap","constructor","this","map","add","index","remove","editMap","at","length","push","addImpl","consume","events","sort","a","b","vecs","slice","pop"],"mappings":"AAyBO,MAAMA,EAIX,WAAAC,GAMEC,KAAKC,IAAM,EACZ,CAUD,GAAAC,CAAIC,EAAOC,EAAQF,IAmFrB,SAAiBG,EAASC,EAAIF,EAAQF,GACpC,IAAIC,EAAQ,EAGZ,GAAe,IAAXC,GAA+B,IAAfF,EAAIK,OACtB,OAEF,KAAOJ,EAAQE,EAAQJ,IAAIM,QAAQ,CACjC,GAAIF,EAAQJ,IAAIE,GAAO,KAAOG,EAW5B,OAVAD,EAAQJ,IAAIE,GAAO,IAAMC,OAOzBC,EAAQJ,IAAIE,GAAO,GAAGK,QAAQN,GAKhCC,GAAS,CACV,CACDE,EAAQJ,IAAIO,KAAK,CAACF,EAAIF,EAAQF,GAChC,CA1GIO,CAAQT,KAAMG,EAAOC,EAAQF,EAC9B,CAqBD,OAAAQ,CAAQC,GAIN,GAHAX,KAAKC,IAAIW,MAAK,CAACC,EAAGC,IAAMD,EAAE,GAAKC,EAAE,KAGT,IAApBd,KAAKC,IAAIM,OACX,OAqBF,IAAIJ,EAAQH,KAAKC,IAAIM,OAErB,MAAMQ,EAAO,GACb,KAAOZ,EAAQ,GACbA,GAAS,EACTY,EAAKP,KAAKG,EAAOK,MAAMhB,KAAKC,IAAIE,GAAO,GAAKH,KAAKC,IAAIE,GAAO,KAE5DY,EAAKP,KAAKR,KAAKC,IAAIE,GAAO,IAG1BQ,EAAOJ,OAASP,KAAKC,IAAIE,GAAO,GAElCY,EAAKP,KAAK,IAAIG,IACdA,EAAOJ,OAAS,EAChB,IAAIS,EAAQD,EAAKE,MACjB,KAAOD,GACLL,EAAOH,QAAQQ,GACfA,EAAQD,EAAKE,MAIfjB,KAAKC,IAAIM,OAAS,CACnB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"infer.js","sources":["../../../../node_modules/micromark-extension-gfm-table/lib/infer.js"],"sourcesContent":["/**\n * @
|
|
1
|
+
{"version":3,"file":"infer.js","sources":["../../../../node_modules/micromark-extension-gfm-table/lib/infer.js"],"sourcesContent":["/**\n * @typedef {import('micromark-util-types').Event} Event\n */\n\n/**\n * @typedef {'left' | 'center' | 'right' | 'none'} Align\n */\n\n/**\n * Figure out the alignment of a GFM table.\n *\n * @param {Array<Event>} events\n * @param {number} index\n * @returns {Array<Align>}\n */\nexport function gfmTableAlign(events, index) {\n let inDelimiterRow = false\n /** @type {Array<Align>} */\n const align = []\n while (index < events.length) {\n const event = events[index]\n if (inDelimiterRow) {\n if (event[0] === 'enter') {\n // Start of alignment value: set a new column.\n // To do: `markdown-rs` uses `tableDelimiterCellValue`.\n if (event[1].type === 'tableContent') {\n align.push(\n events[index + 1][1].type === 'tableDelimiterMarker'\n ? 'left'\n : 'none'\n )\n }\n }\n // Exits:\n // End of alignment value: change the column.\n // To do: `markdown-rs` uses `tableDelimiterCellValue`.\n else if (event[1].type === 'tableContent') {\n if (events[index - 1][1].type === 'tableDelimiterMarker') {\n const alignIndex = align.length - 1\n align[alignIndex] = align[alignIndex] === 'left' ? 'center' : 'right'\n }\n }\n // Done!\n else if (event[1].type === 'tableDelimiterRow') {\n break\n }\n } else if (event[0] === 'enter' && event[1].type === 'tableDelimiterRow') {\n inDelimiterRow = true\n }\n index += 1\n }\n return align\n}\n"],"names":["gfmTableAlign","events","index","inDelimiterRow","align","length","event","type","push","alignIndex"],"mappings":"AAeO,SAASA,EAAcC,EAAQC,GACpC,IAAIC,GAAiB,EAErB,MAAMC,EAAQ,GACd,KAAOF,EAAQD,EAAOI,QAAQ,CAC5B,MAAMC,EAAQL,EAAOC,GACrB,GAAIC,GACF,GAAiB,UAAbG,EAAM,GAGc,iBAAlBA,EAAM,GAAGC,MACXH,EAAMI,KAC0B,yBAA9BP,EAAOC,EAAQ,GAAG,GAAGK,KACjB,OACA,aAOL,GAAsB,iBAAlBD,EAAM,GAAGC,MAChB,GAAkC,yBAA9BN,EAAOC,EAAQ,GAAG,GAAGK,KAAiC,CACxD,MAAME,EAAaL,EAAMC,OAAS,EAClCD,EAAMK,GAAoC,SAAtBL,EAAMK,GAAyB,SAAW,OAC/D,OAGE,GAAsB,sBAAlBH,EAAM,GAAGC,KAChB,UAEoB,UAAbD,EAAM,IAAoC,sBAAlBA,EAAM,GAAGC,OAC1CJ,GAAiB,GAEnBD,GAAS,CACV,CACD,OAAOE,CACT"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{factorySpace as e}from"../../micromark-factory-space/index.js";import{markdownLineEnding as t,markdownSpace as n,markdownLineEndingOrSpace as i}from"
|
|
1
|
+
import{factorySpace as e}from"../../micromark-factory-space/index.js";import{markdownLineEnding as t,markdownSpace as n,markdownLineEndingOrSpace as i}from"../node_modules/micromark-util-character/index.js";import{EditMap as r}from"./edit-map.js";import{gfmTableAlign as l}from"./infer.js";const a={flow:{null:{tokenize:function(r,l,a){const o=this;let s,c=0,u=0;return function(e){let t=o.events.length-1;for(;t>-1;){const e=o.events[t][1].type;if("lineEnding"!==e&&"linePrefix"!==e)break;t--}const n=t>-1?o.events[t][1].type:null,i="tableHead"===n||"tableRow"===n?h:d;if(i===h&&o.parser.lazy[o.now().line])return a(e);return i(e)};function d(e){return r.enter("tableHead"),r.enter("tableRow"),function(e){if(124===e)return b(e);return s=!0,u+=1,b(e)}(e)}function b(i){return null===i?a(i):t(i)?u>1?(u=0,o.interrupt=!0,r.exit("tableRow"),r.enter("lineEnding"),r.consume(i),r.exit("lineEnding"),p):a(i):n(i)?e(r,b,"whitespace")(i):(u+=1,s&&(s=!1,c+=1),124===i?(r.enter("tableCellDivider"),r.consume(i),r.exit("tableCellDivider"),s=!0,b):(r.enter("data"),m(i)))}function m(e){return null===e||124===e||i(e)?(r.exit("data"),b(e)):(r.consume(e),92===e?f:m)}function f(e){return 92===e||124===e?(r.consume(e),m):m(e)}function p(t){return o.interrupt=!1,o.parser.lazy[o.now().line]?a(t):(r.enter("tableDelimiterRow"),s=!1,n(t)?e(r,v,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):v(t))}function v(e){return 45===e||58===e?x(e):124===e?(s=!0,r.enter("tableCellDivider"),r.consume(e),r.exit("tableCellDivider"),y):O(e)}function y(t){return n(t)?e(r,x,"whitespace")(t):x(t)}function x(e){return 58===e?(u+=1,s=!0,r.enter("tableDelimiterMarker"),r.consume(e),r.exit("tableDelimiterMarker"),D):45===e?(u+=1,D(e)):null===e||t(e)?j(e):O(e)}function D(e){return 45===e?(r.enter("tableDelimiterFiller"),g(e)):O(e)}function g(e){return 45===e?(r.consume(e),g):58===e?(s=!0,r.exit("tableDelimiterFiller"),r.enter("tableDelimiterMarker"),r.consume(e),r.exit("tableDelimiterMarker"),w):(r.exit("tableDelimiterFiller"),w(e))}function w(t){return n(t)?e(r,j,"whitespace")(t):j(t)}function j(e){return 124===e?v(e):(null===e||t(e))&&s&&c===u?(r.exit("tableDelimiterRow"),r.exit("tableHead"),l(e)):O(e)}function O(e){return a(e)}function h(e){return r.enter("tableRow"),R(e)}function R(i){return 124===i?(r.enter("tableCellDivider"),r.consume(i),r.exit("tableCellDivider"),R):null===i||t(i)?(r.exit("tableRow"),l(i)):n(i)?e(r,R,"whitespace")(i):(r.enter("data"),k(i))}function k(e){return null===e||124===e||i(e)?(r.exit("data"),R(e)):(r.consume(e),92===e?C:k)}function C(e){return 92===e||124===e?(r.consume(e),k):k(e)}},resolveAll:function(e,t){let n,i,a,c=-1,u=!0,d=0,b=[0,0,0,0],m=[0,0,0,0],f=!1,p=0;const v=new r;for(;++c<e.length;){const r=e[c],l=r[1];"enter"===r[0]?"tableHead"===l.type?(f=!1,0!==p&&(s(v,t,p,n,i),i=void 0,p=0),n={type:"table",start:Object.assign({},l.start),end:Object.assign({},l.end)},v.add(c,0,[["enter",n,t]])):"tableRow"===l.type||"tableDelimiterRow"===l.type?(u=!0,a=void 0,b=[0,0,0,0],m=[0,c+1,0,0],f&&(f=!1,i={type:"tableBody",start:Object.assign({},l.start),end:Object.assign({},l.end)},v.add(c,0,[["enter",i,t]])),d="tableDelimiterRow"===l.type?2:i?3:1):!d||"data"!==l.type&&"tableDelimiterMarker"!==l.type&&"tableDelimiterFiller"!==l.type?"tableCellDivider"===l.type&&(u?u=!1:(0!==b[1]&&(m[0]=m[1],a=o(v,t,b,d,void 0,a)),b=m,m=[b[1],c,0,0])):(u=!1,0===m[2]&&(0!==b[1]&&(m[0]=m[1],a=o(v,t,b,d,void 0,a),b=[0,0,0,0]),m[2]=c)):"tableHead"===l.type?(f=!0,p=c):"tableRow"===l.type||"tableDelimiterRow"===l.type?(p=c,0!==b[1]?(m[0]=m[1],a=o(v,t,b,d,c,a)):0!==m[1]&&(a=o(v,t,m,d,c,a)),d=0):!d||"data"!==l.type&&"tableDelimiterMarker"!==l.type&&"tableDelimiterFiller"!==l.type||(m[3]=c)}0!==p&&s(v,t,p,n,i);v.consume(t.events),c=-1;for(;++c<t.events.length;){const e=t.events[c];"enter"===e[0]&&"table"===e[1].type&&(e[1]._align=l(t.events,c))}return e}}}};function o(e,t,n,i,r,l){const a=1===i?"tableHeader":2===i?"tableDelimiter":"tableData";0!==n[0]&&(l.end=Object.assign({},c(t.events,n[0])),e.add(n[0],0,[["exit",l,t]]));const o=c(t.events,n[1]);if(l={type:a,start:Object.assign({},o),end:Object.assign({},o)},e.add(n[1],0,[["enter",l,t]]),0!==n[2]){const r=c(t.events,n[2]),l=c(t.events,n[3]),a={type:"tableContent",start:Object.assign({},r),end:Object.assign({},l)};if(e.add(n[2],0,[["enter",a,t]]),2!==i){const i=t.events[n[2]],r=t.events[n[3]];if(i[1].end=Object.assign({},r[1].end),i[1].type="chunkText",i[1].contentType="text",n[3]>n[2]+1){const t=n[2]+1,i=n[3]-n[2]-1;e.add(t,i,[])}}e.add(n[3]+1,0,[["exit",a,t]])}return void 0!==r&&(l.end=Object.assign({},c(t.events,r)),e.add(r,0,[["exit",l,t]]),l=void 0),l}function s(e,t,n,i,r){const l=[],a=c(t.events,n);r&&(r.end=Object.assign({},a),l.push(["exit",r,t])),i.end=Object.assign({},a),l.push(["exit",i,t]),e.add(n+1,0,l)}function c(e,t){const n=e[t],i="enter"===n[0]?"start":"end";return n[1][i]}export{a as gfmTable};
|
|
2
2
|
//# sourceMappingURL=syntax.js.map
|