markdown-flow-ui 0.3.5 → 0.3.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/index8.cjs +1 -1
- package/dist/_virtual/index8.es.js +2 -2
- package/dist/_virtual/index9.cjs +1 -1
- package/dist/_virtual/index9.es.js +2 -2
- package/dist/assets/markdown-flow-ui.css +1 -1
- package/dist/components/ContentRender/ContentRender.cjs +2 -2
- package/dist/components/ContentRender/ContentRender.cjs.map +1 -1
- package/dist/components/ContentRender/ContentRender.d.ts +2 -0
- package/dist/components/ContentRender/ContentRender.es.js +513 -509
- package/dist/components/ContentRender/ContentRender.es.js.map +1 -1
- package/dist/components/ContentRender/MarkdownFlowInput.cjs +1 -1
- package/dist/components/ContentRender/MarkdownFlowInput.cjs.map +1 -1
- package/dist/components/ContentRender/MarkdownFlowInput.d.ts +2 -0
- package/dist/components/ContentRender/MarkdownFlowInput.es.js +40 -38
- package/dist/components/ContentRender/MarkdownFlowInput.es.js.map +1 -1
- package/dist/components/ContentRender/plugins/CustomVariable.cjs +1 -1
- package/dist/components/ContentRender/plugins/CustomVariable.cjs.map +1 -1
- package/dist/components/ContentRender/plugins/CustomVariable.d.ts +2 -1
- package/dist/components/ContentRender/plugins/CustomVariable.es.js +110 -90
- package/dist/components/ContentRender/plugins/CustomVariable.es.js.map +1 -1
- package/dist/components/ContentRender/utils/accept-placeholder.cjs +2 -0
- package/dist/components/ContentRender/utils/accept-placeholder.cjs.map +1 -0
- package/dist/components/ContentRender/utils/accept-placeholder.d.ts +3 -0
- package/dist/components/ContentRender/utils/accept-placeholder.es.js +10 -0
- package/dist/components/ContentRender/utils/accept-placeholder.es.js.map +1 -0
- package/dist/components/MarkdownFlow/MarkdownFlow.cjs +1 -1
- package/dist/components/MarkdownFlow/MarkdownFlow.cjs.map +1 -1
- package/dist/components/MarkdownFlow/MarkdownFlow.d.ts +2 -0
- package/dist/components/MarkdownFlow/MarkdownFlow.es.js +23 -21
- package/dist/components/MarkdownFlow/MarkdownFlow.es.js.map +1 -1
- package/dist/components/MarkdownFlowEditor/plugins/SyntaxHighlighter.cjs +3 -3
- package/dist/components/MarkdownFlowEditor/plugins/SyntaxHighlighter.cjs.map +1 -1
- package/dist/components/MarkdownFlowEditor/plugins/SyntaxHighlighter.es.js +145 -143
- package/dist/components/MarkdownFlowEditor/plugins/SyntaxHighlighter.es.js.map +1 -1
- package/dist/components/Slide/Slide.cjs +1 -1
- package/dist/components/Slide/Slide.cjs.map +1 -1
- package/dist/components/Slide/Slide.d.ts +2 -0
- package/dist/components/Slide/Slide.es.js +348 -344
- package/dist/components/Slide/Slide.es.js.map +1 -1
- package/dist/markdown-flow-ui-lib.css +1 -1
- package/dist/markdown-flow-ui.css +1 -1
- package/dist/node_modules/@braintree/sanitize-url/dist/index.cjs +1 -1
- package/dist/node_modules/@braintree/sanitize-url/dist/index.es.js +1 -1
- package/dist/node_modules/@radix-ui/react-arrow/dist/index.cjs.map +1 -0
- package/dist/node_modules/@radix-ui/react-arrow/dist/index.es.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-focus-scope/dist/index.cjs +1 -1
- package/dist/node_modules/@radix-ui/react-focus-scope/dist/index.cjs.map +1 -1
- package/dist/node_modules/@radix-ui/react-focus-scope/dist/index.es.js +92 -89
- package/dist/node_modules/@radix-ui/react-focus-scope/dist/index.es.js.map +1 -1
- package/dist/node_modules/@radix-ui/react-popper/dist/index.cjs +2 -0
- package/dist/node_modules/@radix-ui/react-popper/dist/index.cjs.map +1 -0
- package/dist/node_modules/@radix-ui/{react-tooltip/node_modules/@radix-ui/react-popper → react-popper}/dist/index.es.js +5 -5
- package/dist/node_modules/@radix-ui/react-popper/dist/index.es.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-slot/dist/index.cjs +1 -1
- package/dist/node_modules/@radix-ui/react-slot/dist/index.cjs.map +1 -1
- package/dist/node_modules/@radix-ui/react-slot/dist/index.es.js +50 -47
- package/dist/node_modules/@radix-ui/react-slot/dist/index.es.js.map +1 -1
- package/dist/node_modules/@radix-ui/react-tooltip/dist/index.cjs +1 -1
- package/dist/node_modules/@radix-ui/react-tooltip/dist/index.cjs.map +1 -1
- package/dist/node_modules/@radix-ui/react-tooltip/dist/index.es.js +9 -9
- package/dist/node_modules/@radix-ui/react-use-callback-ref/dist/index.cjs +1 -1
- package/dist/node_modules/@radix-ui/react-use-callback-ref/dist/index.cjs.map +1 -1
- package/dist/node_modules/@radix-ui/react-use-callback-ref/dist/index.es.js +10 -7
- package/dist/node_modules/@radix-ui/react-use-callback-ref/dist/index.es.js.map +1 -1
- package/dist/node_modules/@radix-ui/react-visually-hidden/dist/index.cjs +1 -1
- package/dist/node_modules/@radix-ui/react-visually-hidden/dist/index.cjs.map +1 -1
- package/dist/node_modules/@radix-ui/react-visually-hidden/dist/index.es.js +1 -1
- package/dist/node_modules/classnames/index.cjs +1 -1
- package/dist/node_modules/classnames/index.es.js +1 -1
- package/dist/node_modules/i18next/dist/esm/i18next.cjs +1 -1
- package/dist/node_modules/i18next/dist/esm/i18next.cjs.map +1 -1
- package/dist/node_modules/i18next/dist/esm/i18next.es.js +809 -900
- package/dist/node_modules/i18next/dist/esm/i18next.es.js.map +1 -1
- package/dist/node_modules/katex/dist/katex.cjs +14 -14
- package/dist/node_modules/katex/dist/katex.cjs.map +1 -1
- package/dist/node_modules/katex/dist/katex.es.js +1302 -1192
- package/dist/node_modules/katex/dist/katex.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/Icon.cjs +1 -1
- package/dist/node_modules/lucide-react/dist/esm/Icon.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/Icon.es.js +52 -29
- package/dist/node_modules/lucide-react/dist/esm/Icon.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/context.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/context.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/context.es.js +6 -0
- package/dist/node_modules/lucide-react/dist/esm/context.es.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/createLucideIcon.cjs +1 -1
- package/dist/node_modules/lucide-react/dist/esm/createLucideIcon.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/createLucideIcon.es.js +13 -16
- package/dist/node_modules/lucide-react/dist/esm/createLucideIcon.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/captions-off.cjs +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/captions-off.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/captions-off.es.js +16 -10
- package/dist/node_modules/lucide-react/dist/esm/icons/captions-off.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/captions.cjs +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/captions.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/captions.es.js +13 -6
- package/dist/node_modules/lucide-react/dist/esm/icons/captions.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/check.cjs +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/check.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/check.es.js +8 -2
- package/dist/node_modules/lucide-react/dist/esm/icons/check.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/chevron-left.cjs +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/chevron-left.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/chevron-left.es.js +10 -4
- package/dist/node_modules/lucide-react/dist/esm/icons/chevron-left.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/chevrons-down.cjs +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/chevrons-down.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/chevrons-down.es.js +12 -6
- package/dist/node_modules/lucide-react/dist/esm/icons/chevrons-down.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/circle-check.cjs +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/circle-check.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/circle-check.es.js +14 -7
- package/dist/node_modules/lucide-react/dist/esm/icons/circle-check.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/copy.cjs +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/copy.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/copy.es.js +11 -5
- package/dist/node_modules/lucide-react/dist/esm/icons/copy.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/ellipsis-vertical.cjs +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/ellipsis-vertical.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/ellipsis-vertical.es.js +13 -6
- package/dist/node_modules/lucide-react/dist/esm/icons/ellipsis-vertical.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/fast-forward.cjs +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/fast-forward.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/fast-forward.es.js +22 -7
- package/dist/node_modules/lucide-react/dist/esm/icons/fast-forward.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/file-type.cjs +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/file-type.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/file-type.es.js +20 -8
- package/dist/node_modules/lucide-react/dist/esm/icons/file-type.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/grip-horizontal.cjs +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/grip-horizontal.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/grip-horizontal.es.js +17 -11
- package/dist/node_modules/lucide-react/dist/esm/icons/grip-horizontal.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/image.cjs +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/image.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/image.es.js +14 -8
- package/dist/node_modules/lucide-react/dist/esm/icons/image.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/loader-circle.cjs +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/loader-circle.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/loader-circle.es.js +11 -4
- package/dist/node_modules/lucide-react/dist/esm/icons/loader-circle.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/maximize.cjs +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/maximize.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/maximize.es.js +15 -9
- package/dist/node_modules/lucide-react/dist/esm/icons/maximize.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/rewind.cjs +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/rewind.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/rewind.es.js +25 -7
- package/dist/node_modules/lucide-react/dist/esm/icons/rewind.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/scan-line.cjs +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/scan-line.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/scan-line.es.js +16 -10
- package/dist/node_modules/lucide-react/dist/esm/icons/scan-line.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/skip-back.cjs +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/skip-back.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/skip-back.es.js +19 -7
- package/dist/node_modules/lucide-react/dist/esm/icons/skip-back.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/skip-forward.cjs +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/skip-forward.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/skip-forward.es.js +19 -7
- package/dist/node_modules/lucide-react/dist/esm/icons/skip-forward.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/square-check.cjs +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/square-check.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/square-check.es.js +14 -7
- package/dist/node_modules/lucide-react/dist/esm/icons/square-check.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/square-play.cjs +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/square-play.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/square-play.es.js +19 -6
- package/dist/node_modules/lucide-react/dist/esm/icons/square-play.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/text-cursor-input.cjs +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/text-cursor-input.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/text-cursor-input.es.js +15 -9
- package/dist/node_modules/lucide-react/dist/esm/icons/text-cursor-input.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/upload.cjs +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/upload.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/upload.es.js +13 -7
- package/dist/node_modules/lucide-react/dist/esm/icons/upload.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/volume-2.cjs +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/volume-2.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/volume-2.es.js +19 -13
- package/dist/node_modules/lucide-react/dist/esm/icons/volume-2.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/x.cjs +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/x.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/x.es.js +13 -7
- package/dist/node_modules/lucide-react/dist/esm/icons/x.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/shared/src/build/buildLucideIconForReact.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/build/buildLucideIconForReact.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/build/buildLucideIconForReact.es.js +18 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/build/buildLucideIconForReact.es.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/build/buildLucideIconNode.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/build/buildLucideIconNode.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/build/buildLucideIconNode.es.js +44 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/build/buildLucideIconNode.es.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/build/defaultAttributes.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/build/defaultAttributes.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/{defaultAttributes.es.js → shared/src/build/defaultAttributes.es.js} +4 -4
- package/dist/node_modules/lucide-react/dist/esm/shared/src/build/defaultAttributes.es.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/hasA11yProp.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/hasA11yProp.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/hasA11yProp.es.js +10 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/hasA11yProp.es.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/mergeClasses.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/mergeClasses.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/mergeClasses.es.js +5 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/mergeClasses.es.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/toCamelCase.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/toCamelCase.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/toCamelCase.es.js +15 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/toCamelCase.es.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/toKebabCase.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/toKebabCase.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/toKebabCase.es.js +5 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/toKebabCase.es.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/toLucideIconData.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/toLucideIconData.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/toLucideIconData.es.js +15 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/toLucideIconData.es.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/toPascalCase.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/toPascalCase.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/toPascalCase.es.js +9 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/toPascalCase.es.js.map +1 -0
- package/dist/node_modules/micromark/lib/create-tokenizer.cjs +3 -3
- package/dist/node_modules/micromark/lib/create-tokenizer.cjs.map +1 -1
- package/dist/node_modules/micromark/lib/create-tokenizer.es.js +78 -76
- package/dist/node_modules/micromark/lib/create-tokenizer.es.js.map +1 -1
- package/dist/node_modules/micromark/lib/initialize/document.cjs +1 -1
- package/dist/node_modules/micromark/lib/initialize/document.cjs.map +1 -1
- package/dist/node_modules/micromark/lib/initialize/document.es.js +77 -75
- package/dist/node_modules/micromark/lib/initialize/document.es.js.map +1 -1
- package/dist/node_modules/micromark/lib/initialize/text.cjs +1 -1
- package/dist/node_modules/micromark/lib/initialize/text.cjs.map +1 -1
- package/dist/node_modules/micromark/lib/initialize/text.es.js +67 -64
- package/dist/node_modules/micromark/lib/initialize/text.es.js.map +1 -1
- package/dist/node_modules/micromark/lib/preprocess.cjs +1 -1
- package/dist/node_modules/micromark/lib/preprocess.cjs.map +1 -1
- package/dist/node_modules/micromark/lib/preprocess.es.js +19 -14
- package/dist/node_modules/micromark/lib/preprocess.es.js.map +1 -1
- package/dist/node_modules/micromark-core-commonmark/lib/attention.cjs +1 -1
- package/dist/node_modules/micromark-core-commonmark/lib/attention.cjs.map +1 -1
- package/dist/node_modules/micromark-core-commonmark/lib/attention.es.js +36 -32
- package/dist/node_modules/micromark-core-commonmark/lib/attention.es.js.map +1 -1
- package/dist/node_modules/micromark-core-commonmark/lib/code-fenced.cjs +1 -1
- package/dist/node_modules/micromark-core-commonmark/lib/code-fenced.cjs.map +1 -1
- package/dist/node_modules/micromark-core-commonmark/lib/code-fenced.es.js +49 -61
- package/dist/node_modules/micromark-core-commonmark/lib/code-fenced.es.js.map +1 -1
- package/dist/node_modules/micromark-core-commonmark/lib/code-indented.cjs +1 -1
- package/dist/node_modules/micromark-core-commonmark/lib/code-indented.cjs.map +1 -1
- package/dist/node_modules/micromark-core-commonmark/lib/code-indented.es.js +21 -27
- package/dist/node_modules/micromark-core-commonmark/lib/code-indented.es.js.map +1 -1
- package/dist/node_modules/micromark-core-commonmark/lib/heading-atx.cjs +1 -1
- package/dist/node_modules/micromark-core-commonmark/lib/heading-atx.cjs.map +1 -1
- package/dist/node_modules/micromark-core-commonmark/lib/heading-atx.es.js +18 -14
- package/dist/node_modules/micromark-core-commonmark/lib/heading-atx.es.js.map +1 -1
- package/dist/node_modules/micromark-core-commonmark/lib/html-flow.cjs +1 -1
- package/dist/node_modules/micromark-core-commonmark/lib/html-flow.cjs.map +1 -1
- package/dist/node_modules/micromark-core-commonmark/lib/html-flow.es.js +59 -71
- package/dist/node_modules/micromark-core-commonmark/lib/html-flow.es.js.map +1 -1
- package/dist/node_modules/micromark-core-commonmark/lib/label-end.cjs +1 -1
- package/dist/node_modules/micromark-core-commonmark/lib/label-end.cjs.map +1 -1
- package/dist/node_modules/micromark-core-commonmark/lib/label-end.es.js +87 -85
- package/dist/node_modules/micromark-core-commonmark/lib/label-end.es.js.map +1 -1
- package/dist/node_modules/micromark-core-commonmark/lib/label-start-image.cjs +1 -1
- package/dist/node_modules/micromark-core-commonmark/lib/label-start-image.cjs.map +1 -1
- package/dist/node_modules/micromark-core-commonmark/lib/label-start-image.es.js +11 -10
- package/dist/node_modules/micromark-core-commonmark/lib/label-start-image.es.js.map +1 -1
- package/dist/node_modules/micromark-core-commonmark/lib/label-start-link.cjs +1 -1
- package/dist/node_modules/micromark-core-commonmark/lib/label-start-link.cjs.map +1 -1
- package/dist/node_modules/micromark-core-commonmark/lib/label-start-link.es.js +12 -11
- package/dist/node_modules/micromark-core-commonmark/lib/label-start-link.es.js.map +1 -1
- package/dist/node_modules/micromark-core-commonmark/lib/partial-non-lazy-continuation.cjs +2 -0
- package/dist/node_modules/micromark-core-commonmark/lib/partial-non-lazy-continuation.cjs.map +1 -0
- package/dist/node_modules/micromark-core-commonmark/lib/partial-non-lazy-continuation.es.js +18 -0
- package/dist/node_modules/micromark-core-commonmark/lib/partial-non-lazy-continuation.es.js.map +1 -0
- package/dist/node_modules/micromark-core-commonmark/lib/setext-underline.cjs +1 -1
- package/dist/node_modules/micromark-core-commonmark/lib/setext-underline.cjs.map +1 -1
- package/dist/node_modules/micromark-core-commonmark/lib/setext-underline.es.js +35 -33
- package/dist/node_modules/micromark-core-commonmark/lib/setext-underline.es.js.map +1 -1
- package/dist/node_modules/micromark-extension-gfm-table/lib/edit-map.cjs +1 -1
- package/dist/node_modules/micromark-extension-gfm-table/lib/edit-map.cjs.map +1 -1
- package/dist/node_modules/micromark-extension-gfm-table/lib/edit-map.es.js +32 -28
- package/dist/node_modules/micromark-extension-gfm-table/lib/edit-map.es.js.map +1 -1
- package/dist/node_modules/micromark-extension-gfm-table/lib/syntax.cjs +1 -1
- package/dist/node_modules/micromark-extension-gfm-table/lib/syntax.cjs.map +1 -1
- package/dist/node_modules/micromark-extension-gfm-table/lib/syntax.es.js +18 -14
- package/dist/node_modules/micromark-extension-gfm-table/lib/syntax.es.js.map +1 -1
- package/dist/node_modules/micromark-factory-space/index.cjs +1 -1
- package/dist/node_modules/micromark-factory-space/index.cjs.map +1 -1
- package/dist/node_modules/micromark-factory-space/index.es.js +24 -10
- package/dist/node_modules/micromark-factory-space/index.es.js.map +1 -1
- package/dist/node_modules/micromark-util-edit-map/index.cjs +2 -0
- package/dist/node_modules/micromark-util-edit-map/index.cjs.map +1 -0
- package/dist/node_modules/micromark-util-edit-map/index.es.js +83 -0
- package/dist/node_modules/micromark-util-edit-map/index.es.js.map +1 -0
- package/package.json +24 -17
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/primitive/dist/index.cjs +0 -2
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/primitive/dist/index.cjs.map +0 -1
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/primitive/dist/index.es.js +0 -50
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/primitive/dist/index.es.js.map +0 -1
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-arrow/dist/index.cjs.map +0 -1
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-arrow/dist/index.es.js.map +0 -1
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-context/dist/index.cjs +0 -2
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-context/dist/index.cjs.map +0 -1
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-context/dist/index.es.js +0 -82
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-context/dist/index.es.js.map +0 -1
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-dismissable-layer/dist/index.cjs +0 -2
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-dismissable-layer/dist/index.cjs.map +0 -1
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-dismissable-layer/dist/index.es.js +0 -216
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-dismissable-layer/dist/index.es.js.map +0 -1
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-focus-scope/dist/index.cjs +0 -2
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-focus-scope/dist/index.cjs.map +0 -1
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-focus-scope/dist/index.es.js +0 -105
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-focus-scope/dist/index.es.js.map +0 -1
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-popper/dist/index.cjs +0 -2
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-popper/dist/index.cjs.map +0 -1
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-popper/dist/index.es.js.map +0 -1
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-portal/dist/index.cjs +0 -2
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-portal/dist/index.cjs.map +0 -1
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-portal/dist/index.es.js +0 -18
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-portal/dist/index.es.js.map +0 -1
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-primitive/dist/index.cjs +0 -2
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-primitive/dist/index.cjs.map +0 -1
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-primitive/dist/index.es.js +0 -39
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-primitive/dist/index.es.js.map +0 -1
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-slot/dist/index.cjs +0 -2
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-slot/dist/index.cjs.map +0 -1
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-slot/dist/index.es.js +0 -99
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-slot/dist/index.es.js.map +0 -1
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-use-callback-ref/dist/index.cjs +0 -2
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-use-callback-ref/dist/index.cjs.map +0 -1
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-use-callback-ref/dist/index.es.js +0 -16
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-use-callback-ref/dist/index.es.js.map +0 -1
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-use-controllable-state/dist/index.cjs +0 -2
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-use-controllable-state/dist/index.cjs.map +0 -1
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-use-controllable-state/dist/index.es.js +0 -70
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-use-controllable-state/dist/index.es.js.map +0 -1
- package/dist/node_modules/@radix-ui/react-visually-hidden/node_modules/@radix-ui/react-primitive/dist/index.cjs +0 -2
- package/dist/node_modules/@radix-ui/react-visually-hidden/node_modules/@radix-ui/react-primitive/dist/index.cjs.map +0 -1
- package/dist/node_modules/@radix-ui/react-visually-hidden/node_modules/@radix-ui/react-primitive/dist/index.es.js +0 -39
- package/dist/node_modules/@radix-ui/react-visually-hidden/node_modules/@radix-ui/react-primitive/dist/index.es.js.map +0 -1
- package/dist/node_modules/@radix-ui/react-visually-hidden/node_modules/@radix-ui/react-slot/dist/index.cjs +0 -2
- package/dist/node_modules/@radix-ui/react-visually-hidden/node_modules/@radix-ui/react-slot/dist/index.cjs.map +0 -1
- package/dist/node_modules/@radix-ui/react-visually-hidden/node_modules/@radix-ui/react-slot/dist/index.es.js +0 -99
- package/dist/node_modules/@radix-ui/react-visually-hidden/node_modules/@radix-ui/react-slot/dist/index.es.js.map +0 -1
- package/dist/node_modules/lucide-react/dist/esm/defaultAttributes.cjs +0 -2
- package/dist/node_modules/lucide-react/dist/esm/defaultAttributes.cjs.map +0 -1
- package/dist/node_modules/lucide-react/dist/esm/defaultAttributes.es.js.map +0 -1
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils.cjs +0 -2
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils.cjs.map +0 -1
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils.es.js +0 -19
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils.es.js.map +0 -1
- /package/dist/node_modules/@radix-ui/{react-tooltip/node_modules/@radix-ui/react-arrow → react-arrow}/dist/index.cjs +0 -0
- /package/dist/node_modules/@radix-ui/{react-tooltip/node_modules/@radix-ui/react-arrow → react-arrow}/dist/index.es.js +0 -0
|
@@ -1,25 +1,30 @@
|
|
|
1
|
-
const
|
|
1
|
+
const f = /[\0\t\n\r]/g;
|
|
2
2
|
function x() {
|
|
3
|
-
let s = 1, c = "",
|
|
4
|
-
return
|
|
5
|
-
function
|
|
3
|
+
let s = 1, c = "", d = !0, i;
|
|
4
|
+
return u;
|
|
5
|
+
function u(e, p, a) {
|
|
6
|
+
e = c + (typeof e == "string" ? e.toString() : new TextDecoder(p || void 0).decode(e));
|
|
6
7
|
const t = [];
|
|
7
|
-
let
|
|
8
|
-
for (
|
|
9
|
-
|
|
8
|
+
let n = 0;
|
|
9
|
+
for (c = "", d && (e.charCodeAt(0) === 65279 && n++, d = void 0); n < e.length; ) {
|
|
10
|
+
f.lastIndex = n;
|
|
11
|
+
const o = f.exec(e), r = o && o.index !== void 0 ? o.index : e.length, h = e.charCodeAt(r);
|
|
12
|
+
if (!o) {
|
|
10
13
|
c = e.slice(n);
|
|
11
14
|
break;
|
|
12
15
|
}
|
|
13
|
-
if (h === 10 && n ===
|
|
14
|
-
t.push(-3),
|
|
16
|
+
if (h === 10 && n === r && i)
|
|
17
|
+
t.push(-3), i = void 0;
|
|
15
18
|
else
|
|
16
|
-
switch (
|
|
19
|
+
switch (i && (t.push(-5), i = void 0), n < r && (t.push(e.slice(n, r)), s += r - n), h) {
|
|
17
20
|
case 0: {
|
|
18
21
|
t.push(65533), s++;
|
|
19
22
|
break;
|
|
20
23
|
}
|
|
21
24
|
case 9: {
|
|
22
|
-
|
|
25
|
+
const l = Math.ceil(s / 4) * 4;
|
|
26
|
+
for (t.push(-2); s++ < l; )
|
|
27
|
+
t.push(-1);
|
|
23
28
|
break;
|
|
24
29
|
}
|
|
25
30
|
case 10: {
|
|
@@ -27,11 +32,11 @@ function x() {
|
|
|
27
32
|
break;
|
|
28
33
|
}
|
|
29
34
|
default:
|
|
30
|
-
|
|
35
|
+
i = !0, s = 1;
|
|
31
36
|
}
|
|
32
|
-
n =
|
|
37
|
+
n = r + 1;
|
|
33
38
|
}
|
|
34
|
-
return a && (
|
|
39
|
+
return a && (i && t.push(-5), c && t.push(c), t.push(null)), t;
|
|
35
40
|
}
|
|
36
41
|
}
|
|
37
42
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preprocess.es.js","sources":["../../../../node_modules/micromark/lib/preprocess.js"],"sourcesContent":["/**\n * @import {Chunk, Code, Encoding, Value} from 'micromark-util-types'\n */\n\n/**\n * @callback Preprocessor\n * Preprocess a value.\n * @param {Value} value\n * Value.\n * @param {Encoding | null | undefined} [encoding]\n * Encoding when `value` is a typed array (optional).\n * @param {boolean | null | undefined} [end=false]\n * Whether this is the last chunk (default: `false`).\n * @returns {Array<Chunk>}\n * Chunks.\n */\n\nconst search = /[\\0\\t\\n\\r]/g;\n\n/**\n * @returns {Preprocessor}\n * Preprocess a value.\n */\nexport function preprocess() {\n let column = 1;\n let buffer = '';\n /** @type {boolean | undefined} */\n let start = true;\n /** @type {boolean | undefined} */\n let atCarriageReturn;\n return preprocessor;\n\n /** @type {Preprocessor} */\n // eslint-disable-next-line complexity\n function preprocessor(value, encoding, end) {\n
|
|
1
|
+
{"version":3,"file":"preprocess.es.js","sources":["../../../../node_modules/micromark/lib/preprocess.js"],"sourcesContent":["/**\n * @import {Chunk, Code, Encoding, Value} from 'micromark-util-types'\n */\n\n/**\n * @callback Preprocessor\n * Preprocess a value.\n * @param {Value} value\n * Value.\n * @param {Encoding | null | undefined} [encoding]\n * Encoding when `value` is a typed array (optional).\n * @param {boolean | null | undefined} [end=false]\n * Whether this is the last chunk (default: `false`).\n * @returns {Array<Chunk>}\n * Chunks.\n */\n\nconst search = /[\\0\\t\\n\\r]/g;\n\n/**\n * @returns {Preprocessor}\n * Preprocess a value.\n */\nexport function preprocess() {\n let column = 1;\n let buffer = '';\n /** @type {boolean | undefined} */\n let start = true;\n /** @type {boolean | undefined} */\n let atCarriageReturn;\n return preprocessor;\n\n /** @type {Preprocessor} */\n // eslint-disable-next-line complexity\n function preprocessor(value, encoding, end) {\n value = buffer + (typeof value === 'string' ? value.toString() : new TextDecoder(encoding || undefined).decode(value));\n\n /** @type {Array<Chunk>} */\n const chunks = [];\n let startPosition = 0;\n buffer = '';\n if (start) {\n // To do: `markdown-rs` actually parses BOMs (byte order mark).\n if (value.charCodeAt(0) === 65279) {\n startPosition++;\n }\n start = undefined;\n }\n while (startPosition < value.length) {\n search.lastIndex = startPosition;\n const match = search.exec(value);\n const endPosition = match && match.index !== undefined ? match.index : value.length;\n const code = value.charCodeAt(endPosition);\n if (!match) {\n buffer = value.slice(startPosition);\n break;\n }\n if (code === 10 && startPosition === endPosition && atCarriageReturn) {\n chunks.push(-3);\n atCarriageReturn = undefined;\n } else {\n if (atCarriageReturn) {\n chunks.push(-5);\n atCarriageReturn = undefined;\n }\n if (startPosition < endPosition) {\n chunks.push(value.slice(startPosition, endPosition));\n column += endPosition - startPosition;\n }\n switch (code) {\n case 0:\n {\n chunks.push(65533);\n column++;\n break;\n }\n case 9:\n {\n const next = Math.ceil(column / 4) * 4;\n chunks.push(-2);\n while (column++ < next) {\n chunks.push(-1);\n }\n break;\n }\n case 10:\n {\n chunks.push(-4);\n column = 1;\n break;\n }\n default:\n {\n atCarriageReturn = true;\n column = 1;\n }\n }\n }\n startPosition = endPosition + 1;\n }\n if (end) {\n if (atCarriageReturn) {\n chunks.push(-5);\n }\n if (buffer) {\n chunks.push(buffer);\n }\n chunks.push(null);\n }\n return chunks;\n }\n}"],"names":["search","preprocess","column","buffer","start","atCarriageReturn","preprocessor","value","encoding","end","chunks","startPosition","match","endPosition","code","next"],"mappings":"AAiBA,MAAMA,IAAS;AAMR,SAASC,IAAa;AAC3B,MAAIC,IAAS,GACTC,IAAS,IAETC,IAAQ,IAERC;AACJ,SAAOC;AAIP,WAASA,EAAaC,GAAOC,GAAUC,GAAK;AAC1C,IAAAF,IAAQJ,KAAU,OAAOI,KAAU,WAAWA,EAAM,SAAQ,IAAK,IAAI,YAAYC,KAAY,MAAS,EAAE,OAAOD,CAAK;AAGpH,UAAMG,IAAS,CAAA;AACf,QAAIC,IAAgB;AASpB,SARAR,IAAS,IACLC,MAEEG,EAAM,WAAW,CAAC,MAAM,SAC1BI,KAEFP,IAAQ,SAEHO,IAAgBJ,EAAM,UAAQ;AACnC,MAAAP,EAAO,YAAYW;AACnB,YAAMC,IAAQZ,EAAO,KAAKO,CAAK,GACzBM,IAAcD,KAASA,EAAM,UAAU,SAAYA,EAAM,QAAQL,EAAM,QACvEO,IAAOP,EAAM,WAAWM,CAAW;AACzC,UAAI,CAACD,GAAO;AACV,QAAAT,IAASI,EAAM,MAAMI,CAAa;AAClC;AAAA,MACF;AACA,UAAIG,MAAS,MAAMH,MAAkBE,KAAeR;AAClD,QAAAK,EAAO,KAAK,EAAE,GACdL,IAAmB;AAAA;AAUnB,gBARIA,MACFK,EAAO,KAAK,EAAE,GACdL,IAAmB,SAEjBM,IAAgBE,MAClBH,EAAO,KAAKH,EAAM,MAAMI,GAAeE,CAAW,CAAC,GACnDX,KAAUW,IAAcF,IAElBG,GAAI;AAAA,UACV,KAAK,GACH;AACE,YAAAJ,EAAO,KAAK,KAAK,GACjBR;AACA;AAAA,UACF;AAAA,UACF,KAAK,GACH;AACE,kBAAMa,IAAO,KAAK,KAAKb,IAAS,CAAC,IAAI;AAErC,iBADAQ,EAAO,KAAK,EAAE,GACPR,MAAWa;AAChB,cAAAL,EAAO,KAAK,EAAE;AAEhB;AAAA,UACF;AAAA,UACF,KAAK,IACH;AACE,YAAAA,EAAO,KAAK,EAAE,GACdR,IAAS;AACT;AAAA,UACF;AAAA,UACF;AAEI,YAAAG,IAAmB,IACnBH,IAAS;AAAA,QAEvB;AAEM,MAAAS,IAAgBE,IAAc;AAAA,IAChC;AACA,WAAIJ,MACEJ,KACFK,EAAO,KAAK,EAAE,GAEZP,KACFO,EAAO,KAAKP,CAAM,GAEpBO,EAAO,KAAK,IAAI,IAEXA;AAAA,EACT;AACF;","x_google_ignoreList":[0]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("../../micromark-util-chunked/index.cjs"),h=require("../../micromark-util-classify-character/index.cjs"),q=require("../../micromark-util-resolve-all/index.cjs"),g={name:"attention",resolveAll:y,tokenize:m};function y(t,n){let e=-1,i;for(;++e<t.length;)if(t[e][0]==="enter"&&t[e][1].type==="attentionSequence"&&t[e][1]._close){let r=e;for(;r--;)if(t[r][0]==="exit"&&t[r][1].type==="attentionSequence"&&t[r][1]._open&&n.sliceSerialize(t[r][1]).charCodeAt(0)===n.sliceSerialize(t[e][1]).charCodeAt(0)){if((t[r][1]._close||t[e][1]._open)&&(t[e][1].end.offset-t[e][1].start.offset)%3&&!((t[r][1].end.offset-t[r][1].start.offset+t[e][1].end.offset-t[e][1].start.offset)%3))continue;const s=t[r][1].end.offset-t[r][1].start.offset>1&&t[e][1].end.offset-t[e][1].start.offset>1?2:1,d={...t[r][1].end},p={...t[e][1].start};S(d,-s),S(p,s);const o={type:s>1?"strongSequence":"emphasisSequence",start:d,end:{...t[r][1].end}},a={type:s>1?"strongSequence":"emphasisSequence",start:{...t[e][1].start},end:p},u={type:s>1?"strongText":"emphasisText",start:{...t[r][1].end},end:{...t[e][1].start}},l={type:s>1?"strong":"emphasis",start:{...o.start},end:{...a.end}};t[r][1].end={...o.start},t[e][1].start={...a.end},i=[],t[r][1].end.offset-t[r][1].start.offset&&(i=c.push(i,[["enter",t[r][1],n],["exit",t[r][1],n]])),i=c.push(i,[["enter",l,n],["enter",o,n],["exit",o,n],["enter",u,n]]),i=c.push(i,q.resolveAll(n.parser.constructs.insideSpan.null,t.slice(r+1,e),n)),i=c.push(i,[["exit",u,n],["enter",a,n],["exit",a,n],["exit",l,n]]);let f=0;t[e][1].end.offset-t[e][1].start.offset&&(f=2,i=c.push(i,[["enter",t[e][1],n],["exit",t[e][1],n]])),c.splice(t,r-1,e-r+3,i),e=r+i.length-f-2;break}}for(e=-1;++e<t.length;)t[e][1].type==="attentionSequence"&&(t[e][1].type="data");return t}function m(t,n){const e=this.parser.constructs.attentionMarkers.null,i=this.previous,r=h.classifyCharacter(i);let s;return d;function d(o){return s=o,t.enter("attentionSequence"),p(o)}function p(o){if(o===s)return t.consume(o),p;const a=t.exit("attentionSequence"),u=h.classifyCharacter(o),l=!u||u===2&&r||e.includes(o)&&o!==42&&o!==95,f=!r||r===2&&u||e.includes(i)&&i!==42&&i!==95;return a._open=!!(s===42?l:l&&(r||!f)),a._close=!!(s===42?f:f&&(u||!l)),n(o)}}function S(t,n){t.column+=n,t.offset+=n,t._bufferIndex+=n}exports.attention=g;
|
|
2
2
|
//# sourceMappingURL=attention.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attention.cjs","sources":["../../../../node_modules/micromark-core-commonmark/lib/attention.js"],"sourcesContent":["/**\n * @import {\n * Code,\n * Construct,\n * Event,\n * Point,\n * Resolver,\n * State,\n * TokenizeContext,\n * Tokenizer,\n * Token\n * } from 'micromark-util-types'\n */\n\nimport { push, splice } from 'micromark-util-chunked';\nimport { classifyCharacter } from 'micromark-util-classify-character';\nimport { resolveAll } from 'micromark-util-resolve-all';\n/** @type {Construct} */\nexport const attention = {\n name: 'attention',\n resolveAll: resolveAllAttention,\n tokenize: tokenizeAttention\n};\n\n/**\n * Take all events and resolve attention to emphasis or strong.\n *\n * @type {Resolver}\n */\n// eslint-disable-next-line complexity\nfunction resolveAllAttention(events, context) {\n let index = -1;\n /** @type {number} */\n let open;\n /** @type {Token} */\n let group;\n /** @type {Token} */\n let text;\n /** @type {Token} */\n let openingSequence;\n /** @type {Token} */\n let closingSequence;\n /** @type {number} */\n let use;\n /** @type {Array<Event>} */\n let nextEvents;\n /** @type {number} */\n let offset;\n\n // Walk through all events.\n //\n // Note: performance of this is fine on an mb of normal markdown, but it’s\n // a bottleneck for malicious stuff.\n while (++index < events.length) {\n // Find a token that can close.\n if (events[index][0] === 'enter' && events[index][1].type === 'attentionSequence' && events[index][1]._close) {\n 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 (events[open][0] === 'exit' && events[open][1].type === 'attentionSequence' && events[open][1]._open &&\n // If the markers are the same:\n context.sliceSerialize(events[open][1]).charCodeAt(0) === context.sliceSerialize(events[index][1]).charCodeAt(0)) {\n // If the opening can close or the closing can open,\n // and the close size *is not* a multiple of three,\n // but the sum of the opening and closing size *is* multiple of three,\n // then don’t match.\n if ((events[open][1]._close || events[index][1]._open) && (events[index][1].end.offset - events[index][1].start.offset) % 3 && !((events[open][1].end.offset - events[open][1].start.offset + events[index][1].end.offset - events[index][1].start.offset) % 3)) {\n continue;\n }\n\n // Number of markers to use from the sequence.\n use = events[open][1].end.offset - events[open][1].start.offset > 1 && events[index][1].end.offset - events[index][1].start.offset > 1 ? 2 : 1;\n const start = {\n ...events[open][1].end\n };\n const end = {\n ...events[index][1].start\n };\n movePoint(start, -use);\n movePoint(end, use);\n openingSequence = {\n type: use > 1 ? \"strongSequence\" : \"emphasisSequence\",\n start,\n end: {\n ...events[open][1].end\n }\n };\n closingSequence = {\n type: use > 1 ? \"strongSequence\" : \"emphasisSequence\",\n start: {\n ...events[index][1].start\n },\n end\n };\n text = {\n type: use > 1 ? \"strongText\" : \"emphasisText\",\n start: {\n ...events[open][1].end\n },\n end: {\n ...events[index][1].start\n }\n };\n group = {\n type: use > 1 ? \"strong\" : \"emphasis\",\n start: {\n ...openingSequence.start\n },\n end: {\n ...closingSequence.end\n }\n };\n events[open][1].end = {\n ...openingSequence.start\n };\n events[index][1].start = {\n ...closingSequence.end\n };\n nextEvents = [];\n\n // If there are more markers in the opening, add them before.\n if (events[open][1].end.offset - events[open][1].start.offset) {\n nextEvents = push(nextEvents, [['enter', events[open][1], context], ['exit', events[open][1], context]]);\n }\n\n // Opening.\n nextEvents = push(nextEvents, [['enter', group, context], ['enter', openingSequence, context], ['exit', openingSequence, context], ['enter', text, context]]);\n\n // Always populated by defaults.\n\n // Between.\n nextEvents = push(nextEvents, resolveAll(context.parser.constructs.insideSpan.null, events.slice(open + 1, index), context));\n\n // Closing.\n nextEvents = push(nextEvents, [['exit', text, context], ['enter', closingSequence, context], ['exit', closingSequence, context], ['exit', group, context]]);\n\n // If there are more markers in the closing, add them after.\n if (events[index][1].end.offset - events[index][1].start.offset) {\n offset = 2;\n nextEvents = push(nextEvents, [['enter', events[index][1], context], ['exit', events[index][1], context]]);\n } else {\n offset = 0;\n }\n splice(events, open - 1, index - open + 3, nextEvents);\n index = open + nextEvents.length - offset - 2;\n break;\n }\n }\n }\n }\n\n // Remove remaining sequences.\n index = -1;\n while (++index < events.length) {\n if (events[index][1].type === 'attentionSequence') {\n events[index][1].type = 'data';\n }\n }\n return events;\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeAttention(effects, ok) {\n const attentionMarkers = this.parser.constructs.attentionMarkers.null;\n const previous = this.previous;\n const before = classifyCharacter(previous);\n\n /** @type {NonNullable<Code>} */\n let marker;\n return start;\n\n /**\n * Before a sequence.\n *\n * ```markdown\n * > | **\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n marker = code;\n effects.enter('attentionSequence');\n return inside(code);\n }\n\n /**\n * In a sequence.\n *\n * ```markdown\n * > | **\n * ^^\n * ```\n *\n * @type {State}\n */\n function inside(code) {\n if (code === marker) {\n effects.consume(code);\n return inside;\n }\n const token = effects.exit('attentionSequence');\n\n // To do: next major: move this to resolver, just like `markdown-rs`.\n const after = classifyCharacter(code);\n\n // Always populated by defaults.\n\n const open = !after || after === 2 && before || attentionMarkers.includes(code);\n const close = !before || before === 2 && after || attentionMarkers.includes(previous);\n token._open = Boolean(marker === 42 ? open : open && (before || !close));\n token._close = Boolean(marker === 42 ? close : close && (after || !open));\n return ok(code);\n }\n}\n\n/**\n * Move a point a bit.\n *\n * Note: `move` only works inside lines! It’s not possible to move past other\n * chunks (replacement characters, tabs, or line endings).\n *\n * @param {Point} point\n * Point.\n * @param {number} offset\n * Amount to move.\n * @returns {undefined}\n * Nothing.\n */\nfunction movePoint(point, offset) {\n point.column += offset;\n point.offset += offset;\n point._bufferIndex += offset;\n}"],"names":["attention","resolveAllAttention","tokenizeAttention","events","context","index","open","group","text","openingSequence","closingSequence","use","nextEvents","offset","start","end","movePoint","push","resolveAll","splice","effects","ok","attentionMarkers","previous","before","classifyCharacter","marker","code","inside","token","after","close","point"],"mappings":"iQAkBaA,EAAY,CACvB,KAAM,YACN,WAAYC,EACZ,SAAUC,CACZ,E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,QAAQO,CAAI,EACbC,EAET,MAAMC,EAAQT,EAAQ,KAAK,mBAAmB,EAGxCU,EAAQL,EAAAA,kBAAkBE,CAAI,EAI9BrB,EAAO,CAACwB,GAASA,IAAU,GAAKN,GAAUF,EAAiB,SAASK,CAAI,EACxEI,EAAQ,CAACP,GAAUA,IAAW,GAAKM,GAASR,EAAiB,SAASC,CAAQ,EACpF,OAAAM,EAAM,MAAQ,GAAQH,IAAW,GAAKpB,EAAOA,IAASkB,GAAU,CAACO,IACjEF,EAAM,OAAS,GAAQH,IAAW,GAAKK,EAAQA,IAAUD,GAAS,CAACxB,IAC5De,EAAGM,CAAI,CAChB,CACF,CAeA,SAASX,EAAUgB,EAAOnB,EAAQ,CAChCmB,EAAM,QAAUnB,EAChBmB,EAAM,QAAUnB,EAChBmB,EAAM,cAAgBnB,CACxB","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"attention.cjs","sources":["../../../../node_modules/micromark-core-commonmark/lib/attention.js"],"sourcesContent":["/**\n * @import {\n * Code,\n * Construct,\n * Event,\n * Point,\n * Resolver,\n * State,\n * TokenizeContext,\n * Tokenizer,\n * Token\n * } from 'micromark-util-types'\n */\n\nimport { push, splice } from 'micromark-util-chunked';\nimport { classifyCharacter } from 'micromark-util-classify-character';\nimport { resolveAll } from 'micromark-util-resolve-all';\n/** @type {Construct} */\nexport const attention = {\n name: 'attention',\n resolveAll: resolveAllAttention,\n tokenize: tokenizeAttention\n};\n\n/**\n * Take all events and resolve attention to emphasis or strong.\n *\n * @type {Resolver}\n */\n// eslint-disable-next-line complexity\nfunction resolveAllAttention(events, context) {\n let index = -1;\n /** @type {Array<Event>} */\n let nextEvents;\n\n // Walk through all events.\n //\n // Note: performance of this is fine on an mb of normal markdown, but it’s\n // a bottleneck for malicious stuff.\n while (++index < events.length) {\n // Find a token that can close.\n if (events[index][0] === 'enter' && events[index][1].type === 'attentionSequence' && events[index][1]._close) {\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 (events[open][0] === 'exit' && events[open][1].type === 'attentionSequence' && events[open][1]._open &&\n // If the markers are the same:\n context.sliceSerialize(events[open][1]).charCodeAt(0) === context.sliceSerialize(events[index][1]).charCodeAt(0)) {\n // If the opening can close or the closing can open,\n // and the close size *is not* a multiple of three,\n // but the sum of the opening and closing size *is* multiple of three,\n // then don’t match.\n if ((events[open][1]._close || events[index][1]._open) && (events[index][1].end.offset - events[index][1].start.offset) % 3 && !((events[open][1].end.offset - events[open][1].start.offset + events[index][1].end.offset - events[index][1].start.offset) % 3)) {\n continue;\n }\n\n // Number of markers to use from the sequence.\n const use = events[open][1].end.offset - events[open][1].start.offset > 1 && events[index][1].end.offset - events[index][1].start.offset > 1 ? 2 : 1;\n const start = {\n ...events[open][1].end\n };\n const end = {\n ...events[index][1].start\n };\n movePoint(start, -use);\n movePoint(end, use);\n const openingSequence = {\n type: use > 1 ? \"strongSequence\" : \"emphasisSequence\",\n start,\n end: {\n ...events[open][1].end\n }\n };\n const closingSequence = {\n type: use > 1 ? \"strongSequence\" : \"emphasisSequence\",\n start: {\n ...events[index][1].start\n },\n end\n };\n const text = {\n type: use > 1 ? \"strongText\" : \"emphasisText\",\n start: {\n ...events[open][1].end\n },\n end: {\n ...events[index][1].start\n }\n };\n const group = {\n type: use > 1 ? \"strong\" : \"emphasis\",\n start: {\n ...openingSequence.start\n },\n end: {\n ...closingSequence.end\n }\n };\n events[open][1].end = {\n ...openingSequence.start\n };\n events[index][1].start = {\n ...closingSequence.end\n };\n nextEvents = [];\n\n // If there are more markers in the opening, add them before.\n if (events[open][1].end.offset - events[open][1].start.offset) {\n nextEvents = push(nextEvents, [['enter', events[open][1], context], ['exit', events[open][1], context]]);\n }\n\n // Opening.\n nextEvents = push(nextEvents, [['enter', group, context], ['enter', openingSequence, context], ['exit', openingSequence, context], ['enter', text, context]]);\n\n // Always populated by defaults.\n\n // Between.\n nextEvents = push(nextEvents, resolveAll(context.parser.constructs.insideSpan.null, events.slice(open + 1, index), context));\n\n // Closing.\n nextEvents = push(nextEvents, [['exit', text, context], ['enter', closingSequence, context], ['exit', closingSequence, context], ['exit', group, context]]);\n\n /** @type {number} */\n let offset = 0;\n\n // If there are more markers in the closing, add them after.\n if (events[index][1].end.offset - events[index][1].start.offset) {\n offset = 2;\n nextEvents = push(nextEvents, [['enter', events[index][1], context], ['exit', events[index][1], context]]);\n }\n splice(events, open - 1, index - open + 3, nextEvents);\n index = open + nextEvents.length - offset - 2;\n break;\n }\n }\n }\n }\n\n // Remove remaining sequences.\n index = -1;\n while (++index < events.length) {\n if (events[index][1].type === 'attentionSequence') {\n events[index][1].type = 'data';\n }\n }\n return events;\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeAttention(effects, ok) {\n const attentionMarkers = this.parser.constructs.attentionMarkers.null;\n const previous = this.previous;\n const before = classifyCharacter(previous);\n\n /** @type {NonNullable<Code>} */\n let marker;\n return start;\n\n /**\n * Before a sequence.\n *\n * ```markdown\n * > | **\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n marker = code;\n effects.enter('attentionSequence');\n return inside(code);\n }\n\n /**\n * In a sequence.\n *\n * ```markdown\n * > | **\n * ^^\n * ```\n *\n * @type {State}\n */\n function inside(code) {\n if (code === marker) {\n effects.consume(code);\n return inside;\n }\n const token = effects.exit('attentionSequence');\n\n // To do: next major: move this to resolver, just like `markdown-rs`.\n const after = classifyCharacter(code);\n\n // Always populated by defaults.\n\n // Note: `*` and `_` are in `attentionMarkers` through core.\n // They are excluded here as the loosening is meant for markers registered\n // by *other* constructs (such as GFM strikethrough’s `~`).\n const open = !after || after === 2 && before || attentionMarkers.includes(code) && code !== 42 && code !== 95;\n const close = !before || before === 2 && after || attentionMarkers.includes(previous) && previous !== 42 && previous !== 95;\n token._open = Boolean(marker === 42 ? open : open && (before || !close));\n token._close = Boolean(marker === 42 ? close : close && (after || !open));\n return ok(code);\n }\n}\n\n/**\n * Move a point a bit.\n *\n * Note: `move` only works inside lines! It’s not possible to move past other\n * chunks (replacement characters, tabs, or line endings).\n *\n * @param {Point} point\n * Point.\n * @param {number} offset\n * Amount to move.\n * @returns {undefined}\n * Nothing.\n */\nfunction movePoint(point, offset) {\n point.column += offset;\n point.offset += offset;\n point._bufferIndex += offset;\n}"],"names":["attention","resolveAllAttention","tokenizeAttention","events","context","index","nextEvents","open","use","start","end","movePoint","openingSequence","closingSequence","text","group","push","resolveAll","offset","splice","effects","ok","attentionMarkers","previous","before","classifyCharacter","marker","code","inside","token","after","close","point"],"mappings":"iQAkBaA,EAAY,CACvB,KAAM,YACN,WAAYC,EACZ,SAAUC,CACZ,EAQA,SAASD,EAAoBE,EAAQC,EAAS,CAC5C,IAAIC,EAAQ,GAERC,EAMJ,KAAO,EAAED,EAAQF,EAAO,QAEtB,GAAIA,EAAOE,CAAK,EAAE,CAAC,IAAM,SAAWF,EAAOE,CAAK,EAAE,CAAC,EAAE,OAAS,qBAAuBF,EAAOE,CAAK,EAAE,CAAC,EAAE,OAAQ,CAC5G,IAAIE,EAAOF,EAGX,KAAOE,KAEL,GAAIJ,EAAOI,CAAI,EAAE,CAAC,IAAM,QAAUJ,EAAOI,CAAI,EAAE,CAAC,EAAE,OAAS,qBAAuBJ,EAAOI,CAAI,EAAE,CAAC,EAAE,OAElGH,EAAQ,eAAeD,EAAOI,CAAI,EAAE,CAAC,CAAC,EAAE,WAAW,CAAC,IAAMH,EAAQ,eAAeD,EAAOE,CAAK,EAAE,CAAC,CAAC,EAAE,WAAW,CAAC,EAAG,CAKhH,IAAKF,EAAOI,CAAI,EAAE,CAAC,EAAE,QAAUJ,EAAOE,CAAK,EAAE,CAAC,EAAE,SAAWF,EAAOE,CAAK,EAAE,CAAC,EAAE,IAAI,OAASF,EAAOE,CAAK,EAAE,CAAC,EAAE,MAAM,QAAU,GAAK,GAAGF,EAAOI,CAAI,EAAE,CAAC,EAAE,IAAI,OAASJ,EAAOI,CAAI,EAAE,CAAC,EAAE,M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C,EAAE,OAAS,sBAC5BF,EAAOE,CAAK,EAAE,CAAC,EAAE,KAAO,QAG5B,OAAOF,CACT,CAOA,SAASD,EAAkBkB,EAASC,EAAI,CACtC,MAAMC,EAAmB,KAAK,OAAO,WAAW,iBAAiB,KAC3DC,EAAW,KAAK,SAChBC,EAASC,EAAAA,kBAAkBF,CAAQ,EAGzC,IAAIG,EACJ,OAAOjB,EAYP,SAASA,EAAMkB,EAAM,CACnB,OAAAD,EAASC,EACTP,EAAQ,MAAM,mBAAmB,EAC1BQ,EAAOD,CAAI,CACpB,CAYA,SAASC,EAAOD,EAAM,CACpB,GAAIA,IAASD,EACX,OAAAN,EAAQ,QAAQO,CAAI,EACbC,EAET,MAAMC,EAAQT,EAAQ,KAAK,mBAAmB,EAGxCU,EAAQL,EAAAA,kBAAkBE,CAAI,EAO9BpB,EAAO,CAACuB,GAASA,IAAU,GAAKN,GAAUF,EAAiB,SAASK,CAAI,GAAKA,IAAS,IAAMA,IAAS,GACrGI,EAAQ,CAACP,GAAUA,IAAW,GAAKM,GAASR,EAAiB,SAASC,CAAQ,GAAKA,IAAa,IAAMA,IAAa,GACzH,OAAAM,EAAM,MAAQ,GAAQH,IAAW,GAAKnB,EAAOA,IAASiB,GAAU,CAACO,IACjEF,EAAM,OAAS,GAAQH,IAAW,GAAKK,EAAQA,IAAUD,GAAS,CAACvB,IAC5Dc,EAAGM,CAAI,CAChB,CACF,CAeA,SAAShB,EAAUqB,EAAOd,EAAQ,CAChCc,EAAM,QAAUd,EAChBc,EAAM,QAAUd,EAChBc,EAAM,cAAgBd,CACxB","x_google_ignoreList":[0]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { push as
|
|
1
|
+
import { push as p, splice as S } from "../../micromark-util-chunked/index.es.js";
|
|
2
2
|
import { classifyCharacter as h } from "../../micromark-util-classify-character/index.es.js";
|
|
3
3
|
import { resolveAll as q } from "../../micromark-util-resolve-all/index.es.js";
|
|
4
4
|
const z = {
|
|
@@ -6,54 +6,58 @@ const z = {
|
|
|
6
6
|
resolveAll: g,
|
|
7
7
|
tokenize: y
|
|
8
8
|
};
|
|
9
|
-
function g(t,
|
|
10
|
-
let e = -1,
|
|
9
|
+
function g(t, n) {
|
|
10
|
+
let e = -1, o;
|
|
11
11
|
for (; ++e < t.length; )
|
|
12
12
|
if (t[e][0] === "enter" && t[e][1].type === "attentionSequence" && t[e][1]._close) {
|
|
13
|
-
|
|
13
|
+
let r = e;
|
|
14
|
+
for (; r--; )
|
|
14
15
|
if (t[r][0] === "exit" && t[r][1].type === "attentionSequence" && t[r][1]._open && // If the markers are the same:
|
|
15
|
-
|
|
16
|
+
n.sliceSerialize(t[r][1]).charCodeAt(0) === n.sliceSerialize(t[e][1]).charCodeAt(0)) {
|
|
16
17
|
if ((t[r][1]._close || t[e][1]._open) && (t[e][1].end.offset - t[e][1].start.offset) % 3 && !((t[r][1].end.offset - t[r][1].start.offset + t[e][1].end.offset - t[e][1].start.offset) % 3))
|
|
17
18
|
continue;
|
|
18
|
-
|
|
19
|
-
const p = {
|
|
19
|
+
const a = t[r][1].end.offset - t[r][1].start.offset > 1 && t[e][1].end.offset - t[e][1].start.offset > 1 ? 2 : 1, d = {
|
|
20
20
|
...t[r][1].end
|
|
21
21
|
}, c = {
|
|
22
22
|
...t[e][1].start
|
|
23
23
|
};
|
|
24
|
-
m(
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
m(d, -a), m(c, a);
|
|
25
|
+
const i = {
|
|
26
|
+
type: a > 1 ? "strongSequence" : "emphasisSequence",
|
|
27
|
+
start: d,
|
|
27
28
|
end: {
|
|
28
29
|
...t[r][1].end
|
|
29
30
|
}
|
|
30
31
|
}, s = {
|
|
31
|
-
type:
|
|
32
|
+
type: a > 1 ? "strongSequence" : "emphasisSequence",
|
|
32
33
|
start: {
|
|
33
34
|
...t[e][1].start
|
|
34
35
|
},
|
|
35
36
|
end: c
|
|
36
|
-
},
|
|
37
|
-
type:
|
|
37
|
+
}, f = {
|
|
38
|
+
type: a > 1 ? "strongText" : "emphasisText",
|
|
38
39
|
start: {
|
|
39
40
|
...t[r][1].end
|
|
40
41
|
},
|
|
41
42
|
end: {
|
|
42
43
|
...t[e][1].start
|
|
43
44
|
}
|
|
44
|
-
},
|
|
45
|
-
type:
|
|
45
|
+
}, l = {
|
|
46
|
+
type: a > 1 ? "strong" : "emphasis",
|
|
46
47
|
start: {
|
|
47
|
-
...
|
|
48
|
+
...i.start
|
|
48
49
|
},
|
|
49
50
|
end: {
|
|
50
51
|
...s.end
|
|
51
52
|
}
|
|
52
|
-
}
|
|
53
|
-
|
|
53
|
+
};
|
|
54
|
+
t[r][1].end = {
|
|
55
|
+
...i.start
|
|
54
56
|
}, t[e][1].start = {
|
|
55
57
|
...s.end
|
|
56
|
-
}, o = [], t[r][1].end.offset - t[r][1].start.offset && (o =
|
|
58
|
+
}, o = [], t[r][1].end.offset - t[r][1].start.offset && (o = p(o, [["enter", t[r][1], n], ["exit", t[r][1], n]])), o = p(o, [["enter", l, n], ["enter", i, n], ["exit", i, n], ["enter", f, n]]), o = p(o, q(n.parser.constructs.insideSpan.null, t.slice(r + 1, e), n)), o = p(o, [["exit", f, n], ["enter", s, n], ["exit", s, n], ["exit", l, n]]);
|
|
59
|
+
let u = 0;
|
|
60
|
+
t[e][1].end.offset - t[e][1].start.offset && (u = 2, o = p(o, [["enter", t[e][1], n], ["exit", t[e][1], n]])), S(t, r - 1, e - r + 3, o), e = r + o.length - u - 2;
|
|
57
61
|
break;
|
|
58
62
|
}
|
|
59
63
|
}
|
|
@@ -61,22 +65,22 @@ function g(t, i) {
|
|
|
61
65
|
t[e][1].type === "attentionSequence" && (t[e][1].type = "data");
|
|
62
66
|
return t;
|
|
63
67
|
}
|
|
64
|
-
function y(t,
|
|
65
|
-
const e = this.parser.constructs.attentionMarkers.null,
|
|
66
|
-
let
|
|
67
|
-
return
|
|
68
|
-
function
|
|
69
|
-
return
|
|
68
|
+
function y(t, n) {
|
|
69
|
+
const e = this.parser.constructs.attentionMarkers.null, o = this.previous, r = h(o);
|
|
70
|
+
let a;
|
|
71
|
+
return d;
|
|
72
|
+
function d(i) {
|
|
73
|
+
return a = i, t.enter("attentionSequence"), c(i);
|
|
70
74
|
}
|
|
71
|
-
function
|
|
72
|
-
if (
|
|
73
|
-
return t.consume(
|
|
74
|
-
const
|
|
75
|
-
return
|
|
75
|
+
function c(i) {
|
|
76
|
+
if (i === a)
|
|
77
|
+
return t.consume(i), c;
|
|
78
|
+
const s = t.exit("attentionSequence"), f = h(i), l = !f || f === 2 && r || e.includes(i) && i !== 42 && i !== 95, u = !r || r === 2 && f || e.includes(o) && o !== 42 && o !== 95;
|
|
79
|
+
return s._open = !!(a === 42 ? l : l && (r || !u)), s._close = !!(a === 42 ? u : u && (f || !l)), n(i);
|
|
76
80
|
}
|
|
77
81
|
}
|
|
78
|
-
function m(t,
|
|
79
|
-
t.column +=
|
|
82
|
+
function m(t, n) {
|
|
83
|
+
t.column += n, t.offset += n, t._bufferIndex += n;
|
|
80
84
|
}
|
|
81
85
|
export {
|
|
82
86
|
z as attention
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attention.es.js","sources":["../../../../node_modules/micromark-core-commonmark/lib/attention.js"],"sourcesContent":["/**\n * @import {\n * Code,\n * Construct,\n * Event,\n * Point,\n * Resolver,\n * State,\n * TokenizeContext,\n * Tokenizer,\n * Token\n * } from 'micromark-util-types'\n */\n\nimport { push, splice } from 'micromark-util-chunked';\nimport { classifyCharacter } from 'micromark-util-classify-character';\nimport { resolveAll } from 'micromark-util-resolve-all';\n/** @type {Construct} */\nexport const attention = {\n name: 'attention',\n resolveAll: resolveAllAttention,\n tokenize: tokenizeAttention\n};\n\n/**\n * Take all events and resolve attention to emphasis or strong.\n *\n * @type {Resolver}\n */\n// eslint-disable-next-line complexity\nfunction resolveAllAttention(events, context) {\n let index = -1;\n /** @type {number} */\n let open;\n /** @type {Token} */\n let group;\n /** @type {Token} */\n let text;\n /** @type {Token} */\n let openingSequence;\n /** @type {Token} */\n let closingSequence;\n /** @type {number} */\n let use;\n /** @type {Array<Event>} */\n let nextEvents;\n /** @type {number} */\n let offset;\n\n // Walk through all events.\n //\n // Note: performance of this is fine on an mb of normal markdown, but it’s\n // a bottleneck for malicious stuff.\n while (++index < events.length) {\n // Find a token that can close.\n if (events[index][0] === 'enter' && events[index][1].type === 'attentionSequence' && events[index][1]._close) {\n 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 (events[open][0] === 'exit' && events[open][1].type === 'attentionSequence' && events[open][1]._open &&\n // If the markers are the same:\n context.sliceSerialize(events[open][1]).charCodeAt(0) === context.sliceSerialize(events[index][1]).charCodeAt(0)) {\n // If the opening can close or the closing can open,\n // and the close size *is not* a multiple of three,\n // but the sum of the opening and closing size *is* multiple of three,\n // then don’t match.\n if ((events[open][1]._close || events[index][1]._open) && (events[index][1].end.offset - events[index][1].start.offset) % 3 && !((events[open][1].end.offset - events[open][1].start.offset + events[index][1].end.offset - events[index][1].start.offset) % 3)) {\n continue;\n }\n\n // Number of markers to use from the sequence.\n use = events[open][1].end.offset - events[open][1].start.offset > 1 && events[index][1].end.offset - events[index][1].start.offset > 1 ? 2 : 1;\n const start = {\n ...events[open][1].end\n };\n const end = {\n ...events[index][1].start\n };\n movePoint(start, -use);\n movePoint(end, use);\n openingSequence = {\n type: use > 1 ? \"strongSequence\" : \"emphasisSequence\",\n start,\n end: {\n ...events[open][1].end\n }\n };\n closingSequence = {\n type: use > 1 ? \"strongSequence\" : \"emphasisSequence\",\n start: {\n ...events[index][1].start\n },\n end\n };\n text = {\n type: use > 1 ? \"strongText\" : \"emphasisText\",\n start: {\n ...events[open][1].end\n },\n end: {\n ...events[index][1].start\n }\n };\n group = {\n type: use > 1 ? \"strong\" : \"emphasis\",\n start: {\n ...openingSequence.start\n },\n end: {\n ...closingSequence.end\n }\n };\n events[open][1].end = {\n ...openingSequence.start\n };\n events[index][1].start = {\n ...closingSequence.end\n };\n nextEvents = [];\n\n // If there are more markers in the opening, add them before.\n if (events[open][1].end.offset - events[open][1].start.offset) {\n nextEvents = push(nextEvents, [['enter', events[open][1], context], ['exit', events[open][1], context]]);\n }\n\n // Opening.\n nextEvents = push(nextEvents, [['enter', group, context], ['enter', openingSequence, context], ['exit', openingSequence, context], ['enter', text, context]]);\n\n // Always populated by defaults.\n\n // Between.\n nextEvents = push(nextEvents, resolveAll(context.parser.constructs.insideSpan.null, events.slice(open + 1, index), context));\n\n // Closing.\n nextEvents = push(nextEvents, [['exit', text, context], ['enter', closingSequence, context], ['exit', closingSequence, context], ['exit', group, context]]);\n\n // If there are more markers in the closing, add them after.\n if (events[index][1].end.offset - events[index][1].start.offset) {\n offset = 2;\n nextEvents = push(nextEvents, [['enter', events[index][1], context], ['exit', events[index][1], context]]);\n } else {\n offset = 0;\n }\n splice(events, open - 1, index - open + 3, nextEvents);\n index = open + nextEvents.length - offset - 2;\n break;\n }\n }\n }\n }\n\n // Remove remaining sequences.\n index = -1;\n while (++index < events.length) {\n if (events[index][1].type === 'attentionSequence') {\n events[index][1].type = 'data';\n }\n }\n return events;\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeAttention(effects, ok) {\n const attentionMarkers = this.parser.constructs.attentionMarkers.null;\n const previous = this.previous;\n const before = classifyCharacter(previous);\n\n /** @type {NonNullable<Code>} */\n let marker;\n return start;\n\n /**\n * Before a sequence.\n *\n * ```markdown\n * > | **\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n marker = code;\n effects.enter('attentionSequence');\n return inside(code);\n }\n\n /**\n * In a sequence.\n *\n * ```markdown\n * > | **\n * ^^\n * ```\n *\n * @type {State}\n */\n function inside(code) {\n if (code === marker) {\n effects.consume(code);\n return inside;\n }\n const token = effects.exit('attentionSequence');\n\n // To do: next major: move this to resolver, just like `markdown-rs`.\n const after = classifyCharacter(code);\n\n // Always populated by defaults.\n\n const open = !after || after === 2 && before || attentionMarkers.includes(code);\n const close = !before || before === 2 && after || attentionMarkers.includes(previous);\n token._open = Boolean(marker === 42 ? open : open && (before || !close));\n token._close = Boolean(marker === 42 ? close : close && (after || !open));\n return ok(code);\n }\n}\n\n/**\n * Move a point a bit.\n *\n * Note: `move` only works inside lines! It’s not possible to move past other\n * chunks (replacement characters, tabs, or line endings).\n *\n * @param {Point} point\n * Point.\n * @param {number} offset\n * Amount to move.\n * @returns {undefined}\n * Nothing.\n */\nfunction movePoint(point, offset) {\n point.column += offset;\n point.offset += offset;\n point._bufferIndex += offset;\n}"],"names":["attention","resolveAllAttention","tokenizeAttention","events","context","index","open","group","text","openingSequence","closingSequence","use","nextEvents","offset","start","end","movePoint","push","resolveAll","splice","effects","ok","attentionMarkers","previous","before","classifyCharacter","marker","code","inside","token","after","close","point"],"mappings":";;;AAkBY,MAACA,IAAY;AAAA,EACvB,MAAM;AAAA,EACN,YAAYC;AAAA,EACZ,UAAUC;AACZ;AAQA,SAASD,EAAoBE,GAAQC,GAAS;AAC5C,MAAIC,IAAQ,IAERC,GAEAC,GAEAC,GAEAC,GAEAC,GAEAC,GAEAC,GAEAC;AAMJ,SAAO,EAAER,IAAQF,EAAO;AAEtB,QAAIA,EAAOE,CAAK,EAAE,CAAC,MAAM,WAAWF,EAAOE,CAAK,EAAE,CAAC,EAAE,SAAS,uBAAuBF,EAAOE,CAAK,EAAE,CAAC,EAAE;AAIpG,WAHAC,IAAOD,GAGAC;AAEL,YAAIH,EAAOG,CAAI,EAAE,CAAC,MAAM,UAAUH,EAAOG,CAAI,EAAE,CAAC,EAAE,SAAS,uBAAuBH,EAAOG,CAAI,EAAE,CAAC,EAAE;AAAA,QAElGF,EAAQ,eAAeD,EAAOG,CAAI,EAAE,CAAC,CAAC,EAAE,WAAW,CAAC,MAAMF,EAAQ,eAAeD,EAAOE,CAAK,EAAE,CAAC,CAAC,EAAE,WAAW,CAAC,GAAG;AAKhH,eAAKF,EAAOG,CAAI,EAAE,CAAC,EAAE,UAAUH,EAAOE,C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EAAAmB,EAAM,UAAUnB,GAChBmB,EAAM,UAAUnB,GAChBmB,EAAM,gBAAgBnB;AACxB;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"attention.es.js","sources":["../../../../node_modules/micromark-core-commonmark/lib/attention.js"],"sourcesContent":["/**\n * @import {\n * Code,\n * Construct,\n * Event,\n * Point,\n * Resolver,\n * State,\n * TokenizeContext,\n * Tokenizer,\n * Token\n * } from 'micromark-util-types'\n */\n\nimport { push, splice } from 'micromark-util-chunked';\nimport { classifyCharacter } from 'micromark-util-classify-character';\nimport { resolveAll } from 'micromark-util-resolve-all';\n/** @type {Construct} */\nexport const attention = {\n name: 'attention',\n resolveAll: resolveAllAttention,\n tokenize: tokenizeAttention\n};\n\n/**\n * Take all events and resolve attention to emphasis or strong.\n *\n * @type {Resolver}\n */\n// eslint-disable-next-line complexity\nfunction resolveAllAttention(events, context) {\n let index = -1;\n /** @type {Array<Event>} */\n let nextEvents;\n\n // Walk through all events.\n //\n // Note: performance of this is fine on an mb of normal markdown, but it’s\n // a bottleneck for malicious stuff.\n while (++index < events.length) {\n // Find a token that can close.\n if (events[index][0] === 'enter' && events[index][1].type === 'attentionSequence' && events[index][1]._close) {\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 (events[open][0] === 'exit' && events[open][1].type === 'attentionSequence' && events[open][1]._open &&\n // If the markers are the same:\n context.sliceSerialize(events[open][1]).charCodeAt(0) === context.sliceSerialize(events[index][1]).charCodeAt(0)) {\n // If the opening can close or the closing can open,\n // and the close size *is not* a multiple of three,\n // but the sum of the opening and closing size *is* multiple of three,\n // then don’t match.\n if ((events[open][1]._close || events[index][1]._open) && (events[index][1].end.offset - events[index][1].start.offset) % 3 && !((events[open][1].end.offset - events[open][1].start.offset + events[index][1].end.offset - events[index][1].start.offset) % 3)) {\n continue;\n }\n\n // Number of markers to use from the sequence.\n const use = events[open][1].end.offset - events[open][1].start.offset > 1 && events[index][1].end.offset - events[index][1].start.offset > 1 ? 2 : 1;\n const start = {\n ...events[open][1].end\n };\n const end = {\n ...events[index][1].start\n };\n movePoint(start, -use);\n movePoint(end, use);\n const openingSequence = {\n type: use > 1 ? \"strongSequence\" : \"emphasisSequence\",\n start,\n end: {\n ...events[open][1].end\n }\n };\n const closingSequence = {\n type: use > 1 ? \"strongSequence\" : \"emphasisSequence\",\n start: {\n ...events[index][1].start\n },\n end\n };\n const text = {\n type: use > 1 ? \"strongText\" : \"emphasisText\",\n start: {\n ...events[open][1].end\n },\n end: {\n ...events[index][1].start\n }\n };\n const group = {\n type: use > 1 ? \"strong\" : \"emphasis\",\n start: {\n ...openingSequence.start\n },\n end: {\n ...closingSequence.end\n }\n };\n events[open][1].end = {\n ...openingSequence.start\n };\n events[index][1].start = {\n ...closingSequence.end\n };\n nextEvents = [];\n\n // If there are more markers in the opening, add them before.\n if (events[open][1].end.offset - events[open][1].start.offset) {\n nextEvents = push(nextEvents, [['enter', events[open][1], context], ['exit', events[open][1], context]]);\n }\n\n // Opening.\n nextEvents = push(nextEvents, [['enter', group, context], ['enter', openingSequence, context], ['exit', openingSequence, context], ['enter', text, context]]);\n\n // Always populated by defaults.\n\n // Between.\n nextEvents = push(nextEvents, resolveAll(context.parser.constructs.insideSpan.null, events.slice(open + 1, index), context));\n\n // Closing.\n nextEvents = push(nextEvents, [['exit', text, context], ['enter', closingSequence, context], ['exit', closingSequence, context], ['exit', group, context]]);\n\n /** @type {number} */\n let offset = 0;\n\n // If there are more markers in the closing, add them after.\n if (events[index][1].end.offset - events[index][1].start.offset) {\n offset = 2;\n nextEvents = push(nextEvents, [['enter', events[index][1], context], ['exit', events[index][1], context]]);\n }\n splice(events, open - 1, index - open + 3, nextEvents);\n index = open + nextEvents.length - offset - 2;\n break;\n }\n }\n }\n }\n\n // Remove remaining sequences.\n index = -1;\n while (++index < events.length) {\n if (events[index][1].type === 'attentionSequence') {\n events[index][1].type = 'data';\n }\n }\n return events;\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeAttention(effects, ok) {\n const attentionMarkers = this.parser.constructs.attentionMarkers.null;\n const previous = this.previous;\n const before = classifyCharacter(previous);\n\n /** @type {NonNullable<Code>} */\n let marker;\n return start;\n\n /**\n * Before a sequence.\n *\n * ```markdown\n * > | **\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n marker = code;\n effects.enter('attentionSequence');\n return inside(code);\n }\n\n /**\n * In a sequence.\n *\n * ```markdown\n * > | **\n * ^^\n * ```\n *\n * @type {State}\n */\n function inside(code) {\n if (code === marker) {\n effects.consume(code);\n return inside;\n }\n const token = effects.exit('attentionSequence');\n\n // To do: next major: move this to resolver, just like `markdown-rs`.\n const after = classifyCharacter(code);\n\n // Always populated by defaults.\n\n // Note: `*` and `_` are in `attentionMarkers` through core.\n // They are excluded here as the loosening is meant for markers registered\n // by *other* constructs (such as GFM strikethrough’s `~`).\n const open = !after || after === 2 && before || attentionMarkers.includes(code) && code !== 42 && code !== 95;\n const close = !before || before === 2 && after || attentionMarkers.includes(previous) && previous !== 42 && previous !== 95;\n token._open = Boolean(marker === 42 ? open : open && (before || !close));\n token._close = Boolean(marker === 42 ? close : close && (after || !open));\n return ok(code);\n }\n}\n\n/**\n * Move a point a bit.\n *\n * Note: `move` only works inside lines! It’s not possible to move past other\n * chunks (replacement characters, tabs, or line endings).\n *\n * @param {Point} point\n * Point.\n * @param {number} offset\n * Amount to move.\n * @returns {undefined}\n * Nothing.\n */\nfunction movePoint(point, offset) {\n point.column += offset;\n point.offset += offset;\n point._bufferIndex += offset;\n}"],"names":["attention","resolveAllAttention","tokenizeAttention","events","context","index","nextEvents","open","use","start","end","movePoint","openingSequence","closingSequence","text","group","push","resolveAll","offset","splice","effects","ok","attentionMarkers","previous","before","classifyCharacter","marker","code","inside","token","after","close","point"],"mappings":";;;AAkBY,MAACA,IAAY;AAAA,EACvB,MAAM;AAAA,EACN,YAAYC;AAAA,EACZ,UAAUC;AACZ;AAQA,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AGzC,MAAIG;AACJ,SAAOjB;AAYP,WAASA,EAAMkB,GAAM;AACnB,WAAAD,IAASC,GACTP,EAAQ,MAAM,mBAAmB,GAC1BQ,EAAOD,CAAI;AAAA,EACpB;AAYA,WAASC,EAAOD,GAAM;AACpB,QAAIA,MAASD;AACX,aAAAN,EAAQ,QAAQO,CAAI,GACbC;AAET,UAAMC,IAAQT,EAAQ,KAAK,mBAAmB,GAGxCU,IAAQL,EAAkBE,CAAI,GAO9BpB,IAAO,CAACuB,KAASA,MAAU,KAAKN,KAAUF,EAAiB,SAASK,CAAI,KAAKA,MAAS,MAAMA,MAAS,IACrGI,IAAQ,CAACP,KAAUA,MAAW,KAAKM,KAASR,EAAiB,SAASC,CAAQ,KAAKA,MAAa,MAAMA,MAAa;AACzH,WAAAM,EAAM,QAAQ,GAAQH,MAAW,KAAKnB,IAAOA,MAASiB,KAAU,CAACO,KACjEF,EAAM,SAAS,GAAQH,MAAW,KAAKK,IAAQA,MAAUD,KAAS,CAACvB,KAC5Dc,EAAGM,CAAI;AAAA,EAChB;AACF;AAeA,SAAShB,EAAUqB,GAAOd,GAAQ;AAChC,EAAAc,EAAM,UAAUd,GAChBc,EAAM,UAAUd,GAChBc,EAAM,gBAAgBd;AACxB;","x_google_ignoreList":[0]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("../../micromark-factory-space/index.cjs"),t=require("../../micromark-util-character/index.cjs"),L=require("./partial-non-lazy-continuation.cjs"),N={concrete:!0,name:"codeFenced",tokenize:V};function V(e,g,l){const c=this,b={partial:!0,tokenize:v};let F=0,d=0,i;return s;function s(n){return B(n)}function B(n){const u=c.events[c.events.length-1];return F=u&&u[1].type==="linePrefix"?u[2].sliceSerialize(u[1],!0).length:0,i=n,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),k(n)}function k(n){return n===i?(d++,e.consume(n),k):d<3?l(n):(e.exit("codeFencedFenceSequence"),t.markdownSpace(n)?o.factorySpace(e,a,"whitespace")(n):a(n))}function a(n){return n===null||t.markdownLineEnding(n)?(e.exit("codeFencedFence"),c.interrupt?g(n):e.check(L.nonLazyContinuation,h,m)(n)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),x(n))}function x(n){return n===null||t.markdownLineEnding(n)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),a(n)):t.markdownSpace(n)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),o.factorySpace(e,P,"whitespace")(n)):n===96&&n===i?l(n):(e.consume(n),x)}function P(n){return n===null||t.markdownLineEnding(n)?a(n):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),w(n))}function w(n){return n===null||t.markdownLineEnding(n)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),a(n)):n===96&&n===i?l(n):(e.consume(n),w)}function h(n){return e.attempt(b,m,I)(n)}function I(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),O}function O(n){return F>0&&t.markdownSpace(n)?o.factorySpace(e,S,"linePrefix",F+1)(n):S(n)}function S(n){return n===null||t.markdownLineEnding(n)?e.check(L.nonLazyContinuation,h,m)(n):(e.enter("codeFlowValue"),y(n))}function y(n){return n===null||t.markdownLineEnding(n)?(e.exit("codeFlowValue"),S(n)):(e.consume(n),y)}function m(n){return e.exit("codeFenced"),g(n)}function v(n,u,p){let q=0;return M;function M(r){return n.enter("lineEnding"),n.consume(r),n.exit("lineEnding"),T}function T(r){return n.enter("codeFencedFence"),t.markdownSpace(r)?o.factorySpace(n,z,"linePrefix",c.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(r):z(r)}function z(r){return r===i?(n.enter("codeFencedFenceSequence"),C(r)):p(r)}function C(r){return r===i?(q++,n.consume(r),C):q>=d?(n.exit("codeFencedFenceSequence"),t.markdownSpace(r)?o.factorySpace(n,E,"whitespace")(r):E(r)):p(r)}function E(r){return r===null||t.markdownLineEnding(r)?(n.exit("codeFencedFence"),u(r)):p(r)}}}exports.codeFenced=N;
|
|
2
2
|
//# sourceMappingURL=code-fenced.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"code-fenced.cjs","sources":["../../../../node_modules/micromark-core-commonmark/lib/code-fenced.js"],"sourcesContent":["/**\n * @import {\n * Code,\n * Construct,\n * State,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownLineEnding, markdownSpace } from 'micromark-util-character';\n/** @type {Construct} */\nconst nonLazyContinuation = {\n partial: true,\n tokenize: tokenizeNonLazyContinuation\n};\n\n/** @type {Construct} */\nexport const codeFenced = {\n concrete: true,\n name: 'codeFenced',\n tokenize: tokenizeCodeFenced\n};\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeCodeFenced(effects, ok, nok) {\n const self = this;\n /** @type {Construct} */\n const closeStart = {\n partial: true,\n tokenize: tokenizeCloseStart\n };\n let initialPrefix = 0;\n let sizeOpen = 0;\n /** @type {NonNullable<Code>} */\n let marker;\n return start;\n\n /**\n * Start of code.\n *\n * ```markdown\n * > | ~~~js\n * ^\n * | alert(1)\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function start(code) {\n // To do: parse whitespace like `markdown-rs`.\n return beforeSequenceOpen(code);\n }\n\n /**\n * In opening fence, after prefix, at sequence.\n *\n * ```markdown\n * > | ~~~js\n * ^\n * | alert(1)\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function beforeSequenceOpen(code) {\n const tail = self.events[self.events.length - 1];\n initialPrefix = tail && tail[1].type === \"linePrefix\" ? tail[2].sliceSerialize(tail[1], true).length : 0;\n marker = code;\n effects.enter(\"codeFenced\");\n effects.enter(\"codeFencedFence\");\n effects.enter(\"codeFencedFenceSequence\");\n return sequenceOpen(code);\n }\n\n /**\n * In opening fence sequence.\n *\n * ```markdown\n * > | ~~~js\n * ^\n * | alert(1)\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function sequenceOpen(code) {\n if (code === marker) {\n sizeOpen++;\n effects.consume(code);\n return sequenceOpen;\n }\n if (sizeOpen < 3) {\n return nok(code);\n }\n effects.exit(\"codeFencedFenceSequence\");\n return markdownSpace(code) ? factorySpace(effects, infoBefore, \"whitespace\")(code) : infoBefore(code);\n }\n\n /**\n * In opening fence, after the sequence (and optional whitespace), before info.\n *\n * ```markdown\n * > | ~~~js\n * ^\n * | alert(1)\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function infoBefore(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit(\"codeFencedFence\");\n return self.interrupt ? ok(code) : effects.check(nonLazyContinuation, atNonLazyBreak, after)(code);\n }\n effects.enter(\"codeFencedFenceInfo\");\n effects.enter(\"chunkString\", {\n contentType: \"string\"\n });\n return info(code);\n }\n\n /**\n * In info.\n *\n * ```markdown\n * > | ~~~js\n * ^\n * | alert(1)\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function info(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit(\"chunkString\");\n effects.exit(\"codeFencedFenceInfo\");\n return infoBefore(code);\n }\n if (markdownSpace(code)) {\n effects.exit(\"chunkString\");\n effects.exit(\"codeFencedFenceInfo\");\n return factorySpace(effects, metaBefore, \"whitespace\")(code);\n }\n if (code === 96 && code === marker) {\n return nok(code);\n }\n effects.consume(code);\n return info;\n }\n\n /**\n * In opening fence, after info and whitespace, before meta.\n *\n * ```markdown\n * > | ~~~js eval\n * ^\n * | alert(1)\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function metaBefore(code) {\n if (code === null || markdownLineEnding(code)) {\n return infoBefore(code);\n }\n effects.enter(\"codeFencedFenceMeta\");\n effects.enter(\"chunkString\", {\n contentType: \"string\"\n });\n return meta(code);\n }\n\n /**\n * In meta.\n *\n * ```markdown\n * > | ~~~js eval\n * ^\n * | alert(1)\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function meta(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit(\"chunkString\");\n effects.exit(\"codeFencedFenceMeta\");\n return infoBefore(code);\n }\n if (code === 96 && code === marker) {\n return nok(code);\n }\n effects.consume(code);\n return meta;\n }\n\n /**\n * At eol/eof in code, before a non-lazy closing fence or content.\n *\n * ```markdown\n * > | ~~~js\n * ^\n * > | alert(1)\n * ^\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function atNonLazyBreak(code) {\n return effects.attempt(closeStart, after, contentBefore)(code);\n }\n\n /**\n * Before code content, not a closing fence, at eol.\n *\n * ```markdown\n * | ~~~js\n * > | alert(1)\n * ^\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function contentBefore(code) {\n effects.enter(\"lineEnding\");\n effects.consume(code);\n effects.exit(\"lineEnding\");\n return contentStart;\n }\n\n /**\n * Before code content, not a closing fence.\n *\n * ```markdown\n * | ~~~js\n * > | alert(1)\n * ^\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function contentStart(code) {\n return initialPrefix > 0 && markdownSpace(code) ? factorySpace(effects, beforeContentChunk, \"linePrefix\", initialPrefix + 1)(code) : beforeContentChunk(code);\n }\n\n /**\n * Before code content, after optional prefix.\n *\n * ```markdown\n * | ~~~js\n * > | alert(1)\n * ^\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function beforeContentChunk(code) {\n if (code === null || markdownLineEnding(code)) {\n return effects.check(nonLazyContinuation, atNonLazyBreak, after)(code);\n }\n effects.enter(\"codeFlowValue\");\n return contentChunk(code);\n }\n\n /**\n * In code content.\n *\n * ```markdown\n * | ~~~js\n * > | alert(1)\n * ^^^^^^^^\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function contentChunk(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit(\"codeFlowValue\");\n return beforeContentChunk(code);\n }\n effects.consume(code);\n return contentChunk;\n }\n\n /**\n * After code.\n *\n * ```markdown\n * | ~~~js\n * | alert(1)\n * > | ~~~\n * ^\n * ```\n *\n * @type {State}\n */\n function after(code) {\n effects.exit(\"codeFenced\");\n return ok(code);\n }\n\n /**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\n function tokenizeCloseStart(effects, ok, nok) {\n let size = 0;\n return startBefore;\n\n /**\n *\n *\n * @type {State}\n */\n function startBefore(code) {\n effects.enter(\"lineEnding\");\n effects.consume(code);\n effects.exit(\"lineEnding\");\n return start;\n }\n\n /**\n * Before closing fence, at optional whitespace.\n *\n * ```markdown\n * | ~~~js\n * | alert(1)\n * > | ~~~\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n // Always populated by defaults.\n\n // To do: `enter` here or in next state?\n effects.enter(\"codeFencedFence\");\n return markdownSpace(code) ? factorySpace(effects, beforeSequenceClose, \"linePrefix\", self.parser.constructs.disable.null.includes('codeIndented') ? undefined : 4)(code) : beforeSequenceClose(code);\n }\n\n /**\n * In closing fence, after optional whitespace, at sequence.\n *\n * ```markdown\n * | ~~~js\n * | alert(1)\n * > | ~~~\n * ^\n * ```\n *\n * @type {State}\n */\n function beforeSequenceClose(code) {\n if (code === marker) {\n effects.enter(\"codeFencedFenceSequence\");\n return sequenceClose(code);\n }\n return nok(code);\n }\n\n /**\n * In closing fence sequence.\n *\n * ```markdown\n * | ~~~js\n * | alert(1)\n * > | ~~~\n * ^\n * ```\n *\n * @type {State}\n */\n function sequenceClose(code) {\n if (code === marker) {\n size++;\n effects.consume(code);\n return sequenceClose;\n }\n if (size >= sizeOpen) {\n effects.exit(\"codeFencedFenceSequence\");\n return markdownSpace(code) ? factorySpace(effects, sequenceCloseAfter, \"whitespace\")(code) : sequenceCloseAfter(code);\n }\n return nok(code);\n }\n\n /**\n * After closing fence sequence, after optional whitespace.\n *\n * ```markdown\n * | ~~~js\n * | alert(1)\n * > | ~~~\n * ^\n * ```\n *\n * @type {State}\n */\n function sequenceCloseAfter(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit(\"codeFencedFence\");\n return ok(code);\n }\n return nok(code);\n }\n }\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeNonLazyContinuation(effects, ok, nok) {\n const self = this;\n return start;\n\n /**\n *\n *\n * @type {State}\n */\n function start(code) {\n if (code === null) {\n return nok(code);\n }\n effects.enter(\"lineEnding\");\n effects.consume(code);\n effects.exit(\"lineEnding\");\n return lineStart;\n }\n\n /**\n *\n *\n * @type {State}\n */\n function lineStart(code) {\n return self.parser.lazy[self.now().line] ? nok(code) : ok(code);\n }\n}"],"names":["nonLazyContinuation","tokenizeNonLazyContinuation","codeFenced","tokenizeCodeFenced","effects","ok","nok","self","closeStart","tokenizeCloseStart","initialPrefix","sizeOpen","marker","start","code","beforeSequenceOpen","tail","sequenceOpen","markdownSpace","factorySpace","infoBefore","markdownLineEnding","atNonLazyBreak","after","info","metaBefore","meta","contentBefore","contentStart","beforeContentChunk","contentChunk","size","startBefore","beforeSequenceClose","sequenceClose","sequenceCloseAfter","lineStart"],"mappings":"iMAaMA,EAAsB,CAC1B,QAAS,GACT,SAAUC,CACZ,EAGaC,EAAa,CACxB,SAAU,GACV,KAAM,aACN,SAAUC,CACZ,EAOA,SAASA,EAAmBC,EAASC,EAAIC,EAAK,CAC5C,MAAMC,EAAO,KAEPC,EAAa,CACjB,QAAS,GACT,SAAUC,CACd,EACE,IAAIC,EAAgB,EAChBC,EAAW,EAEXC,EACJ,OAAOC,EAcP,SAASA,EAAMC,EAAM,CAEnB,OAAOC,EAAmBD,CAAI,CAChC,CAcA,SAASC,EAAmBD,EAAM,CAChC,MAAME,EAAOT,EAAK,OAAOA,EAAK,OAAO,OAAS,CAAC,EAC/C,OAAAG,EAAgBM,GAAQA,EAAK,CAAC,EAAE,OAAS,aAAeA,EAAK,CAAC,EAAE,eAAeA,EAAK,CAAC,EAAG,EAAI,EAAE,OAAS,EACvGJ,EAASE,EACTV,EAAQ,MAAM,YA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[0]}
|
|
1
|
+
{"version":3,"file":"code-fenced.cjs","sources":["../../../../node_modules/micromark-core-commonmark/lib/code-fenced.js"],"sourcesContent":["/**\n * @import {\n * Code,\n * Construct,\n * State,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownLineEnding, markdownSpace } from 'micromark-util-character';\nimport { nonLazyContinuation } from './partial-non-lazy-continuation.js';\n\n/** @type {Construct} */\nexport const codeFenced = {\n concrete: true,\n name: 'codeFenced',\n tokenize: tokenizeCodeFenced\n};\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeCodeFenced(effects, ok, nok) {\n const self = this;\n /** @type {Construct} */\n const closeStart = {\n partial: true,\n tokenize: tokenizeCloseStart\n };\n let initialPrefix = 0;\n let sizeOpen = 0;\n /** @type {NonNullable<Code>} */\n let marker;\n return start;\n\n /**\n * Start of code.\n *\n * ```markdown\n * > | ~~~js\n * ^\n * | alert(1)\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function start(code) {\n // To do: parse whitespace like `markdown-rs`.\n return beforeSequenceOpen(code);\n }\n\n /**\n * In opening fence, after prefix, at sequence.\n *\n * ```markdown\n * > | ~~~js\n * ^\n * | alert(1)\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function beforeSequenceOpen(code) {\n const tail = self.events[self.events.length - 1];\n initialPrefix = tail && tail[1].type === \"linePrefix\" ? tail[2].sliceSerialize(tail[1], true).length : 0;\n marker = code;\n effects.enter(\"codeFenced\");\n effects.enter(\"codeFencedFence\");\n effects.enter(\"codeFencedFenceSequence\");\n return sequenceOpen(code);\n }\n\n /**\n * In opening fence sequence.\n *\n * ```markdown\n * > | ~~~js\n * ^\n * | alert(1)\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function sequenceOpen(code) {\n if (code === marker) {\n sizeOpen++;\n effects.consume(code);\n return sequenceOpen;\n }\n if (sizeOpen < 3) {\n return nok(code);\n }\n effects.exit(\"codeFencedFenceSequence\");\n return markdownSpace(code) ? factorySpace(effects, infoBefore, \"whitespace\")(code) : infoBefore(code);\n }\n\n /**\n * In opening fence, after the sequence (and optional whitespace), before info.\n *\n * ```markdown\n * > | ~~~js\n * ^\n * | alert(1)\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function infoBefore(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit(\"codeFencedFence\");\n return self.interrupt ? ok(code) : effects.check(nonLazyContinuation, atNonLazyBreak, after)(code);\n }\n effects.enter(\"codeFencedFenceInfo\");\n effects.enter(\"chunkString\", {\n contentType: \"string\"\n });\n return info(code);\n }\n\n /**\n * In info.\n *\n * ```markdown\n * > | ~~~js\n * ^\n * | alert(1)\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function info(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit(\"chunkString\");\n effects.exit(\"codeFencedFenceInfo\");\n return infoBefore(code);\n }\n if (markdownSpace(code)) {\n effects.exit(\"chunkString\");\n effects.exit(\"codeFencedFenceInfo\");\n return factorySpace(effects, metaBefore, \"whitespace\")(code);\n }\n if (code === 96 && code === marker) {\n return nok(code);\n }\n effects.consume(code);\n return info;\n }\n\n /**\n * In opening fence, after info and whitespace, before meta.\n *\n * ```markdown\n * > | ~~~js eval\n * ^\n * | alert(1)\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function metaBefore(code) {\n if (code === null || markdownLineEnding(code)) {\n return infoBefore(code);\n }\n effects.enter(\"codeFencedFenceMeta\");\n effects.enter(\"chunkString\", {\n contentType: \"string\"\n });\n return meta(code);\n }\n\n /**\n * In meta.\n *\n * ```markdown\n * > | ~~~js eval\n * ^\n * | alert(1)\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function meta(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit(\"chunkString\");\n effects.exit(\"codeFencedFenceMeta\");\n return infoBefore(code);\n }\n if (code === 96 && code === marker) {\n return nok(code);\n }\n effects.consume(code);\n return meta;\n }\n\n /**\n * At eol/eof in code, before a non-lazy closing fence or content.\n *\n * ```markdown\n * > | ~~~js\n * ^\n * > | alert(1)\n * ^\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function atNonLazyBreak(code) {\n return effects.attempt(closeStart, after, contentBefore)(code);\n }\n\n /**\n * Before code content, not a closing fence, at eol.\n *\n * ```markdown\n * | ~~~js\n * > | alert(1)\n * ^\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function contentBefore(code) {\n effects.enter(\"lineEnding\");\n effects.consume(code);\n effects.exit(\"lineEnding\");\n return contentStart;\n }\n\n /**\n * Before code content, not a closing fence.\n *\n * ```markdown\n * | ~~~js\n * > | alert(1)\n * ^\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function contentStart(code) {\n return initialPrefix > 0 && markdownSpace(code) ? factorySpace(effects, beforeContentChunk, \"linePrefix\", initialPrefix + 1)(code) : beforeContentChunk(code);\n }\n\n /**\n * Before code content, after optional prefix.\n *\n * ```markdown\n * | ~~~js\n * > | alert(1)\n * ^\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function beforeContentChunk(code) {\n if (code === null || markdownLineEnding(code)) {\n return effects.check(nonLazyContinuation, atNonLazyBreak, after)(code);\n }\n effects.enter(\"codeFlowValue\");\n return contentChunk(code);\n }\n\n /**\n * In code content.\n *\n * ```markdown\n * | ~~~js\n * > | alert(1)\n * ^^^^^^^^\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function contentChunk(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit(\"codeFlowValue\");\n return beforeContentChunk(code);\n }\n effects.consume(code);\n return contentChunk;\n }\n\n /**\n * After code.\n *\n * ```markdown\n * | ~~~js\n * | alert(1)\n * > | ~~~\n * ^\n * ```\n *\n * @type {State}\n */\n function after(code) {\n effects.exit(\"codeFenced\");\n return ok(code);\n }\n\n /**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\n function tokenizeCloseStart(effects, ok, nok) {\n let size = 0;\n return startBefore;\n\n /**\n *\n *\n * @type {State}\n */\n function startBefore(code) {\n effects.enter(\"lineEnding\");\n effects.consume(code);\n effects.exit(\"lineEnding\");\n return start;\n }\n\n /**\n * Before closing fence, at optional whitespace.\n *\n * ```markdown\n * | ~~~js\n * | alert(1)\n * > | ~~~\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n // Always populated by defaults.\n\n // To do: `enter` here or in next state?\n effects.enter(\"codeFencedFence\");\n return markdownSpace(code) ? factorySpace(effects, beforeSequenceClose, \"linePrefix\", self.parser.constructs.disable.null.includes('codeIndented') ? undefined : 4)(code) : beforeSequenceClose(code);\n }\n\n /**\n * In closing fence, after optional whitespace, at sequence.\n *\n * ```markdown\n * | ~~~js\n * | alert(1)\n * > | ~~~\n * ^\n * ```\n *\n * @type {State}\n */\n function beforeSequenceClose(code) {\n if (code === marker) {\n effects.enter(\"codeFencedFenceSequence\");\n return sequenceClose(code);\n }\n return nok(code);\n }\n\n /**\n * In closing fence sequence.\n *\n * ```markdown\n * | ~~~js\n * | alert(1)\n * > | ~~~\n * ^\n * ```\n *\n * @type {State}\n */\n function sequenceClose(code) {\n if (code === marker) {\n size++;\n effects.consume(code);\n return sequenceClose;\n }\n if (size >= sizeOpen) {\n effects.exit(\"codeFencedFenceSequence\");\n return markdownSpace(code) ? factorySpace(effects, sequenceCloseAfter, \"whitespace\")(code) : sequenceCloseAfter(code);\n }\n return nok(code);\n }\n\n /**\n * After closing fence sequence, after optional whitespace.\n *\n * ```markdown\n * | ~~~js\n * | alert(1)\n * > | ~~~\n * ^\n * ```\n *\n * @type {State}\n */\n function sequenceCloseAfter(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit(\"codeFencedFence\");\n return ok(code);\n }\n return nok(code);\n }\n }\n}"],"names":["codeFenced","tokenizeCodeFenced","effects","ok","nok","self","closeStart","tokenizeCloseStart","initialPrefix","sizeOpen","marker","start","code","beforeSequenceOpen","tail","sequenceOpen","markdownSpace","factorySpace","infoBefore","markdownLineEnding","nonLazyContinuation","atNonLazyBreak","after","info","metaBefore","meta","contentBefore","contentStart","beforeContentChunk","contentChunk","size","startBefore","beforeSequenceClose","sequenceClose","sequenceCloseAfter"],"mappings":"kPAeaA,EAAa,CACxB,SAAU,GACV,KAAM,aACN,SAAUC,CACZ,EAOA,SAASA,EAAmBC,EAASC,EAAIC,EAAK,CAC5C,MAAMC,EAAO,KAEPC,EAAa,CACjB,QAAS,GACT,SAAUC,CACd,EACE,IAAIC,EAAgB,EAChBC,EAAW,EAEXC,EACJ,OAAOC,EAcP,SAASA,EAAMC,EAAM,CAEnB,OAAOC,EAAmBD,CAAI,CAChC,CAcA,SAASC,EAAmBD,EAAM,CAChC,MAAME,EAAOT,EAAK,OAAOA,EAAK,OAAO,OAAS,CAAC,EAC/C,OAAAG,EAAgBM,GAAQA,EAAK,CAAC,EAAE,OAAS,aAAeA,EAAK,CAAC,EAAE,eAAeA,EAAK,CAAC,EAAG,EAAI,EAAE,OAAS,EACvGJ,EAASE,EACTV,EAAQ,MAAM,YAAY,EAC1BA,EAAQ,MAAM,iBAAiB,EAC/BA,EAAQ,MAAM,yBAAyB,EAChCa,EAAaH,CAAI,CAC1B,CAcA,SAASG,EAAaH,EAAM,CAC1B,OAAIA,IAASF,GACXD,IACAP,EAAQ,QAAQU,CAAI,EACbG,GAELN,EAAW,EACNL,EAAIQ,CAAI,GAEjBV,EAAQ,KAAK,yBAAyB,EAC/Bc,gBAAcJ,CAAI,EAAIK,EAAAA,aAAaf,EAASgB,EAAY,YAAY,EAAEN,CAAI,EAAIM,EAAWN,CAAI,EACtG,CAcA,SAASM,EAAWN,EAAM,CACxB,OAAIA,IAAS,MAAQO,EAAAA,mBAAmBP,CAAI,GAC1CV,EAAQ,KAAK,iBAAiB,EACvBG,EAAK,UAAYF,EAAGS,CAAI,EAAIV,EAAQ,MAAMkB,sBAAqBC,EAAgBC,CAAK,EAAEV,CAAI,IAEnGV,EAAQ,MAAM,qBAAqB,EACnCA,EA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,gBAAcJ,CAAI,EAAIK,EAAAA,aAAaf,EAASgC,EAAoB,YAAY,EAAEtB,CAAI,EAAIsB,EAAmBtB,CAAI,GAE/GR,EAAIQ,CAAI,CACjB,CAcA,SAASsB,EAAmBtB,EAAM,CAChC,OAAIA,IAAS,MAAQO,EAAAA,mBAAmBP,CAAI,GAC1CV,EAAQ,KAAK,iBAAiB,EACvBC,EAAGS,CAAI,GAETR,EAAIQ,CAAI,CACjB,CACF,CACF","x_google_ignoreList":[0]}
|
|
@@ -1,94 +1,82 @@
|
|
|
1
|
-
import { factorySpace as
|
|
2
|
-
import { markdownSpace as
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
tokenize: A
|
|
6
|
-
}, G = {
|
|
1
|
+
import { factorySpace as o } from "../../micromark-factory-space/index.es.js";
|
|
2
|
+
import { markdownSpace as a, markdownLineEnding as t } from "../../micromark-util-character/index.es.js";
|
|
3
|
+
import { nonLazyContinuation as b } from "./partial-non-lazy-continuation.es.js";
|
|
4
|
+
const G = {
|
|
7
5
|
concrete: !0,
|
|
8
6
|
name: "codeFenced",
|
|
9
|
-
tokenize:
|
|
7
|
+
tokenize: N
|
|
10
8
|
};
|
|
11
|
-
function
|
|
12
|
-
const
|
|
9
|
+
function N(e, g, c) {
|
|
10
|
+
const F = this, I = {
|
|
13
11
|
partial: !0,
|
|
14
|
-
tokenize:
|
|
12
|
+
tokenize: T
|
|
15
13
|
};
|
|
16
|
-
let
|
|
17
|
-
return
|
|
18
|
-
function
|
|
14
|
+
let m = 0, p = 0, i;
|
|
15
|
+
return P;
|
|
16
|
+
function P(n) {
|
|
19
17
|
return L(n);
|
|
20
18
|
}
|
|
21
19
|
function L(n) {
|
|
22
|
-
const
|
|
23
|
-
return
|
|
24
|
-
}
|
|
25
|
-
function z(n) {
|
|
26
|
-
return n === o ? (t++, e.consume(n), z) : t < 3 ? l(n) : (e.exit("codeFencedFenceSequence"), x(n) ? p(e, F, "whitespace")(n) : F(n));
|
|
27
|
-
}
|
|
28
|
-
function F(n) {
|
|
29
|
-
return n === null || u(n) ? (e.exit("codeFencedFence"), i.interrupt ? m(n) : e.check(d, w, h)(n)) : (e.enter("codeFencedFenceInfo"), e.enter("chunkString", {
|
|
30
|
-
contentType: "string"
|
|
31
|
-
}), C(n));
|
|
20
|
+
const u = F.events[F.events.length - 1];
|
|
21
|
+
return m = u && u[1].type === "linePrefix" ? u[2].sliceSerialize(u[1], !0).length : 0, i = n, e.enter("codeFenced"), e.enter("codeFencedFence"), e.enter("codeFencedFenceSequence"), k(n);
|
|
32
22
|
}
|
|
33
|
-
function
|
|
34
|
-
return n ===
|
|
23
|
+
function k(n) {
|
|
24
|
+
return n === i ? (p++, e.consume(n), k) : p < 3 ? c(n) : (e.exit("codeFencedFenceSequence"), a(n) ? o(e, l, "whitespace")(n) : l(n));
|
|
35
25
|
}
|
|
36
|
-
function
|
|
37
|
-
return n === null ||
|
|
26
|
+
function l(n) {
|
|
27
|
+
return n === null || t(n) ? (e.exit("codeFencedFence"), F.interrupt ? g(n) : e.check(b, C, S)(n)) : (e.enter("codeFencedFenceInfo"), e.enter("chunkString", {
|
|
38
28
|
contentType: "string"
|
|
39
29
|
}), q(n));
|
|
40
30
|
}
|
|
41
31
|
function q(n) {
|
|
42
|
-
return n === null ||
|
|
43
|
-
}
|
|
44
|
-
function w(n) {
|
|
45
|
-
return e.attempt(S, h, O)(n);
|
|
32
|
+
return n === null || t(n) ? (e.exit("chunkString"), e.exit("codeFencedFenceInfo"), l(n)) : a(n) ? (e.exit("chunkString"), e.exit("codeFencedFenceInfo"), o(e, O, "whitespace")(n)) : n === 96 && n === i ? c(n) : (e.consume(n), q);
|
|
46
33
|
}
|
|
47
34
|
function O(n) {
|
|
48
|
-
return e.enter("
|
|
35
|
+
return n === null || t(n) ? l(n) : (e.enter("codeFencedFenceMeta"), e.enter("chunkString", {
|
|
36
|
+
contentType: "string"
|
|
37
|
+
}), z(n));
|
|
38
|
+
}
|
|
39
|
+
function z(n) {
|
|
40
|
+
return n === null || t(n) ? (e.exit("chunkString"), e.exit("codeFencedFenceMeta"), l(n)) : n === 96 && n === i ? c(n) : (e.consume(n), z);
|
|
41
|
+
}
|
|
42
|
+
function C(n) {
|
|
43
|
+
return e.attempt(I, S, v)(n);
|
|
49
44
|
}
|
|
50
45
|
function v(n) {
|
|
51
|
-
return
|
|
46
|
+
return e.enter("lineEnding"), e.consume(n), e.exit("lineEnding"), M;
|
|
52
47
|
}
|
|
53
|
-
function
|
|
54
|
-
return
|
|
48
|
+
function M(n) {
|
|
49
|
+
return m > 0 && a(n) ? o(e, x, "linePrefix", m + 1)(n) : x(n);
|
|
55
50
|
}
|
|
56
|
-
function
|
|
57
|
-
return n === null ||
|
|
51
|
+
function x(n) {
|
|
52
|
+
return n === null || t(n) ? e.check(b, C, S)(n) : (e.enter("codeFlowValue"), w(n));
|
|
58
53
|
}
|
|
59
|
-
function
|
|
60
|
-
return e.exit("
|
|
54
|
+
function w(n) {
|
|
55
|
+
return n === null || t(n) ? (e.exit("codeFlowValue"), x(n)) : (e.consume(n), w);
|
|
61
56
|
}
|
|
62
|
-
function
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
57
|
+
function S(n) {
|
|
58
|
+
return e.exit("codeFenced"), g(n);
|
|
59
|
+
}
|
|
60
|
+
function T(n, u, h) {
|
|
61
|
+
let y = 0;
|
|
62
|
+
return V;
|
|
63
|
+
function V(r) {
|
|
64
|
+
return n.enter("lineEnding"), n.consume(r), n.exit("lineEnding"), A;
|
|
67
65
|
}
|
|
68
|
-
function
|
|
69
|
-
return n.enter("codeFencedFence"),
|
|
66
|
+
function A(r) {
|
|
67
|
+
return n.enter("codeFencedFence"), a(r) ? o(n, d, "linePrefix", F.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4)(r) : d(r);
|
|
70
68
|
}
|
|
71
|
-
function
|
|
72
|
-
return r ===
|
|
69
|
+
function d(r) {
|
|
70
|
+
return r === i ? (n.enter("codeFencedFenceSequence"), B(r)) : h(r);
|
|
73
71
|
}
|
|
74
72
|
function B(r) {
|
|
75
|
-
return r ===
|
|
73
|
+
return r === i ? (y++, n.consume(r), B) : y >= p ? (n.exit("codeFencedFenceSequence"), a(r) ? o(n, E, "whitespace")(r) : E(r)) : h(r);
|
|
76
74
|
}
|
|
77
|
-
function
|
|
78
|
-
return r === null ||
|
|
75
|
+
function E(r) {
|
|
76
|
+
return r === null || t(r) ? (n.exit("codeFencedFence"), u(r)) : h(r);
|
|
79
77
|
}
|
|
80
78
|
}
|
|
81
79
|
}
|
|
82
|
-
function A(e, m, l) {
|
|
83
|
-
const i = this;
|
|
84
|
-
return S;
|
|
85
|
-
function S(t) {
|
|
86
|
-
return t === null ? l(t) : (e.enter("lineEnding"), e.consume(t), e.exit("lineEnding"), c);
|
|
87
|
-
}
|
|
88
|
-
function c(t) {
|
|
89
|
-
return i.parser.lazy[i.now().line] ? l(t) : m(t);
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
80
|
export {
|
|
93
81
|
G as codeFenced
|
|
94
82
|
};
|