@e-llm-studio/citation 0.0.92 → 0.0.93
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/features/CitationRenderer/MarkdownRenderer.js +2 -0
- package/dist/cjs/features/CitationRenderer/MarkdownRenderer.js.map +1 -0
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/node_modules/ccount/index.js +2 -0
- package/dist/cjs/node_modules/ccount/index.js.map +1 -0
- package/dist/cjs/node_modules/longest-streak/index.js +2 -0
- package/dist/cjs/node_modules/longest-streak/index.js.map +1 -0
- package/dist/cjs/node_modules/markdown-table/index.js +2 -0
- package/dist/cjs/node_modules/markdown-table/index.js.map +1 -0
- package/dist/cjs/node_modules/mdast-util-gfm/lib/index.js +2 -0
- package/dist/cjs/node_modules/mdast-util-gfm/lib/index.js.map +1 -0
- package/dist/cjs/node_modules/mdast-util-gfm-autolink-literal/lib/index.js +2 -0
- package/dist/cjs/node_modules/mdast-util-gfm-autolink-literal/lib/index.js.map +1 -0
- package/dist/cjs/node_modules/mdast-util-gfm-footnote/lib/index.js +2 -0
- package/dist/cjs/node_modules/mdast-util-gfm-footnote/lib/index.js.map +1 -0
- package/dist/cjs/node_modules/mdast-util-gfm-strikethrough/lib/index.js +2 -0
- package/dist/cjs/node_modules/mdast-util-gfm-strikethrough/lib/index.js.map +1 -0
- package/dist/cjs/node_modules/mdast-util-gfm-table/lib/index.js +2 -0
- package/dist/cjs/node_modules/mdast-util-gfm-table/lib/index.js.map +1 -0
- package/dist/cjs/node_modules/mdast-util-gfm-task-list-item/lib/index.js +2 -0
- package/dist/cjs/node_modules/mdast-util-gfm-task-list-item/lib/index.js.map +1 -0
- package/dist/cjs/node_modules/mdast-util-phrasing/lib/index.js +2 -0
- package/dist/cjs/node_modules/mdast-util-phrasing/lib/index.js.map +1 -0
- package/dist/cjs/node_modules/mdast-util-to-markdown/lib/handle/blockquote.js +2 -0
- package/dist/cjs/node_modules/mdast-util-to-markdown/lib/handle/blockquote.js.map +1 -0
- package/dist/cjs/node_modules/mdast-util-to-markdown/lib/handle/break.js +2 -0
- package/dist/cjs/node_modules/mdast-util-to-markdown/lib/handle/break.js.map +1 -0
- package/dist/cjs/node_modules/mdast-util-to-markdown/lib/handle/code.js +2 -0
- package/dist/cjs/node_modules/mdast-util-to-markdown/lib/handle/code.js.map +1 -0
- package/dist/cjs/node_modules/mdast-util-to-markdown/lib/handle/definition.js +2 -0
- package/dist/cjs/node_modules/mdast-util-to-markdown/lib/handle/definition.js.map +1 -0
- package/dist/cjs/node_modules/mdast-util-to-markdown/lib/handle/emphasis.js +2 -0
- package/dist/cjs/node_modules/mdast-util-to-markdown/lib/handle/emphasis.js.map +1 -0
- package/dist/cjs/node_modules/mdast-util-to-markdown/lib/handle/heading.js +2 -0
- package/dist/cjs/node_modules/mdast-util-to-markdown/lib/handle/heading.js.map +1 -0
- package/dist/cjs/node_modules/mdast-util-to-markdown/lib/handle/html.js +2 -0
- package/dist/cjs/node_modules/mdast-util-to-markdown/lib/handle/html.js.map +1 -0
- package/dist/cjs/node_modules/mdast-util-to-markdown/lib/handle/image-reference.js +2 -0
- package/dist/cjs/node_modules/mdast-util-to-markdown/lib/handle/image-reference.js.map +1 -0
- package/dist/cjs/node_modules/mdast-util-to-markdown/lib/handle/image.js +2 -0
- package/dist/cjs/node_modules/mdast-util-to-markdown/lib/handle/image.js.map +1 -0
- package/dist/cjs/node_modules/mdast-util-to-markdown/lib/handle/index.js +2 -0
- package/dist/cjs/node_modules/mdast-util-to-markdown/lib/handle/index.js.map +1 -0
- package/dist/cjs/node_modules/mdast-util-to-markdown/lib/handle/inline-code.js +2 -0
- package/dist/cjs/node_modules/mdast-util-to-markdown/lib/handle/inline-code.js.map +1 -0
- package/dist/cjs/node_modules/mdast-util-to-markdown/lib/handle/link-reference.js +2 -0
- package/dist/cjs/node_modules/mdast-util-to-markdown/lib/handle/link-reference.js.map +1 -0
- package/dist/cjs/node_modules/mdast-util-to-markdown/lib/handle/link.js +2 -0
- package/dist/cjs/node_modules/mdast-util-to-markdown/lib/handle/link.js.map +1 -0
- package/dist/cjs/node_modules/mdast-util-to-markdown/lib/handle/list-item.js +2 -0
- package/dist/cjs/node_modules/mdast-util-to-markdown/lib/handle/list-item.js.map +1 -0
- package/dist/cjs/node_modules/mdast-util-to-markdown/lib/handle/list.js +2 -0
- package/dist/cjs/node_modules/mdast-util-to-markdown/lib/handle/list.js.map +1 -0
- package/dist/cjs/node_modules/mdast-util-to-markdown/lib/handle/paragraph.js +2 -0
- package/dist/cjs/node_modules/mdast-util-to-markdown/lib/handle/paragraph.js.map +1 -0
- package/dist/cjs/node_modules/mdast-util-to-markdown/lib/handle/root.js +2 -0
- package/dist/cjs/node_modules/mdast-util-to-markdown/lib/handle/root.js.map +1 -0
- package/dist/cjs/node_modules/mdast-util-to-markdown/lib/handle/strong.js +2 -0
- package/dist/cjs/node_modules/mdast-util-to-markdown/lib/handle/strong.js.map +1 -0
- package/dist/cjs/node_modules/mdast-util-to-markdown/lib/handle/text.js +2 -0
- package/dist/cjs/node_modules/mdast-util-to-markdown/lib/handle/text.js.map +1 -0
- package/dist/cjs/node_modules/mdast-util-to-markdown/lib/handle/thematic-break.js +2 -0
- package/dist/cjs/node_modules/mdast-util-to-markdown/lib/handle/thematic-break.js.map +1 -0
- package/dist/cjs/node_modules/mdast-util-to-markdown/lib/util/check-bullet-ordered.js +2 -0
- package/dist/cjs/node_modules/mdast-util-to-markdown/lib/util/check-bullet-ordered.js.map +1 -0
- package/dist/cjs/node_modules/mdast-util-to-markdown/lib/util/check-bullet-other.js +2 -0
- package/dist/cjs/node_modules/mdast-util-to-markdown/lib/util/check-bullet-other.js.map +1 -0
- package/dist/cjs/node_modules/mdast-util-to-markdown/lib/util/check-bullet.js +2 -0
- package/dist/cjs/node_modules/mdast-util-to-markdown/lib/util/check-bullet.js.map +1 -0
- package/dist/cjs/node_modules/mdast-util-to-markdown/lib/util/check-emphasis.js +2 -0
- package/dist/cjs/node_modules/mdast-util-to-markdown/lib/util/check-emphasis.js.map +1 -0
- package/dist/cjs/node_modules/mdast-util-to-markdown/lib/util/check-fence.js +2 -0
- package/dist/cjs/node_modules/mdast-util-to-markdown/lib/util/check-fence.js.map +1 -0
- package/dist/cjs/node_modules/mdast-util-to-markdown/lib/util/check-list-item-indent.js +2 -0
- package/dist/cjs/node_modules/mdast-util-to-markdown/lib/util/check-list-item-indent.js.map +1 -0
- package/dist/cjs/node_modules/mdast-util-to-markdown/lib/util/check-quote.js +2 -0
- package/dist/cjs/node_modules/mdast-util-to-markdown/lib/util/check-quote.js.map +1 -0
- package/dist/cjs/node_modules/mdast-util-to-markdown/lib/util/check-rule-repetition.js +2 -0
- package/dist/cjs/node_modules/mdast-util-to-markdown/lib/util/check-rule-repetition.js.map +1 -0
- package/dist/cjs/node_modules/mdast-util-to-markdown/lib/util/check-rule.js +2 -0
- package/dist/cjs/node_modules/mdast-util-to-markdown/lib/util/check-rule.js.map +1 -0
- package/dist/cjs/node_modules/mdast-util-to-markdown/lib/util/check-strong.js +2 -0
- package/dist/cjs/node_modules/mdast-util-to-markdown/lib/util/check-strong.js.map +1 -0
- package/dist/cjs/node_modules/mdast-util-to-markdown/lib/util/encode-character-reference.js +2 -0
- package/dist/cjs/node_modules/mdast-util-to-markdown/lib/util/encode-character-reference.js.map +1 -0
- package/dist/cjs/node_modules/mdast-util-to-markdown/lib/util/encode-info.js +2 -0
- package/dist/cjs/node_modules/mdast-util-to-markdown/lib/util/encode-info.js.map +1 -0
- package/dist/cjs/node_modules/mdast-util-to-markdown/lib/util/format-code-as-indented.js +2 -0
- package/dist/cjs/node_modules/mdast-util-to-markdown/lib/util/format-code-as-indented.js.map +1 -0
- package/dist/cjs/node_modules/mdast-util-to-markdown/lib/util/format-heading-as-setext.js +2 -0
- package/dist/cjs/node_modules/mdast-util-to-markdown/lib/util/format-heading-as-setext.js.map +1 -0
- package/dist/cjs/node_modules/mdast-util-to-markdown/lib/util/format-link-as-autolink.js +2 -0
- package/dist/cjs/node_modules/mdast-util-to-markdown/lib/util/format-link-as-autolink.js.map +1 -0
- package/dist/cjs/node_modules/mdast-util-to-markdown/lib/util/pattern-in-scope.js +2 -0
- package/dist/cjs/node_modules/mdast-util-to-markdown/lib/util/pattern-in-scope.js.map +1 -0
- package/dist/cjs/node_modules/mdast-util-to-string/lib/index.js +2 -0
- package/dist/cjs/node_modules/mdast-util-to-string/lib/index.js.map +1 -0
- package/dist/cjs/node_modules/micromark-core-commonmark/lib/blank-line.js +2 -0
- package/dist/cjs/node_modules/micromark-core-commonmark/lib/blank-line.js.map +1 -0
- package/dist/cjs/node_modules/micromark-extension-gfm/index.js +2 -0
- package/dist/cjs/node_modules/micromark-extension-gfm/index.js.map +1 -0
- package/dist/cjs/node_modules/micromark-extension-gfm-autolink-literal/lib/syntax.js +2 -0
- package/dist/cjs/node_modules/micromark-extension-gfm-autolink-literal/lib/syntax.js.map +1 -0
- package/dist/cjs/node_modules/micromark-extension-gfm-footnote/lib/syntax.js +2 -0
- package/dist/cjs/node_modules/micromark-extension-gfm-footnote/lib/syntax.js.map +1 -0
- package/dist/cjs/node_modules/micromark-extension-gfm-strikethrough/lib/syntax.js +2 -0
- package/dist/cjs/node_modules/micromark-extension-gfm-strikethrough/lib/syntax.js.map +1 -0
- package/dist/cjs/node_modules/micromark-extension-gfm-table/lib/edit-map.js +2 -0
- package/dist/cjs/node_modules/micromark-extension-gfm-table/lib/edit-map.js.map +1 -0
- package/dist/cjs/node_modules/micromark-extension-gfm-table/lib/infer.js +2 -0
- package/dist/cjs/node_modules/micromark-extension-gfm-table/lib/infer.js.map +1 -0
- package/dist/cjs/node_modules/micromark-extension-gfm-table/lib/syntax.js +2 -0
- package/dist/cjs/node_modules/micromark-extension-gfm-table/lib/syntax.js.map +1 -0
- package/dist/cjs/node_modules/micromark-extension-gfm-task-list-item/lib/syntax.js +2 -0
- package/dist/cjs/node_modules/micromark-extension-gfm-task-list-item/lib/syntax.js.map +1 -0
- package/dist/cjs/node_modules/micromark-factory-space/index.js +2 -0
- package/dist/cjs/node_modules/micromark-factory-space/index.js.map +1 -0
- package/dist/cjs/node_modules/micromark-util-character/index.js +2 -0
- package/dist/cjs/node_modules/micromark-util-character/index.js.map +1 -0
- package/dist/cjs/node_modules/micromark-util-chunked/index.js +2 -0
- package/dist/cjs/node_modules/micromark-util-chunked/index.js.map +1 -0
- package/dist/cjs/node_modules/micromark-util-classify-character/index.js +2 -0
- package/dist/cjs/node_modules/micromark-util-classify-character/index.js.map +1 -0
- package/dist/cjs/node_modules/micromark-util-combine-extensions/index.js +2 -0
- package/dist/cjs/node_modules/micromark-util-combine-extensions/index.js.map +1 -0
- package/dist/cjs/node_modules/micromark-util-normalize-identifier/index.js +2 -0
- package/dist/cjs/node_modules/micromark-util-normalize-identifier/index.js.map +1 -0
- package/dist/cjs/node_modules/micromark-util-resolve-all/index.js +2 -0
- package/dist/cjs/node_modules/micromark-util-resolve-all/index.js.map +1 -0
- package/dist/cjs/node_modules/remark-gfm/lib/index.js +2 -0
- package/dist/cjs/node_modules/remark-gfm/lib/index.js.map +1 -0
- package/dist/features/CitationRenderer/MarkdownRenderer.js +2 -0
- package/dist/features/CitationRenderer/MarkdownRenderer.js.map +1 -0
- package/dist/index.js +1 -1
- package/dist/node_modules/ccount/index.js +2 -0
- package/dist/node_modules/ccount/index.js.map +1 -0
- package/dist/node_modules/longest-streak/index.js +2 -0
- package/dist/node_modules/longest-streak/index.js.map +1 -0
- package/dist/node_modules/markdown-table/index.js +2 -0
- package/dist/node_modules/markdown-table/index.js.map +1 -0
- package/dist/node_modules/mdast-util-gfm/lib/index.js +2 -0
- package/dist/node_modules/mdast-util-gfm/lib/index.js.map +1 -0
- package/dist/node_modules/mdast-util-gfm-autolink-literal/lib/index.js +2 -0
- package/dist/node_modules/mdast-util-gfm-autolink-literal/lib/index.js.map +1 -0
- package/dist/node_modules/mdast-util-gfm-footnote/lib/index.js +2 -0
- package/dist/node_modules/mdast-util-gfm-footnote/lib/index.js.map +1 -0
- package/dist/node_modules/mdast-util-gfm-strikethrough/lib/index.js +2 -0
- package/dist/node_modules/mdast-util-gfm-strikethrough/lib/index.js.map +1 -0
- package/dist/node_modules/mdast-util-gfm-table/lib/index.js +2 -0
- package/dist/node_modules/mdast-util-gfm-table/lib/index.js.map +1 -0
- package/dist/node_modules/mdast-util-gfm-task-list-item/lib/index.js +2 -0
- package/dist/node_modules/mdast-util-gfm-task-list-item/lib/index.js.map +1 -0
- package/dist/node_modules/mdast-util-phrasing/lib/index.js +2 -0
- package/dist/node_modules/mdast-util-phrasing/lib/index.js.map +1 -0
- package/dist/node_modules/mdast-util-to-markdown/lib/handle/blockquote.js +2 -0
- package/dist/node_modules/mdast-util-to-markdown/lib/handle/blockquote.js.map +1 -0
- package/dist/node_modules/mdast-util-to-markdown/lib/handle/break.js +2 -0
- package/dist/node_modules/mdast-util-to-markdown/lib/handle/break.js.map +1 -0
- package/dist/node_modules/mdast-util-to-markdown/lib/handle/code.js +2 -0
- package/dist/node_modules/mdast-util-to-markdown/lib/handle/code.js.map +1 -0
- package/dist/node_modules/mdast-util-to-markdown/lib/handle/definition.js +2 -0
- package/dist/node_modules/mdast-util-to-markdown/lib/handle/definition.js.map +1 -0
- package/dist/node_modules/mdast-util-to-markdown/lib/handle/emphasis.js +2 -0
- package/dist/node_modules/mdast-util-to-markdown/lib/handle/emphasis.js.map +1 -0
- package/dist/node_modules/mdast-util-to-markdown/lib/handle/heading.js +2 -0
- package/dist/node_modules/mdast-util-to-markdown/lib/handle/heading.js.map +1 -0
- package/dist/node_modules/mdast-util-to-markdown/lib/handle/html.js +2 -0
- package/dist/node_modules/mdast-util-to-markdown/lib/handle/html.js.map +1 -0
- package/dist/node_modules/mdast-util-to-markdown/lib/handle/image-reference.js +2 -0
- package/dist/node_modules/mdast-util-to-markdown/lib/handle/image-reference.js.map +1 -0
- package/dist/node_modules/mdast-util-to-markdown/lib/handle/image.js +2 -0
- package/dist/node_modules/mdast-util-to-markdown/lib/handle/image.js.map +1 -0
- package/dist/node_modules/mdast-util-to-markdown/lib/handle/index.js +2 -0
- package/dist/node_modules/mdast-util-to-markdown/lib/handle/index.js.map +1 -0
- package/dist/node_modules/mdast-util-to-markdown/lib/handle/inline-code.js +2 -0
- package/dist/node_modules/mdast-util-to-markdown/lib/handle/inline-code.js.map +1 -0
- package/dist/node_modules/mdast-util-to-markdown/lib/handle/link-reference.js +2 -0
- package/dist/node_modules/mdast-util-to-markdown/lib/handle/link-reference.js.map +1 -0
- package/dist/node_modules/mdast-util-to-markdown/lib/handle/link.js +2 -0
- package/dist/node_modules/mdast-util-to-markdown/lib/handle/link.js.map +1 -0
- package/dist/node_modules/mdast-util-to-markdown/lib/handle/list-item.js +2 -0
- package/dist/node_modules/mdast-util-to-markdown/lib/handle/list-item.js.map +1 -0
- package/dist/node_modules/mdast-util-to-markdown/lib/handle/list.js +2 -0
- package/dist/node_modules/mdast-util-to-markdown/lib/handle/list.js.map +1 -0
- package/dist/node_modules/mdast-util-to-markdown/lib/handle/paragraph.js +2 -0
- package/dist/node_modules/mdast-util-to-markdown/lib/handle/paragraph.js.map +1 -0
- package/dist/node_modules/mdast-util-to-markdown/lib/handle/root.js +2 -0
- package/dist/node_modules/mdast-util-to-markdown/lib/handle/root.js.map +1 -0
- package/dist/node_modules/mdast-util-to-markdown/lib/handle/strong.js +2 -0
- package/dist/node_modules/mdast-util-to-markdown/lib/handle/strong.js.map +1 -0
- package/dist/node_modules/mdast-util-to-markdown/lib/handle/text.js +2 -0
- package/dist/node_modules/mdast-util-to-markdown/lib/handle/text.js.map +1 -0
- package/dist/node_modules/mdast-util-to-markdown/lib/handle/thematic-break.js +2 -0
- package/dist/node_modules/mdast-util-to-markdown/lib/handle/thematic-break.js.map +1 -0
- package/dist/node_modules/mdast-util-to-markdown/lib/util/check-bullet-ordered.js +2 -0
- package/dist/node_modules/mdast-util-to-markdown/lib/util/check-bullet-ordered.js.map +1 -0
- package/dist/node_modules/mdast-util-to-markdown/lib/util/check-bullet-other.js +2 -0
- package/dist/node_modules/mdast-util-to-markdown/lib/util/check-bullet-other.js.map +1 -0
- package/dist/node_modules/mdast-util-to-markdown/lib/util/check-bullet.js +2 -0
- package/dist/node_modules/mdast-util-to-markdown/lib/util/check-bullet.js.map +1 -0
- package/dist/node_modules/mdast-util-to-markdown/lib/util/check-emphasis.js +2 -0
- package/dist/node_modules/mdast-util-to-markdown/lib/util/check-emphasis.js.map +1 -0
- package/dist/node_modules/mdast-util-to-markdown/lib/util/check-fence.js +2 -0
- package/dist/node_modules/mdast-util-to-markdown/lib/util/check-fence.js.map +1 -0
- package/dist/node_modules/mdast-util-to-markdown/lib/util/check-list-item-indent.js +2 -0
- package/dist/node_modules/mdast-util-to-markdown/lib/util/check-list-item-indent.js.map +1 -0
- package/dist/node_modules/mdast-util-to-markdown/lib/util/check-quote.js +2 -0
- package/dist/node_modules/mdast-util-to-markdown/lib/util/check-quote.js.map +1 -0
- package/dist/node_modules/mdast-util-to-markdown/lib/util/check-rule-repetition.js +2 -0
- package/dist/node_modules/mdast-util-to-markdown/lib/util/check-rule-repetition.js.map +1 -0
- package/dist/node_modules/mdast-util-to-markdown/lib/util/check-rule.js +2 -0
- package/dist/node_modules/mdast-util-to-markdown/lib/util/check-rule.js.map +1 -0
- package/dist/node_modules/mdast-util-to-markdown/lib/util/check-strong.js +2 -0
- package/dist/node_modules/mdast-util-to-markdown/lib/util/check-strong.js.map +1 -0
- package/dist/node_modules/mdast-util-to-markdown/lib/util/encode-character-reference.js +2 -0
- package/dist/node_modules/mdast-util-to-markdown/lib/util/encode-character-reference.js.map +1 -0
- package/dist/node_modules/mdast-util-to-markdown/lib/util/encode-info.js +2 -0
- package/dist/node_modules/mdast-util-to-markdown/lib/util/encode-info.js.map +1 -0
- package/dist/node_modules/mdast-util-to-markdown/lib/util/format-code-as-indented.js +2 -0
- package/dist/node_modules/mdast-util-to-markdown/lib/util/format-code-as-indented.js.map +1 -0
- package/dist/node_modules/mdast-util-to-markdown/lib/util/format-heading-as-setext.js +2 -0
- package/dist/node_modules/mdast-util-to-markdown/lib/util/format-heading-as-setext.js.map +1 -0
- package/dist/node_modules/mdast-util-to-markdown/lib/util/format-link-as-autolink.js +2 -0
- package/dist/node_modules/mdast-util-to-markdown/lib/util/format-link-as-autolink.js.map +1 -0
- package/dist/node_modules/mdast-util-to-markdown/lib/util/pattern-in-scope.js +2 -0
- package/dist/node_modules/mdast-util-to-markdown/lib/util/pattern-in-scope.js.map +1 -0
- package/dist/node_modules/mdast-util-to-string/lib/index.js +2 -0
- package/dist/node_modules/mdast-util-to-string/lib/index.js.map +1 -0
- package/dist/node_modules/micromark-core-commonmark/lib/blank-line.js +2 -0
- package/dist/node_modules/micromark-core-commonmark/lib/blank-line.js.map +1 -0
- package/dist/node_modules/micromark-extension-gfm/index.js +2 -0
- package/dist/node_modules/micromark-extension-gfm/index.js.map +1 -0
- package/dist/node_modules/micromark-extension-gfm-autolink-literal/lib/syntax.js +2 -0
- package/dist/node_modules/micromark-extension-gfm-autolink-literal/lib/syntax.js.map +1 -0
- package/dist/node_modules/micromark-extension-gfm-footnote/lib/syntax.js +2 -0
- package/dist/node_modules/micromark-extension-gfm-footnote/lib/syntax.js.map +1 -0
- package/dist/node_modules/micromark-extension-gfm-strikethrough/lib/syntax.js +2 -0
- package/dist/node_modules/micromark-extension-gfm-strikethrough/lib/syntax.js.map +1 -0
- package/dist/node_modules/micromark-extension-gfm-table/lib/edit-map.js +2 -0
- package/dist/node_modules/micromark-extension-gfm-table/lib/edit-map.js.map +1 -0
- package/dist/node_modules/micromark-extension-gfm-table/lib/infer.js +2 -0
- package/dist/node_modules/micromark-extension-gfm-table/lib/infer.js.map +1 -0
- package/dist/node_modules/micromark-extension-gfm-table/lib/syntax.js +2 -0
- package/dist/node_modules/micromark-extension-gfm-table/lib/syntax.js.map +1 -0
- package/dist/node_modules/micromark-extension-gfm-task-list-item/lib/syntax.js +2 -0
- package/dist/node_modules/micromark-extension-gfm-task-list-item/lib/syntax.js.map +1 -0
- package/dist/node_modules/micromark-factory-space/index.js +2 -0
- package/dist/node_modules/micromark-factory-space/index.js.map +1 -0
- package/dist/node_modules/micromark-util-character/index.js +2 -0
- package/dist/node_modules/micromark-util-character/index.js.map +1 -0
- package/dist/node_modules/micromark-util-chunked/index.js +2 -0
- package/dist/node_modules/micromark-util-chunked/index.js.map +1 -0
- package/dist/node_modules/micromark-util-classify-character/index.js +2 -0
- package/dist/node_modules/micromark-util-classify-character/index.js.map +1 -0
- package/dist/node_modules/micromark-util-combine-extensions/index.js +2 -0
- package/dist/node_modules/micromark-util-combine-extensions/index.js.map +1 -0
- package/dist/node_modules/micromark-util-normalize-identifier/index.js +2 -0
- package/dist/node_modules/micromark-util-normalize-identifier/index.js.map +1 -0
- package/dist/node_modules/micromark-util-resolve-all/index.js +2 -0
- package/dist/node_modules/micromark-util-resolve-all/index.js.map +1 -0
- package/dist/node_modules/remark-gfm/lib/index.js +2 -0
- package/dist/node_modules/remark-gfm/lib/index.js.map +1 -0
- package/dist/types/src/features/CitationRenderer/MarkdownRenderer.d.ts +9 -0
- package/dist/types/src/features/CitationRenderer/MarkdownRenderer.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +1 -0
- package/dist/types/src/index.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"syntax.js","sources":["../../../../../node_modules/micromark-extension-gfm-table/lib/syntax.js"],"sourcesContent":["/**\n * @import {Event, Extension, Point, Resolver, State, Token, TokenizeContext, Tokenizer} from 'micromark-util-types'\n */\n\n/**\n * @typedef {[number, number, number, number]} Range\n * Cell info.\n *\n * @typedef {0 | 1 | 2 | 3} RowKind\n * Where we are: `1` for head row, `2` for delimiter row, `3` for body row.\n */\n\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownLineEnding, markdownLineEndingOrSpace, markdownSpace } from 'micromark-util-character';\nimport { EditMap } from './edit-map.js';\nimport { gfmTableAlign } from './infer.js';\n\n/**\n * Create an HTML extension for `micromark` to support GitHub tables syntax.\n *\n * @returns {Extension}\n * Extension for `micromark` that can be passed in `extensions` to enable GFM\n * table syntax.\n */\nexport function gfmTable() {\n return {\n flow: {\n null: {\n name: 'table',\n tokenize: tokenizeTable,\n resolveAll: resolveTable\n }\n }\n };\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeTable(effects, ok, nok) {\n const self = this;\n let size = 0;\n let sizeB = 0;\n /** @type {boolean | undefined} */\n let seen;\n return start;\n\n /**\n * Start of a GFM table.\n *\n * If there is a valid table row or table head before, then we try to parse\n * another row.\n * Otherwise, we try to parse a head.\n *\n * ```markdown\n * > | | a |\n * ^\n * | | - |\n * > | | b |\n * ^\n * ```\n * @type {State}\n */\n function start(code) {\n let index = self.events.length - 1;\n while (index > -1) {\n const type = self.events[index][1].type;\n if (type === \"lineEnding\" ||\n // Note: markdown-rs uses `whitespace` instead of `linePrefix`\n type === \"linePrefix\") index--;else break;\n }\n const tail = index > -1 ? self.events[index][1].type : null;\n const next = tail === 'tableHead' || tail === 'tableRow' ? bodyRowStart : headRowBefore;\n\n // Don’t allow lazy body rows.\n if (next === bodyRowStart && self.parser.lazy[self.now().line]) {\n return nok(code);\n }\n return next(code);\n }\n\n /**\n * Before table head row.\n *\n * ```markdown\n * > | | a |\n * ^\n * | | - |\n * | | b |\n * ```\n *\n * @type {State}\n */\n function headRowBefore(code) {\n effects.enter('tableHead');\n effects.enter('tableRow');\n return headRowStart(code);\n }\n\n /**\n * Before table head row, after whitespace.\n *\n * ```markdown\n * > | | a |\n * ^\n * | | - |\n * | | b |\n * ```\n *\n * @type {State}\n */\n function headRowStart(code) {\n if (code === 124) {\n return headRowBreak(code);\n }\n\n // To do: micromark-js should let us parse our own whitespace in extensions,\n // like `markdown-rs`:\n //\n // ```js\n // // 4+ spaces.\n // if (markdownSpace(code)) {\n // return nok(code)\n // }\n // ```\n\n seen = true;\n // Count the first character, that isn’t a pipe, double.\n sizeB += 1;\n return headRowBreak(code);\n }\n\n /**\n * At break in table head row.\n *\n * ```markdown\n * > | | a |\n * ^\n * ^\n * ^\n * | | - |\n * | | b |\n * ```\n *\n * @type {State}\n */\n function headRowBreak(code) {\n if (code === null) {\n // Note: in `markdown-rs`, we need to reset, in `micromark-js` we don‘t.\n return nok(code);\n }\n if (markdownLineEnding(code)) {\n // If anything other than one pipe (ignoring whitespace) was used, it’s fine.\n if (sizeB > 1) {\n sizeB = 0;\n // To do: check if this works.\n // Feel free to interrupt:\n self.interrupt = true;\n effects.exit('tableRow');\n effects.enter(\"lineEnding\");\n effects.consume(code);\n effects.exit(\"lineEnding\");\n return headDelimiterStart;\n }\n\n // Note: in `markdown-rs`, we need to reset, in `micromark-js` we don‘t.\n return nok(code);\n }\n if (markdownSpace(code)) {\n // To do: check if this is fine.\n // effects.attempt(State::Next(StateName::GfmTableHeadRowBreak), State::Nok)\n // State::Retry(space_or_tab(tokenizer))\n return factorySpace(effects, headRowBreak, \"whitespace\")(code);\n }\n sizeB += 1;\n if (seen) {\n seen = false;\n // Header cell count.\n size += 1;\n }\n if (code === 124) {\n effects.enter('tableCellDivider');\n effects.consume(code);\n effects.exit('tableCellDivider');\n // Whether a delimiter was seen.\n seen = true;\n return headRowBreak;\n }\n\n // Anything else is cell data.\n effects.enter(\"data\");\n return headRowData(code);\n }\n\n /**\n * In table head row data.\n *\n * ```markdown\n * > | | a |\n * ^\n * | | - |\n * | | b |\n * ```\n *\n * @type {State}\n */\n function headRowData(code) {\n if (code === null || code === 124 || markdownLineEndingOrSpace(code)) {\n effects.exit(\"data\");\n return headRowBreak(code);\n }\n effects.consume(code);\n return code === 92 ? headRowEscape : headRowData;\n }\n\n /**\n * In table head row escape.\n *\n * ```markdown\n * > | | a\\-b |\n * ^\n * | | ---- |\n * | | c |\n * ```\n *\n * @type {State}\n */\n function headRowEscape(code) {\n if (code === 92 || code === 124) {\n effects.consume(code);\n return headRowData;\n }\n return headRowData(code);\n }\n\n /**\n * Before delimiter row.\n *\n * ```markdown\n * | | a |\n * > | | - |\n * ^\n * | | b |\n * ```\n *\n * @type {State}\n */\n function headDelimiterStart(code) {\n // Reset `interrupt`.\n self.interrupt = false;\n\n // Note: in `markdown-rs`, we need to handle piercing here too.\n if (self.parser.lazy[self.now().line]) {\n return nok(code);\n }\n effects.enter('tableDelimiterRow');\n // Track if we’ve seen a `:` or `|`.\n seen = false;\n if (markdownSpace(code)) {\n return factorySpace(effects, headDelimiterBefore, \"linePrefix\", self.parser.constructs.disable.null.includes('codeIndented') ? undefined : 4)(code);\n }\n return headDelimiterBefore(code);\n }\n\n /**\n * Before delimiter row, after optional whitespace.\n *\n * Reused when a `|` is found later, to parse another cell.\n *\n * ```markdown\n * | | a |\n * > | | - |\n * ^\n * | | b |\n * ```\n *\n * @type {State}\n */\n function headDelimiterBefore(code) {\n if (code === 45 || code === 58) {\n return headDelimiterValueBefore(code);\n }\n if (code === 124) {\n seen = true;\n // If we start with a pipe, we open a cell marker.\n effects.enter('tableCellDivider');\n effects.consume(code);\n effects.exit('tableCellDivider');\n return headDelimiterCellBefore;\n }\n\n // More whitespace / empty row not allowed at start.\n return headDelimiterNok(code);\n }\n\n /**\n * After `|`, before delimiter cell.\n *\n * ```markdown\n * | | a |\n * > | | - |\n * ^\n * ```\n *\n * @type {State}\n */\n function headDelimiterCellBefore(code) {\n if (markdownSpace(code)) {\n return factorySpace(effects, headDelimiterValueBefore, \"whitespace\")(code);\n }\n return headDelimiterValueBefore(code);\n }\n\n /**\n * Before delimiter cell value.\n *\n * ```markdown\n * | | a |\n * > | | - |\n * ^\n * ```\n *\n * @type {State}\n */\n function headDelimiterValueBefore(code) {\n // Align: left.\n if (code === 58) {\n sizeB += 1;\n seen = true;\n effects.enter('tableDelimiterMarker');\n effects.consume(code);\n effects.exit('tableDelimiterMarker');\n return headDelimiterLeftAlignmentAfter;\n }\n\n // Align: none.\n if (code === 45) {\n sizeB += 1;\n // To do: seems weird that this *isn’t* left aligned, but that state is used?\n return headDelimiterLeftAlignmentAfter(code);\n }\n if (code === null || markdownLineEnding(code)) {\n return headDelimiterCellAfter(code);\n }\n return headDelimiterNok(code);\n }\n\n /**\n * After delimiter cell left alignment marker.\n *\n * ```markdown\n * | | a |\n * > | | :- |\n * ^\n * ```\n *\n * @type {State}\n */\n function headDelimiterLeftAlignmentAfter(code) {\n if (code === 45) {\n effects.enter('tableDelimiterFiller');\n return headDelimiterFiller(code);\n }\n\n // Anything else is not ok after the left-align colon.\n return headDelimiterNok(code);\n }\n\n /**\n * In delimiter cell filler.\n *\n * ```markdown\n * | | a |\n * > | | - |\n * ^\n * ```\n *\n * @type {State}\n */\n function headDelimiterFiller(code) {\n if (code === 45) {\n effects.consume(code);\n return headDelimiterFiller;\n }\n\n // Align is `center` if it was `left`, `right` otherwise.\n if (code === 58) {\n seen = true;\n effects.exit('tableDelimiterFiller');\n effects.enter('tableDelimiterMarker');\n effects.consume(code);\n effects.exit('tableDelimiterMarker');\n return headDelimiterRightAlignmentAfter;\n }\n effects.exit('tableDelimiterFiller');\n return headDelimiterRightAlignmentAfter(code);\n }\n\n /**\n * After delimiter cell right alignment marker.\n *\n * ```markdown\n * | | a |\n * > | | -: |\n * ^\n * ```\n *\n * @type {State}\n */\n function headDelimiterRightAlignmentAfter(code) {\n if (markdownSpace(code)) {\n return factorySpace(effects, headDelimiterCellAfter, \"whitespace\")(code);\n }\n return headDelimiterCellAfter(code);\n }\n\n /**\n * After delimiter cell.\n *\n * ```markdown\n * | | a |\n * > | | -: |\n * ^\n * ```\n *\n * @type {State}\n */\n function headDelimiterCellAfter(code) {\n if (code === 124) {\n return headDelimiterBefore(code);\n }\n if (code === null || markdownLineEnding(code)) {\n // Exit when:\n // * there was no `:` or `|` at all (it’s a thematic break or setext\n // underline instead)\n // * the header cell count is not the delimiter cell count\n if (!seen || size !== sizeB) {\n return headDelimiterNok(code);\n }\n\n // Note: in markdown-rs`, a reset is needed here.\n effects.exit('tableDelimiterRow');\n effects.exit('tableHead');\n // To do: in `markdown-rs`, resolvers need to be registered manually.\n // effects.register_resolver(ResolveName::GfmTable)\n return ok(code);\n }\n return headDelimiterNok(code);\n }\n\n /**\n * In delimiter row, at a disallowed byte.\n *\n * ```markdown\n * | | a |\n * > | | x |\n * ^\n * ```\n *\n * @type {State}\n */\n function headDelimiterNok(code) {\n // Note: in `markdown-rs`, we need to reset, in `micromark-js` we don‘t.\n return nok(code);\n }\n\n /**\n * Before table body row.\n *\n * ```markdown\n * | | a |\n * | | - |\n * > | | b |\n * ^\n * ```\n *\n * @type {State}\n */\n function bodyRowStart(code) {\n // Note: in `markdown-rs` we need to manually take care of a prefix,\n // but in `micromark-js` that is done for us, so if we’re here, we’re\n // never at whitespace.\n effects.enter('tableRow');\n return bodyRowBreak(code);\n }\n\n /**\n * At break in table body row.\n *\n * ```markdown\n * | | a |\n * | | - |\n * > | | b |\n * ^\n * ^\n * ^\n * ```\n *\n * @type {State}\n */\n function bodyRowBreak(code) {\n if (code === 124) {\n effects.enter('tableCellDivider');\n effects.consume(code);\n effects.exit('tableCellDivider');\n return bodyRowBreak;\n }\n if (code === null || markdownLineEnding(code)) {\n effects.exit('tableRow');\n return ok(code);\n }\n if (markdownSpace(code)) {\n return factorySpace(effects, bodyRowBreak, \"whitespace\")(code);\n }\n\n // Anything else is cell content.\n effects.enter(\"data\");\n return bodyRowData(code);\n }\n\n /**\n * In table body row data.\n *\n * ```markdown\n * | | a |\n * | | - |\n * > | | b |\n * ^\n * ```\n *\n * @type {State}\n */\n function bodyRowData(code) {\n if (code === null || code === 124 || markdownLineEndingOrSpace(code)) {\n effects.exit(\"data\");\n return bodyRowBreak(code);\n }\n effects.consume(code);\n return code === 92 ? bodyRowEscape : bodyRowData;\n }\n\n /**\n * In table body row escape.\n *\n * ```markdown\n * | | a |\n * | | ---- |\n * > | | b\\-c |\n * ^\n * ```\n *\n * @type {State}\n */\n function bodyRowEscape(code) {\n if (code === 92 || code === 124) {\n effects.consume(code);\n return bodyRowData;\n }\n return bodyRowData(code);\n }\n}\n\n/** @type {Resolver} */\n\nfunction resolveTable(events, context) {\n let index = -1;\n let inFirstCellAwaitingPipe = true;\n /** @type {RowKind} */\n let rowKind = 0;\n /** @type {Range} */\n let lastCell = [0, 0, 0, 0];\n /** @type {Range} */\n let cell = [0, 0, 0, 0];\n let afterHeadAwaitingFirstBodyRow = false;\n let lastTableEnd = 0;\n /** @type {Token | undefined} */\n let currentTable;\n /** @type {Token | undefined} */\n let currentBody;\n /** @type {Token | undefined} */\n let currentCell;\n const map = new EditMap();\n while (++index < events.length) {\n const event = events[index];\n const token = event[1];\n if (event[0] === 'enter') {\n // Start of head.\n if (token.type === 'tableHead') {\n afterHeadAwaitingFirstBodyRow = false;\n\n // Inject previous (body end and) table end.\n if (lastTableEnd !== 0) {\n flushTableEnd(map, context, lastTableEnd, currentTable, currentBody);\n currentBody = undefined;\n lastTableEnd = 0;\n }\n\n // Inject table start.\n currentTable = {\n type: 'table',\n start: Object.assign({}, token.start),\n // Note: correct end is set later.\n end: Object.assign({}, token.end)\n };\n map.add(index, 0, [['enter', currentTable, context]]);\n } else if (token.type === 'tableRow' || token.type === 'tableDelimiterRow') {\n inFirstCellAwaitingPipe = true;\n currentCell = undefined;\n lastCell = [0, 0, 0, 0];\n cell = [0, index + 1, 0, 0];\n\n // Inject table body start.\n if (afterHeadAwaitingFirstBodyRow) {\n afterHeadAwaitingFirstBodyRow = false;\n currentBody = {\n type: 'tableBody',\n start: Object.assign({}, token.start),\n // Note: correct end is set later.\n end: Object.assign({}, token.end)\n };\n map.add(index, 0, [['enter', currentBody, context]]);\n }\n rowKind = token.type === 'tableDelimiterRow' ? 2 : currentBody ? 3 : 1;\n }\n // Cell data.\n else if (rowKind && (token.type === \"data\" || token.type === 'tableDelimiterMarker' || token.type === 'tableDelimiterFiller')) {\n inFirstCellAwaitingPipe = false;\n\n // First value in cell.\n if (cell[2] === 0) {\n if (lastCell[1] !== 0) {\n cell[0] = cell[1];\n currentCell = flushCell(map, context, lastCell, rowKind, undefined, currentCell);\n lastCell = [0, 0, 0, 0];\n }\n cell[2] = index;\n }\n } else if (token.type === 'tableCellDivider') {\n if (inFirstCellAwaitingPipe) {\n inFirstCellAwaitingPipe = false;\n } else {\n if (lastCell[1] !== 0) {\n cell[0] = cell[1];\n currentCell = flushCell(map, context, lastCell, rowKind, undefined, currentCell);\n }\n lastCell = cell;\n cell = [lastCell[1], index, 0, 0];\n }\n }\n }\n // Exit events.\n else if (token.type === 'tableHead') {\n afterHeadAwaitingFirstBodyRow = true;\n lastTableEnd = index;\n } else if (token.type === 'tableRow' || token.type === 'tableDelimiterRow') {\n lastTableEnd = index;\n if (lastCell[1] !== 0) {\n cell[0] = cell[1];\n currentCell = flushCell(map, context, lastCell, rowKind, index, currentCell);\n } else if (cell[1] !== 0) {\n currentCell = flushCell(map, context, cell, rowKind, index, currentCell);\n }\n rowKind = 0;\n } else if (rowKind && (token.type === \"data\" || token.type === 'tableDelimiterMarker' || token.type === 'tableDelimiterFiller')) {\n cell[3] = index;\n }\n }\n if (lastTableEnd !== 0) {\n flushTableEnd(map, context, lastTableEnd, currentTable, currentBody);\n }\n map.consume(context.events);\n\n // To do: move this into `html`, when events are exposed there.\n // That’s what `markdown-rs` does.\n // That needs updates to `mdast-util-gfm-table`.\n index = -1;\n while (++index < context.events.length) {\n const event = context.events[index];\n if (event[0] === 'enter' && event[1].type === 'table') {\n event[1]._align = gfmTableAlign(context.events, index);\n }\n }\n return events;\n}\n\n/**\n * Generate a cell.\n *\n * @param {EditMap} map\n * @param {Readonly<TokenizeContext>} context\n * @param {Readonly<Range>} range\n * @param {RowKind} rowKind\n * @param {number | undefined} rowEnd\n * @param {Token | undefined} previousCell\n * @returns {Token | undefined}\n */\n// eslint-disable-next-line max-params\nfunction flushCell(map, context, range, rowKind, rowEnd, previousCell) {\n // `markdown-rs` uses:\n // rowKind === 2 ? 'tableDelimiterCell' : 'tableCell'\n const groupName = rowKind === 1 ? 'tableHeader' : rowKind === 2 ? 'tableDelimiter' : 'tableData';\n // `markdown-rs` uses:\n // rowKind === 2 ? 'tableDelimiterCellValue' : 'tableCellText'\n const valueName = 'tableContent';\n\n // Insert an exit for the previous cell, if there is one.\n //\n // ```markdown\n // > | | aa | bb | cc |\n // ^-- exit\n // ^^^^-- this cell\n // ```\n if (range[0] !== 0) {\n previousCell.end = Object.assign({}, getPoint(context.events, range[0]));\n map.add(range[0], 0, [['exit', previousCell, context]]);\n }\n\n // Insert enter of this cell.\n //\n // ```markdown\n // > | | aa | bb | cc |\n // ^-- enter\n // ^^^^-- this cell\n // ```\n const now = getPoint(context.events, range[1]);\n previousCell = {\n type: groupName,\n start: Object.assign({}, now),\n // Note: correct end is set later.\n end: Object.assign({}, now)\n };\n map.add(range[1], 0, [['enter', previousCell, context]]);\n\n // Insert text start at first data start and end at last data end, and\n // remove events between.\n //\n // ```markdown\n // > | | aa | bb | cc |\n // ^-- enter\n // ^-- exit\n // ^^^^-- this cell\n // ```\n if (range[2] !== 0) {\n const relatedStart = getPoint(context.events, range[2]);\n const relatedEnd = getPoint(context.events, range[3]);\n /** @type {Token} */\n const valueToken = {\n type: valueName,\n start: Object.assign({}, relatedStart),\n end: Object.assign({}, relatedEnd)\n };\n map.add(range[2], 0, [['enter', valueToken, context]]);\n if (rowKind !== 2) {\n // Fix positional info on remaining events\n const start = context.events[range[2]];\n const end = context.events[range[3]];\n start[1].end = Object.assign({}, end[1].end);\n start[1].type = \"chunkText\";\n start[1].contentType = \"text\";\n\n // Remove if needed.\n if (range[3] > range[2] + 1) {\n const a = range[2] + 1;\n const b = range[3] - range[2] - 1;\n map.add(a, b, []);\n }\n }\n map.add(range[3] + 1, 0, [['exit', valueToken, context]]);\n }\n\n // Insert an exit for the last cell, if at the row end.\n //\n // ```markdown\n // > | | aa | bb | cc |\n // ^-- exit\n // ^^^^^^-- this cell (the last one contains two “between” parts)\n // ```\n if (rowEnd !== undefined) {\n previousCell.end = Object.assign({}, getPoint(context.events, rowEnd));\n map.add(rowEnd, 0, [['exit', previousCell, context]]);\n previousCell = undefined;\n }\n return previousCell;\n}\n\n/**\n * Generate table end (and table body end).\n *\n * @param {Readonly<EditMap>} map\n * @param {Readonly<TokenizeContext>} context\n * @param {number} index\n * @param {Token} table\n * @param {Token | undefined} tableBody\n */\n// eslint-disable-next-line max-params\nfunction flushTableEnd(map, context, index, table, tableBody) {\n /** @type {Array<Event>} */\n const exits = [];\n const related = getPoint(context.events, index);\n if (tableBody) {\n tableBody.end = Object.assign({}, related);\n exits.push(['exit', tableBody, context]);\n }\n table.end = Object.assign({}, related);\n exits.push(['exit', table, context]);\n map.add(index + 1, 0, exits);\n}\n\n/**\n * @param {Readonly<Array<Event>>} events\n * @param {number} index\n * @returns {Readonly<Point>}\n */\nfunction getPoint(events, index) {\n const event = events[index];\n const side = event[0] === 'enter' ? 'start' : 'end';\n return event[1][side];\n}"],"names":["tokenizeTable","effects","ok","nok","self","this","seen","size","sizeB","code","index","events","length","type","tail","next","bodyRowStart","headRowBefore","parser","lazy","now","line","enter","headRowBreak","headRowStart","markdownLineEnding","interrupt","exit","consume","headDelimiterStart","markdownSpace","factorySpace","headRowData","markdownLineEndingOrSpace","headRowEscape","headDelimiterBefore","constructs","disable","null","includes","undefined","headDelimiterValueBefore","headDelimiterCellBefore","headDelimiterNok","headDelimiterLeftAlignmentAfter","headDelimiterCellAfter","headDelimiterFiller","headDelimiterRightAlignmentAfter","bodyRowBreak","bodyRowData","bodyRowEscape","resolveTable","context","currentTable","currentBody","currentCell","inFirstCellAwaitingPipe","rowKind","lastCell","cell","afterHeadAwaitingFirstBodyRow","lastTableEnd","map","EditMap","event","token","flushTableEnd","start","Object","assign","end","add","flushCell","_align","gfmTableAlign","range","rowEnd","previousCell","groupName","getPoint","relatedStart","relatedEnd","valueToken","contentType","a","b","table","tableBody","exits","related","push","side","flow","name","tokenize","resolveAll"],"mappings":"oOAwCA,SAASA,EAAcC,EAASC,EAAIC,GAClC,MAAMC,EAAOC,KACb,IAGIC,EAHAC,EAAO,EACPC,EAAQ,E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Y9B,IAChD,CAcD,YALeZ,IAAXoC,IACFC,EAAaP,IAAMF,OAAOC,OAAO,CAAA,EAAIU,EAAS3B,EAAQzC,OAAQiE,IAC9Dd,EAAIS,IAAIK,EAAQ,EAAG,CAAC,CAAC,OAAQC,EAAczB,KAC3CyB,OAAerC,GAEVqC,CACT,CAYA,SAASX,EAAcJ,EAAKV,EAAS1C,EAAO4E,EAAOC,GAEjD,MAAMC,EAAQ,GACRC,EAAUV,EAAS3B,EAAQzC,OAAQD,GACrC6E,IACFA,EAAUjB,IAAMF,OAAOC,OAAO,CAAE,EAAEoB,GAClCD,EAAME,KAAK,CAAC,OAAQH,EAAWnC,KAEjCkC,EAAMhB,IAAMF,OAAOC,OAAO,CAAE,EAAEoB,GAC9BD,EAAME,KAAK,CAAC,OAAQJ,EAAOlC,IAC3BU,EAAIS,IAAI7D,EAAQ,EAAG,EAAG8E,EACxB,CAOA,SAAST,EAASpE,EAAQD,GACxB,MAAMsD,EAAQrD,EAAOD,GACfiF,EAAoB,UAAb3B,EAAM,GAAiB,QAAU,MAC9C,OAAOA,EAAM,GAAG2B,EAClB,kBA1xBO,WACL,MAAO,CACLC,KAAM,CACJtD,KAAM,CACJuD,KAAM,QACNC,SAAU9F,EACV+F,WAAY5C,IAIpB"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../micromark-factory-space/index.js"),t=require("../../micromark-util-character/index.js");const n={name:"tasklistCheck",tokenize:function(e,n,i){const c=this;return function(t){if(null!==c.previous||!c._gfmTasklistFirstContentOfListItem)return i(t);return e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(t),e.exit("taskListCheckMarker"),s};function s(n){return t.markdownLineEndingOrSpace(n)?(e.enter("taskListCheckValueUnchecked"),e.consume(n),e.exit("taskListCheckValueUnchecked"),k):88===n||120===n?(e.enter("taskListCheckValueChecked"),e.consume(n),e.exit("taskListCheckValueChecked"),k):i(n)}function k(t){return 93===t?(e.enter("taskListCheckMarker"),e.consume(t),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):i(t)}function a(c){return t.markdownLineEnding(c)?n(c):t.markdownSpace(c)?e.check({tokenize:r},n,i)(c):i(c)}}};function r(t,n,r){return e.factorySpace(t,(function(e){return null===e?r(e):n(e)}),"whitespace")}exports.gfmTaskListItem=function(){return{text:{91:n}}};
|
|
2
|
+
//# sourceMappingURL=syntax.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"syntax.js","sources":["../../../../../node_modules/micromark-extension-gfm-task-list-item/lib/syntax.js"],"sourcesContent":["/**\n * @import {Extension, State, TokenizeContext, Tokenizer} from 'micromark-util-types'\n */\n\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownLineEnding, markdownLineEndingOrSpace, markdownSpace } from 'micromark-util-character';\nconst tasklistCheck = {\n name: 'tasklistCheck',\n tokenize: tokenizeTasklistCheck\n};\n\n/**\n * Create an HTML extension for `micromark` to support GFM task list items\n * syntax.\n *\n * @returns {Extension}\n * Extension for `micromark` that can be passed in `htmlExtensions` to\n * support GFM task list items when serializing to HTML.\n */\nexport function gfmTaskListItem() {\n return {\n text: {\n [91]: tasklistCheck\n }\n };\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeTasklistCheck(effects, ok, nok) {\n const self = this;\n return open;\n\n /**\n * At start of task list item check.\n *\n * ```markdown\n * > | * [x] y.\n * ^\n * ```\n *\n * @type {State}\n */\n function open(code) {\n if (\n // Exit if there’s stuff before.\n self.previous !== null ||\n // Exit if not in the first content that is the first child of a list\n // item.\n !self._gfmTasklistFirstContentOfListItem) {\n return nok(code);\n }\n effects.enter('taskListCheck');\n effects.enter('taskListCheckMarker');\n effects.consume(code);\n effects.exit('taskListCheckMarker');\n return inside;\n }\n\n /**\n * In task list item check.\n *\n * ```markdown\n * > | * [x] y.\n * ^\n * ```\n *\n * @type {State}\n */\n function inside(code) {\n // Currently we match how GH works in files.\n // To match how GH works in comments, use `markdownSpace` (`[\\t ]`) instead\n // of `markdownLineEndingOrSpace` (`[\\t\\n\\r ]`).\n if (markdownLineEndingOrSpace(code)) {\n effects.enter('taskListCheckValueUnchecked');\n effects.consume(code);\n effects.exit('taskListCheckValueUnchecked');\n return close;\n }\n if (code === 88 || code === 120) {\n effects.enter('taskListCheckValueChecked');\n effects.consume(code);\n effects.exit('taskListCheckValueChecked');\n return close;\n }\n return nok(code);\n }\n\n /**\n * At close of task list item check.\n *\n * ```markdown\n * > | * [x] y.\n * ^\n * ```\n *\n * @type {State}\n */\n function close(code) {\n if (code === 93) {\n effects.enter('taskListCheckMarker');\n effects.consume(code);\n effects.exit('taskListCheckMarker');\n effects.exit('taskListCheck');\n return after;\n }\n return nok(code);\n }\n\n /**\n * @type {State}\n */\n function after(code) {\n // EOL in paragraph means there must be something else after it.\n if (markdownLineEnding(code)) {\n return ok(code);\n }\n\n // Space or tab?\n // Check what comes after.\n if (markdownSpace(code)) {\n return effects.check({\n tokenize: spaceThenNonSpace\n }, ok, nok)(code);\n }\n\n // EOF, or non-whitespace, both wrong.\n return nok(code);\n }\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction spaceThenNonSpace(effects, ok, nok) {\n return factorySpace(effects, after, \"whitespace\");\n\n /**\n * After whitespace, after task list item check.\n *\n * ```markdown\n * > | * [x] y.\n * ^\n * ```\n *\n * @type {State}\n */\n function after(code) {\n // EOF means there was nothing, so bad.\n // EOL means there’s content after it, so good.\n // Impossible to have more spaces.\n // Anything else is good.\n return code === null ? nok(code) : ok(code);\n }\n}"],"names":["tasklistCheck","name","tokenize","effects","ok","nok","self","this","code","previous","_gfmTasklistFirstContentOfListItem","enter","consume","exit","inside","markdownLineEndingOrSpace","close","after","markdownLineEnding","markdownSpace","check","spaceThenNonSpace","factorySpace","text"],"mappings":"iLAMA,MAAMA,EAAgB,CACpBC,KAAM,gBACNC,SAuBF,SAA+BC,EAASC,EAAIC,GAC1C,MAAMC,EAAOC,KACb,OAYA,SAAcC,GACZ,GAEkB,OAAlBF,EAAKG,WAGJH,EAAKI,mCACJ,OAAOL,EAAIG,GAMb,OAJAL,EAAQQ,MAAM,iBACdR,EAAQQ,MAAM,uBACdR,EAAQS,QAAQJ,GAChBL,EAAQU,KAAK,uBACNC,CACR,EAYD,SAASA,EAAON,GAId,OAAIO,EAAAA,0BAA0BP,IAC5BL,EAAQQ,MAAM,+BACdR,EAAQS,QAAQJ,GAChBL,EAAQU,KAAK,+BACNG,GAEI,KAATR,GAAwB,MAATA,GACjBL,EAAQQ,MAAM,6BACdR,EAAQS,QAAQJ,GAChBL,EAAQU,KAAK,6BACNG,GAEFX,EAAIG,EACZ,CAYD,SAASQ,EAAMR,GACb,OAAa,KAATA,GACFL,EAAQQ,MAAM,uBACdR,EAAQS,QAAQJ,GAChBL,EAAQU,KAAK,uBACbV,EAAQU,KAAK,iBACNI,GAEFZ,EAAIG,EACZ,CAKD,SAASS,EAAMT,GAEb,OAAIU,EAAAA,mBAAmBV,GACdJ,EAAGI,GAKRW,EAAAA,cAAcX,GACTL,EAAQiB,MAAM,CACnBlB,SAAUmB,GACTjB,EAAIC,EAFAF,CAEKK,GAIPH,EAAIG,EACZ,CACH,GAMA,SAASa,EAAkBlB,EAASC,EAAIC,GACtC,OAAOiB,eAAanB,GAYpB,SAAeK,GAKb,OAAgB,OAATA,EAAgBH,EAAIG,GAAQJ,EAAGI,EACvC,GAlBmC,aAmBtC,yBA1IO,WACL,MAAO,CACLe,KAAM,CACJ,GAAMvB,GAGZ"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../micromark-util-character/index.js");exports.factorySpace=function(r,t,n,c){const u=c?c-1:Number.POSITIVE_INFINITY;let o=0;return function(c){if(e.markdownSpace(c))return r.enter(n),a(c);return t(c)};function a(c){return e.markdownSpace(c)&&o++<u?(r.consume(c),a):(r.exit(n),t(c))}};
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../node_modules/micromark-factory-space/index.js"],"sourcesContent":["/**\n * @import {Effects, State, TokenType} from 'micromark-util-types'\n */\n\nimport { markdownSpace } from 'micromark-util-character';\n\n// To do: implement `spaceOrTab`, `spaceOrTabMinMax`, `spaceOrTabWithOptions`.\n\n/**\n * Parse spaces and tabs.\n *\n * There is no `nok` parameter:\n *\n * * spaces in markdown are often optional, in which case this factory can be\n * used and `ok` will be switched to whether spaces were found or not\n * * one line ending or space can be detected with `markdownSpace(code)` right\n * before using `factorySpace`\n *\n * ###### Examples\n *\n * Where `␉` represents a tab (plus how much it expands) and `␠` represents a\n * single space.\n *\n * ```markdown\n * ␉\n * ␠␠␠␠\n * ␉␠\n * ```\n *\n * @param {Effects} effects\n * Context.\n * @param {State} ok\n * State switched to when successful.\n * @param {TokenType} type\n * Type (`' \\t'`).\n * @param {number | undefined} [max=Infinity]\n * Max (exclusive).\n * @returns {State}\n * Start state.\n */\nexport function factorySpace(effects, ok, type, max) {\n const limit = max ? max - 1 : Number.POSITIVE_INFINITY;\n let size = 0;\n return start;\n\n /** @type {State} */\n function start(code) {\n if (markdownSpace(code)) {\n effects.enter(type);\n return prefix(code);\n }\n return ok(code);\n }\n\n /** @type {State} */\n function prefix(code) {\n if (markdownSpace(code) && size++ < limit) {\n effects.consume(code);\n return prefix;\n }\n effects.exit(type);\n return ok(code);\n }\n}"],"names":["effects","ok","type","max","limit","Number","POSITIVE_INFINITY","size","code","markdownSpace","enter","prefix","consume","exit"],"mappings":"+IAwCO,SAAsBA,EAASC,EAAIC,EAAMC,GAC9C,MAAMC,EAAQD,EAAMA,EAAM,EAAIE,OAAOC,kBACrC,IAAIC,EAAO,EACX,OAGA,SAAeC,GACb,GAAIC,EAAAA,cAAcD,GAEhB,OADAR,EAAQU,MAAMR,GACPS,EAAOH,GAEhB,OAAOP,EAAGO,EACX,EAGD,SAASG,EAAOH,GACd,OAAIC,EAAaA,cAACD,IAASD,IAASH,GAClCJ,EAAQY,QAAQJ,GACTG,IAETX,EAAQa,KAAKX,GACND,EAAGO,GACX,CACH"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const n=o(/[A-Za-z]/),e=o(/[\dA-Za-z]/);const t=o(/\p{P}|\p{S}/u),r=o(/\s/);function o(n){return function(e){return null!==e&&e>-1&&n.test(String.fromCharCode(e))}}exports.asciiAlpha=n,exports.asciiAlphanumeric=e,exports.asciiControl=function(n){return null!==n&&(n<32||127===n)},exports.markdownLineEnding=function(n){return null!==n&&n<-2},exports.markdownLineEndingOrSpace=function(n){return null!==n&&(n<0||32===n)},exports.markdownSpace=function(n){return-2===n||-1===n||32===n},exports.unicodePunctuation=t,exports.unicodeWhitespace=r;
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../node_modules/micromark-util-character/index.js"],"sourcesContent":["/**\n * @import {Code} from 'micromark-util-types'\n */\n\n/**\n * Check whether the character code represents an ASCII alpha (`a` through `z`,\n * case insensitive).\n *\n * An **ASCII alpha** is an ASCII upper alpha or ASCII lower alpha.\n *\n * An **ASCII upper alpha** is a character in the inclusive range U+0041 (`A`)\n * to U+005A (`Z`).\n *\n * An **ASCII lower alpha** is a character in the inclusive range U+0061 (`a`)\n * to U+007A (`z`).\n *\n * @param code\n * Code.\n * @returns {boolean}\n * Whether it matches.\n */\nexport const asciiAlpha = regexCheck(/[A-Za-z]/);\n\n/**\n * Check whether the character code represents an ASCII alphanumeric (`a`\n * through `z`, case insensitive, or `0` through `9`).\n *\n * An **ASCII alphanumeric** is an ASCII digit (see `asciiDigit`) or ASCII alpha\n * (see `asciiAlpha`).\n *\n * @param code\n * Code.\n * @returns {boolean}\n * Whether it matches.\n */\nexport const asciiAlphanumeric = regexCheck(/[\\dA-Za-z]/);\n\n/**\n * Check whether the character code represents an ASCII atext.\n *\n * atext is an ASCII alphanumeric (see `asciiAlphanumeric`), or a character in\n * the inclusive ranges U+0023 NUMBER SIGN (`#`) to U+0027 APOSTROPHE (`'`),\n * U+002A ASTERISK (`*`), U+002B PLUS SIGN (`+`), U+002D DASH (`-`), U+002F\n * SLASH (`/`), U+003D EQUALS TO (`=`), U+003F QUESTION MARK (`?`), U+005E\n * CARET (`^`) to U+0060 GRAVE ACCENT (`` ` ``), or U+007B LEFT CURLY BRACE\n * (`{`) to U+007E TILDE (`~`).\n *\n * See:\n * **\\[RFC5322]**:\n * [Internet Message Format](https://tools.ietf.org/html/rfc5322).\n * P. Resnick.\n * IETF.\n *\n * @param code\n * Code.\n * @returns {boolean}\n * Whether it matches.\n */\nexport const asciiAtext = regexCheck(/[#-'*+\\--9=?A-Z^-~]/);\n\n/**\n * Check whether a character code is an ASCII control character.\n *\n * An **ASCII control** is a character in the inclusive range U+0000 NULL (NUL)\n * to U+001F (US), or U+007F (DEL).\n *\n * @param {Code} code\n * Code.\n * @returns {boolean}\n * Whether it matches.\n */\nexport function asciiControl(code) {\n return (\n // Special whitespace codes (which have negative values), C0 and Control\n // character DEL\n code !== null && (code < 32 || code === 127)\n );\n}\n\n/**\n * Check whether the character code represents an ASCII digit (`0` through `9`).\n *\n * An **ASCII digit** is a character in the inclusive range U+0030 (`0`) to\n * U+0039 (`9`).\n *\n * @param code\n * Code.\n * @returns {boolean}\n * Whether it matches.\n */\nexport const asciiDigit = regexCheck(/\\d/);\n\n/**\n * Check whether the character code represents an ASCII hex digit (`a` through\n * `f`, case insensitive, or `0` through `9`).\n *\n * An **ASCII hex digit** is an ASCII digit (see `asciiDigit`), ASCII upper hex\n * digit, or an ASCII lower hex digit.\n *\n * An **ASCII upper hex digit** is a character in the inclusive range U+0041\n * (`A`) to U+0046 (`F`).\n *\n * An **ASCII lower hex digit** is a character in the inclusive range U+0061\n * (`a`) to U+0066 (`f`).\n *\n * @param code\n * Code.\n * @returns {boolean}\n * Whether it matches.\n */\nexport const asciiHexDigit = regexCheck(/[\\dA-Fa-f]/);\n\n/**\n * Check whether the character code represents ASCII punctuation.\n *\n * An **ASCII punctuation** is a character in the inclusive ranges U+0021\n * EXCLAMATION MARK (`!`) to U+002F SLASH (`/`), U+003A COLON (`:`) to U+0040 AT\n * SIGN (`@`), U+005B LEFT SQUARE BRACKET (`[`) to U+0060 GRAVE ACCENT\n * (`` ` ``), or U+007B LEFT CURLY BRACE (`{`) to U+007E TILDE (`~`).\n *\n * @param code\n * Code.\n * @returns {boolean}\n * Whether it matches.\n */\nexport const asciiPunctuation = regexCheck(/[!-/:-@[-`{-~]/);\n\n/**\n * Check whether a character code is a markdown line ending.\n *\n * A **markdown line ending** is the virtual characters M-0003 CARRIAGE RETURN\n * LINE FEED (CRLF), M-0004 LINE FEED (LF) and M-0005 CARRIAGE RETURN (CR).\n *\n * In micromark, the actual character U+000A LINE FEED (LF) and U+000D CARRIAGE\n * RETURN (CR) are replaced by these virtual characters depending on whether\n * they occurred together.\n *\n * @param {Code} code\n * Code.\n * @returns {boolean}\n * Whether it matches.\n */\nexport function markdownLineEnding(code) {\n return code !== null && code < -2;\n}\n\n/**\n * Check whether a character code is a markdown line ending (see\n * `markdownLineEnding`) or markdown space (see `markdownSpace`).\n *\n * @param {Code} code\n * Code.\n * @returns {boolean}\n * Whether it matches.\n */\nexport function markdownLineEndingOrSpace(code) {\n return code !== null && (code < 0 || code === 32);\n}\n\n/**\n * Check whether a character code is a markdown space.\n *\n * A **markdown space** is the concrete character U+0020 SPACE (SP) and the\n * virtual characters M-0001 VIRTUAL SPACE (VS) and M-0002 HORIZONTAL TAB (HT).\n *\n * In micromark, the actual character U+0009 CHARACTER TABULATION (HT) is\n * replaced by one M-0002 HORIZONTAL TAB (HT) and between 0 and 3 M-0001 VIRTUAL\n * SPACE (VS) characters, depending on the column at which the tab occurred.\n *\n * @param {Code} code\n * Code.\n * @returns {boolean}\n * Whether it matches.\n */\nexport function markdownSpace(code) {\n return code === -2 || code === -1 || code === 32;\n}\n\n// Size note: removing ASCII from the regex and using `asciiPunctuation` here\n// In fact adds to the bundle size.\n/**\n * Check whether the character code represents Unicode punctuation.\n *\n * A **Unicode punctuation** is a character in the Unicode `Pc` (Punctuation,\n * Connector), `Pd` (Punctuation, Dash), `Pe` (Punctuation, Close), `Pf`\n * (Punctuation, Final quote), `Pi` (Punctuation, Initial quote), `Po`\n * (Punctuation, Other), or `Ps` (Punctuation, Open) categories, or an ASCII\n * punctuation (see `asciiPunctuation`).\n *\n * See:\n * **\\[UNICODE]**:\n * [The Unicode Standard](https://www.unicode.org/versions/).\n * Unicode Consortium.\n *\n * @param code\n * Code.\n * @returns\n * Whether it matches.\n */\nexport const unicodePunctuation = regexCheck(/\\p{P}|\\p{S}/u);\n\n/**\n * Check whether the character code represents Unicode whitespace.\n *\n * Note that this does handle micromark specific markdown whitespace characters.\n * See `markdownLineEndingOrSpace` to check that.\n *\n * A **Unicode whitespace** is a character in the Unicode `Zs` (Separator,\n * Space) category, or U+0009 CHARACTER TABULATION (HT), U+000A LINE FEED (LF),\n * U+000C (FF), or U+000D CARRIAGE RETURN (CR) (**\\[UNICODE]**).\n *\n * See:\n * **\\[UNICODE]**:\n * [The Unicode Standard](https://www.unicode.org/versions/).\n * Unicode Consortium.\n *\n * @param code\n * Code.\n * @returns\n * Whether it matches.\n */\nexport const unicodeWhitespace = regexCheck(/\\s/);\n\n/**\n * Create a code check from a regex.\n *\n * @param {RegExp} regex\n * Expression.\n * @returns {(code: Code) => boolean}\n * Check.\n */\nfunction regexCheck(regex) {\n return check;\n\n /**\n * Check whether a code matches the bound regex.\n *\n * @param {Code} code\n * Character code.\n * @returns {boolean}\n * Whether the character code matches the bound regex.\n */\n function check(code) {\n return code !== null && code > -1 && regex.test(String.fromCharCode(code));\n }\n}"],"names":["asciiAlpha","regexCheck","asciiAlphanumeric","unicodePunctuation","unicodeWhitespace","regex","code","test","String","fromCharCode"],"mappings":"oEAqBY,MAACA,EAAaC,EAAW,YAcxBC,EAAoBD,EAAW,cAoKhC,MAACE,EAAqBF,EAAW,gBAsBhCG,EAAoBH,EAAW,MAU5C,SAASA,EAAWI,GAClB,OAUA,SAAeC,GACb,OAAgB,OAATA,GAAiBA,GAAQ,GAAKD,EAAME,KAAKC,OAAOC,aAAaH,GACrE,CACH,uEA9KO,SAAsBA,GAC3B,OAGW,OAATA,IAAkBA,EAAO,IAAe,MAATA,EAEnC,6BAiEO,SAA4BA,GACjC,OAAgB,OAATA,GAAiBA,GAAQ,CAClC,oCAWO,SAAmCA,GACxC,OAAgB,OAATA,IAAkBA,EAAO,GAAc,KAATA,EACvC,wBAiBO,SAAuBA,GAC5B,OAAiB,IAAVA,IAAyB,IAAVA,GAAwB,KAATA,CACvC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.splice=function(e,s,t,l){const i=e.length;let c,n=0;if(s=s<0?-s>i?0:i+s:s>i?i:s,t=t>0?t:0,l.length<1e4)c=Array.from(l),c.unshift(s,t),e.splice(...c);else for(t&&e.splice(s,t);n<l.length;)c=l.slice(n,n+1e4),c.unshift(s,0),e.splice(...c),n+=1e4,s+=1e4};
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../node_modules/micromark-util-chunked/index.js"],"sourcesContent":["/**\n * Like `Array#splice`, but smarter for giant arrays.\n *\n * `Array#splice` takes all items to be inserted as individual argument which\n * causes a stack overflow in V8 when trying to insert 100k items for instance.\n *\n * Otherwise, this does not return the removed items, and takes `items` as an\n * array instead of rest parameters.\n *\n * @template {unknown} T\n * Item type.\n * @param {Array<T>} list\n * List to operate on.\n * @param {number} start\n * Index to remove/insert at (can be negative).\n * @param {number} remove\n * Number of items to remove.\n * @param {Array<T>} items\n * Items to inject into `list`.\n * @returns {undefined}\n * Nothing.\n */\nexport function splice(list, start, remove, items) {\n const end = list.length;\n let chunkStart = 0;\n /** @type {Array<unknown>} */\n let parameters;\n\n // Make start between zero and `end` (included).\n if (start < 0) {\n start = -start > end ? 0 : end + start;\n } else {\n start = start > end ? end : start;\n }\n remove = remove > 0 ? remove : 0;\n\n // No need to chunk the items if there’s only a couple (10k) items.\n if (items.length < 10000) {\n parameters = Array.from(items);\n parameters.unshift(start, remove);\n // @ts-expect-error Hush, it’s fine.\n list.splice(...parameters);\n } else {\n // Delete `remove` items starting from `start`\n if (remove) list.splice(start, remove);\n\n // Insert the items in chunks to not cause stack overflows.\n while (chunkStart < items.length) {\n parameters = items.slice(chunkStart, chunkStart + 10000);\n parameters.unshift(start, 0);\n // @ts-expect-error Hush, it’s fine.\n list.splice(...parameters);\n chunkStart += 10000;\n start += 10000;\n }\n }\n}\n\n/**\n * Append `items` (an array) at the end of `list` (another array).\n * When `list` was empty, returns `items` instead.\n *\n * This prevents a potentially expensive operation when `list` is empty,\n * and adds items in batches to prevent V8 from hanging.\n *\n * @template {unknown} T\n * Item type.\n * @param {Array<T>} list\n * List to operate on.\n * @param {Array<T>} items\n * Items to add to `list`.\n * @returns {Array<T>}\n * Either `list` or `items`.\n */\nexport function push(list, items) {\n if (list.length > 0) {\n splice(list, list.length, 0, items);\n return list;\n }\n return items;\n}"],"names":["list","start","remove","items","end","length","parameters","chunkStart","Array","from","unshift","splice","slice"],"mappings":"mFAsBO,SAAgBA,EAAMC,EAAOC,EAAQC,GAC1C,MAAMC,EAAMJ,EAAKK,OACjB,IAEIC,EAFAC,EAAa,EAajB,GAPEN,EADEA,EAAQ,GACDA,EAAQG,EAAM,EAAIA,EAAMH,EAEzBA,EAAQG,EAAMA,EAAMH,EAE9BC,EAASA,EAAS,EAAIA,EAAS,EAG3BC,EAAME,OAAS,IACjBC,EAAaE,MAAMC,KAAKN,GACxBG,EAAWI,QAAQT,EAAOC,GAE1BF,EAAKW,UAAUL,QAMf,IAHIJ,GAAQF,EAAKW,OAAOV,EAAOC,GAGxBK,EAAaJ,EAAME,QACxBC,EAAaH,EAAMS,MAAML,EAAYA,EAAa,KAClDD,EAAWI,QAAQT,EAAO,GAE1BD,EAAKW,UAAUL,GACfC,GAAc,IACdN,GAAS,GAGf"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../micromark-util-character/index.js");exports.classifyCharacter=function(r){return null===r||e.markdownLineEndingOrSpace(r)||e.unicodeWhitespace(r)?1:e.unicodePunctuation(r)?2:void 0};
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../node_modules/micromark-util-classify-character/index.js"],"sourcesContent":["/**\n * @import {Code} from 'micromark-util-types'\n */\n\nimport { markdownLineEndingOrSpace, unicodePunctuation, unicodeWhitespace } from 'micromark-util-character';\n/**\n * Classify whether a code represents whitespace, punctuation, or something\n * else.\n *\n * Used for attention (emphasis, strong), whose sequences can open or close\n * based on the class of surrounding characters.\n *\n * > 👉 **Note**: eof (`null`) is seen as whitespace.\n *\n * @param {Code} code\n * Code.\n * @returns {typeof constants.characterGroupWhitespace | typeof constants.characterGroupPunctuation | undefined}\n * Group.\n */\nexport function classifyCharacter(code) {\n if (code === null || markdownLineEndingOrSpace(code) || unicodeWhitespace(code)) {\n return 1;\n }\n if (unicodePunctuation(code)) {\n return 2;\n }\n}"],"names":["code","markdownLineEndingOrSpace","unicodeWhitespace","unicodePunctuation"],"mappings":"oJAmBO,SAA2BA,GAChC,OAAa,OAATA,GAAiBC,EAAyBA,0BAACD,IAASE,EAAAA,kBAAkBF,GACjE,EAELG,EAAAA,mBAAmBH,GACd,OADT,CAGF"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../micromark-util-chunked/index.js");const t={}.hasOwnProperty;function n(e,n){let o;for(o in n){const i=(t.call(e,o)?e[o]:void 0)||(e[o]={}),s=n[o];let c;if(s)for(c in s){t.call(i,c)||(i[c]=[]);const e=s[c];r(i[c],Array.isArray(e)?e:e?[e]:[])}}}function r(t,n){let r=-1;const o=[];for(;++r<n.length;)("after"===n[r].add?t:o).push(n[r]);e.splice(t,0,0,o)}exports.combineExtensions=function(e){const t={};let r=-1;for(;++r<e.length;)n(t,e[r]);return t};
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../node_modules/micromark-util-combine-extensions/index.js"],"sourcesContent":["/**\n * @import {\n * Extension,\n * Handles,\n * HtmlExtension,\n * NormalizedExtension\n * } from 'micromark-util-types'\n */\n\nimport {splice} from 'micromark-util-chunked'\n\nconst hasOwnProperty = {}.hasOwnProperty\n\n/**\n * Combine multiple syntax extensions into one.\n *\n * @param {ReadonlyArray<Extension>} extensions\n * List of syntax extensions.\n * @returns {NormalizedExtension}\n * A single combined extension.\n */\nexport function combineExtensions(extensions) {\n /** @type {NormalizedExtension} */\n const all = {}\n let index = -1\n\n while (++index < extensions.length) {\n syntaxExtension(all, extensions[index])\n }\n\n return all\n}\n\n/**\n * Merge `extension` into `all`.\n *\n * @param {NormalizedExtension} all\n * Extension to merge into.\n * @param {Extension} extension\n * Extension to merge.\n * @returns {undefined}\n * Nothing.\n */\nfunction syntaxExtension(all, extension) {\n /** @type {keyof Extension} */\n let hook\n\n for (hook in extension) {\n const maybe = hasOwnProperty.call(all, hook) ? all[hook] : undefined\n /** @type {Record<string, unknown>} */\n const left = maybe || (all[hook] = {})\n /** @type {Record<string, unknown> | undefined} */\n const right = extension[hook]\n /** @type {string} */\n let code\n\n if (right) {\n for (code in right) {\n if (!hasOwnProperty.call(left, code)) left[code] = []\n const value = right[code]\n constructs(\n // @ts-expect-error Looks like a list.\n left[code],\n Array.isArray(value) ? value : value ? [value] : []\n )\n }\n }\n }\n}\n\n/**\n * Merge `list` into `existing` (both lists of constructs).\n * Mutates `existing`.\n *\n * @param {Array<unknown>} existing\n * List of constructs to merge into.\n * @param {Array<unknown>} list\n * List of constructs to merge.\n * @returns {undefined}\n * Nothing.\n */\nfunction constructs(existing, list) {\n let index = -1\n /** @type {Array<unknown>} */\n const before = []\n\n while (++index < list.length) {\n // @ts-expect-error Looks like an object.\n ;(list[index].add === 'after' ? existing : before).push(list[index])\n }\n\n splice(existing, 0, 0, before)\n}\n\n/**\n * Combine multiple HTML extensions into one.\n *\n * @param {ReadonlyArray<HtmlExtension>} htmlExtensions\n * List of HTML extensions.\n * @returns {HtmlExtension}\n * Single combined HTML extension.\n */\nexport function combineHtmlExtensions(htmlExtensions) {\n /** @type {HtmlExtension} */\n const handlers = {}\n let index = -1\n\n while (++index < htmlExtensions.length) {\n htmlExtension(handlers, htmlExtensions[index])\n }\n\n return handlers\n}\n\n/**\n * Merge `extension` into `all`.\n *\n * @param {HtmlExtension} all\n * Extension to merge into.\n * @param {HtmlExtension} extension\n * Extension to merge.\n * @returns {undefined}\n * Nothing.\n */\nfunction htmlExtension(all, extension) {\n /** @type {keyof HtmlExtension} */\n let hook\n\n for (hook in extension) {\n const maybe = hasOwnProperty.call(all, hook) ? all[hook] : undefined\n const left = maybe || (all[hook] = {})\n const right = extension[hook]\n /** @type {keyof Handles} */\n let type\n\n if (right) {\n for (type in right) {\n // @ts-expect-error assume document vs regular handler are managed correctly.\n left[type] = right[type]\n }\n }\n }\n}\n"],"names":["hasOwnProperty","syntaxExtension","all","extension","hook","left","call","undefined","right","code","value","constructs","Array","isArray","existing","list","index","before","length","add","push","splice","extensions"],"mappings":"wHAWA,MAAMA,EAAiB,CAAE,EAACA,eAgC1B,SAASC,EAAgBC,EAAKC,GAE5B,IAAIC,EAEJ,IAAKA,KAAQD,EAAW,CACtB,MAEME,GAFQL,EAAeM,KAAKJ,EAAKE,GAAQF,EAAIE,QAAQG,KAEpCL,EAAIE,GAAQ,CAAA,GAE7BI,EAAQL,EAAUC,GAExB,IAAIK,EAEJ,GAAID,EACF,IAAKC,KAAQD,EAAO,CACbR,EAAeM,KAAKD,EAAMI,KAAOJ,EAAKI,GAAQ,IACnD,MAAMC,EAAQF,EAAMC,GACpBE,EAEEN,EAAKI,GACLG,MAAMC,QAAQH,GAASA,EAAQA,EAAQ,CAACA,GAAS,GAEpD,CAEJ,CACH,CAaA,SAASC,EAAWG,EAAUC,GAC5B,IAAIC,GAAS,EAEb,MAAMC,EAAS,GAEf,OAASD,EAAQD,EAAKG,SAEE,UAApBH,EAAKC,GAAOG,IAAkBL,EAAWG,GAAQG,KAAKL,EAAKC,IAG/DK,EAAAA,OAAOP,EAAU,EAAG,EAAGG,EACzB,2BAvEO,SAA2BK,GAEhC,MAAMpB,EAAM,CAAE,EACd,IAAIc,GAAS,EAEb,OAASA,EAAQM,EAAWJ,QAC1BjB,EAAgBC,EAAKoB,EAAWN,IAGlC,OAAOd,CACT"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../node_modules/micromark-util-normalize-identifier/index.js"],"sourcesContent":["/**\n * Normalize an identifier (as found in references, definitions).\n *\n * Collapses markdown whitespace, trim, and then lower- and uppercase.\n *\n * Some characters are considered “uppercase”, such as U+03F4 (`ϴ`), but if their\n * lowercase counterpart (U+03B8 (`θ`)) is uppercased will result in a different\n * uppercase character (U+0398 (`Θ`)).\n * So, to get a canonical form, we perform both lower- and uppercase.\n *\n * Using uppercase last makes sure keys will never interact with default\n * prototypal values (such as `constructor`): nothing in the prototype of\n * `Object` is uppercase.\n *\n * @param {string} value\n * Identifier to normalize.\n * @returns {string}\n * Normalized identifier.\n */\nexport function normalizeIdentifier(value) {\n return value\n // Collapse markdown whitespace.\n .replace(/[\\t\\n\\r ]+/g, \" \")\n // Trim.\n .replace(/^ | $/g, '')\n // Some characters are considered “uppercase”, but if their lowercase\n // counterpart is uppercased will result in a different uppercase\n // character.\n // Hence, to get that form, we perform both lower- and uppercase.\n // Upper case makes sure keys will not interact with default prototypal\n // methods: no method is uppercase.\n .toLowerCase().toUpperCase();\n}"],"names":["value","replace","toLowerCase","toUpperCase"],"mappings":"gGAmBO,SAA6BA,GAClC,OAAOA,EAENC,QAAQ,cAAe,KAEvBA,QAAQ,SAAU,IAOlBC,cAAcC,aACjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../node_modules/micromark-util-resolve-all/index.js"],"sourcesContent":["/**\n * @import {Event, Resolver, TokenizeContext} from 'micromark-util-types'\n */\n\n/**\n * Call all `resolveAll`s.\n *\n * @param {ReadonlyArray<{resolveAll?: Resolver | undefined}>} constructs\n * List of constructs, optionally with `resolveAll`s.\n * @param {Array<Event>} events\n * List of events.\n * @param {TokenizeContext} context\n * Context used by `tokenize`.\n * @returns {Array<Event>}\n * Changed events.\n */\nexport function resolveAll(constructs, events, context) {\n /** @type {Array<Resolver>} */\n const called = []\n let index = -1\n\n while (++index < constructs.length) {\n const resolve = constructs[index].resolveAll\n\n if (resolve && !called.includes(resolve)) {\n events = resolve(events, context)\n called.push(resolve)\n }\n }\n\n return events\n}\n"],"names":["constructs","events","context","called","index","length","resolve","resolveAll","includes","push"],"mappings":"uFAgBO,SAAoBA,EAAYC,EAAQC,GAE7C,MAAMC,EAAS,GACf,IAAIC,GAAS,EAEb,OAASA,EAAQJ,EAAWK,QAAQ,CAClC,MAAMC,EAAUN,EAAWI,GAAOG,WAE9BD,IAAYH,EAAOK,SAASF,KAC9BL,EAASK,EAAQL,EAAQC,GACzBC,EAAOM,KAAKH,GAEf,CAED,OAAOL,CACT"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var o=require("../../mdast-util-gfm/lib/index.js"),n=require("../../micromark-extension-gfm/index.js");const s={};exports.default=function(e){const r=e||s,t=this.data(),i=t.micromarkExtensions||(t.micromarkExtensions=[]),a=t.fromMarkdownExtensions||(t.fromMarkdownExtensions=[]),m=t.toMarkdownExtensions||(t.toMarkdownExtensions=[]);i.push(n.gfm(r)),a.push(o.gfmFromMarkdown()),m.push(o.gfmToMarkdown(r))};
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../node_modules/remark-gfm/lib/index.js"],"sourcesContent":["/**\n * @import {Root} from 'mdast'\n * @import {Options} from 'remark-gfm'\n * @import {} from 'remark-parse'\n * @import {} from 'remark-stringify'\n * @import {Processor} from 'unified'\n */\n\nimport {gfmFromMarkdown, gfmToMarkdown} from 'mdast-util-gfm'\nimport {gfm} from 'micromark-extension-gfm'\n\n/** @type {Options} */\nconst emptyOptions = {}\n\n/**\n * Add support GFM (autolink literals, footnotes, strikethrough, tables,\n * tasklists).\n *\n * @param {Options | null | undefined} [options]\n * Configuration (optional).\n * @returns {undefined}\n * Nothing.\n */\nexport default function remarkGfm(options) {\n // @ts-expect-error: TS is wrong about `this`.\n // eslint-disable-next-line unicorn/no-this-assignment\n const self = /** @type {Processor<Root>} */ (this)\n const settings = options || emptyOptions\n const data = self.data()\n\n const micromarkExtensions =\n data.micromarkExtensions || (data.micromarkExtensions = [])\n const fromMarkdownExtensions =\n data.fromMarkdownExtensions || (data.fromMarkdownExtensions = [])\n const toMarkdownExtensions =\n data.toMarkdownExtensions || (data.toMarkdownExtensions = [])\n\n micromarkExtensions.push(gfm(settings))\n fromMarkdownExtensions.push(gfmFromMarkdown())\n toMarkdownExtensions.push(gfmToMarkdown(settings))\n}\n"],"names":["emptyOptions","options","settings","data","micromarkExtensions","fromMarkdownExtensions","toMarkdownExtensions","push","gfm","gfmFromMarkdown","gfmToMarkdown"],"mappings":"2KAYA,MAAMA,EAAe,CAAE,kBAWR,SAAmBC,GAGhC,MACMC,EAAWD,GAAWD,EACtBG,EAFuC,KAE3BA,OAEZC,EACJD,EAAKC,sBAAwBD,EAAKC,oBAAsB,IACpDC,EACJF,EAAKE,yBAA2BF,EAAKE,uBAAyB,IAC1DC,EACJH,EAAKG,uBAAyBH,EAAKG,qBAAuB,IAE5DF,EAAoBG,KAAKC,MAAIN,IAC7BG,EAAuBE,KAAKE,EAAAA,mBAC5BH,EAAqBC,KAAKG,gBAAcR,GAC1C"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{__assign as e,__rest as n,__spreadArray as t}from"../../node_modules/tslib/tslib.es6.mjs.js";import{jsxs as r,jsx as i}from"react/jsx-runtime";import o,{useEffect as a}from"react";import{ReactMarkdown as l}from"../../node_modules/react-markdown/lib/react-markdown.js";import d from"../../node_modules/rehype-raw/lib/index.js";import p from"../../node_modules/remark-gfm/lib/index.js";import{visit as s}from"../../node_modules/unist-util-visit/lib/index.js";function u(){return function(e){s(e,"text",(function(e,n,r){var i;if(r&&"string"==typeof e.value&&e.value.includes("✓")){for(var o=e.value.split("✓"),a=[],l=0;l<o.length;l++){var d=o[l];d&&a.push({type:"text",value:d}),l<o.length-1&&a.push({type:"element",tagName:"span",properties:{className:["text-green-600","font-medium","inline-block","mr-1","align-middle"]},children:[{type:"text",value:"✓"}]})}return(i=r.children).splice.apply(i,t([n,1],a,!1)),n+a.length}}))}}var m=function(n,t){if(!t)return n;var r=new RegExp(t.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&"),"gi"),o=n.split(r),a=n.match(r);if(!a)return n;var l=[];return o.forEach((function(n,t){l.push(n),a[t]&&l.push(i("span",e({className:"rounded bg-yellow-200 px-1 py-0.5 text-gray-700"},{children:a[t]}),t))})),l};function c(){return function(e){s(e,"element",(function(e,n,t){if(t&&"p"===e.tagName)return e.children&&1===e.children.length&&"element"===e.children[0].type&&"details"===e.children[0].tagName?(t.children.splice(n,1,e.children[0]),n):void 0}))}}var f=function(e){var n;return"text"===(null==e?void 0:e.type)&&/^\s*$/.test(null!==(n=e.value)&&void 0!==n?n:"")};function g(){return function(e){s(e,"element",(function(e){var n,t;if("details"===e.tagName&&"data-target"in(e.properties||{})){var r=e.children||[],i=0;"element"===(null===(n=r[0])||void 0===n?void 0:n.type)&&"summary"===(null===(t=r[0])||void 0===t?void 0:t.tagName)&&(i=1);var o=r.slice(i),a=o.filter((function(e){return!f(e)}));if((1!==a.length||"element"!==a[0].type||!a[0].properties||!("data-popup"in a[0].properties)&&void 0===a[0].properties["data-popup"])&&!a.some((function(e){return"element"===(null==e?void 0:e.type)&&(null==e?void 0:e.properties)&&("data-popup"in e.properties||void 0!==e.properties["data-popup"])}))){var l={type:"element",tagName:"div",properties:{"data-popup":""},children:o};e.children=r.slice(0,i).concat([l])}}}))}}function h(){return function(e){s(e,"element",(function(e){var n,t;if("details"===e.tagName){var r=e.properties||{};if(!("data-inline"in r)&&!("data-target"in r)){var i=e.children||[],o=0;"element"===(null===(n=i[0])||void 0===n?void 0:n.type)&&"summary"===(null===(t=i[0])||void 0===t?void 0:t.tagName)&&(o=1);var a=i.slice(o),l=a.filter((function(e){return!f(e)}));if((1!==l.length||"element"!==l[0].type||!l[0].properties||!("data-popup"in l[0].properties)&&void 0===l[0].properties["data-popup"])&&!l.some((function(e){return"element"===(null==e?void 0:e.type)&&(null==e?void 0:e.properties)&&("data-popup"in e.properties||void 0!==e.properties["data-popup"])}))){var d={type:"element",tagName:"div",properties:{"data-popup":""},children:a};e.children=i.slice(0,o).concat([d])}}}}))}}var v=function(t){var s=t.value,f=t.highlightedText,v=o.useRef(null),y=o.useRef(null);a((function(){if(f){var e=setTimeout((function(){if(y.current){var e=y.current.querySelector("span.bg-yellow-200");e&&e.scrollIntoView({behavior:"smooth",block:"center"})}}),100);return function(){return clearTimeout(e)}}}),[f]);return r("div",e({ref:y,className:"flex h-[42vh] gap-4"},{children:[i("div",e({className:"h-[42vh] flex-1 rounded-xl border border-gray-200 bg-white p-5 shadow-sm"},{children:i("div",e({className:"h-full overflow-y-auto pr-2"},{children:i(l,e({remarkPlugins:[p],rehypePlugins:[d,c,u,g,h],components:{details:function(t){t.node;var o=n(t,["node"]),a=!!o["data-inline"],l=!!o["data-target"];return a?i("details",e({},o,{className:"md-details md-details--inline relative my-1 inline-block rounded-[8px] align-middle",onToggle:function(e){e.stopPropagation(),function(e){var n=e.currentTarget,t=n.getAttribute("data-inline");if(t&&v.current){var r=v.current.querySelector('details[data-target="'.concat(t,'"]'));r&&(r.open=n.open)}}(e)}},{children:o.children})):l?r("details",e({},o,{className:"md-details md-details--target my-2 block",onToggle:function(e){return e.stopPropagation()}},{children:[i("summary",{className:"md-target-dummy-summary","aria-hidden":"true"}),o.children]})):i("details",e({},o,{className:"md-details md-details--block relative my-1 w-full rounded-[8px] align-middle",onToggle:function(e){return e.stopPropagation()}},{children:o.children}))},summary:function(t){t.node;var r=n(t,["node"]);return i("div",e({className:"mt-0"},{children:i("summary",e({className:"md-summary inline-flex cursor-pointer select-none items-center gap-1 py-1 font-medium hover:opacity-90",style:{color:"#19213D",fontWeight:500},onClick:function(e){return e.stopPropagation()}},r,{children:i("span",e({className:"whitespace-nowrap align-middle"},{children:r.children}))}))}))},ul:function(t){t.node;var r=n(t,["node"]);return i("ol",e({className:"md-ol my-1 list-decimal pl-5"},r))},ol:function(t){t.node;var r=n(t,["node"]);return i("ol",e({className:"md-ol my-1 list-decimal pl-5"},r))},div:function(t){var r,o=t.node,a=n(t,["node"]),l=(null==o?void 0:o.properties)&&("data-popup"in o.properties||void 0!==(null===(r=o.properties)||void 0===r?void 0:r["data-popup"]));return i("div",l?e({},a,{className:(a.className?a.className+" ":"")+"md-popup",role:"region"}):e({},a))},p:function(e){var n=e.children,t=Array.isArray(n)?n:[n];return i("p",{children:t.map((function(e,n){return"string"==typeof e?m(e,f):i(o.Fragment,{children:e},n)}))})},li:function(e){var n=e.children;return i("li",{children:n.map((function(e){return"string"==typeof e?m(e,f):e}))})},code:function(t){var r=t.children,o=n(t,["children"]);return i("code",e({},o,{children:r.map((function(e){return"string"==typeof e?m(e,f):e}))}))}}},{children:s}))}))})),i("style",{children:"\n .md-root strong { color: #19213D !important; }\n .md-check-green { color: #16A34A !important; font-weight: 500; }\n details > summary::-webkit-details-marker { display: none; }\n .md-summary span { white-space: nowrap; }\n\n .md-target-dummy-summary { display: none !important; }\n\n /* Chevron animation */\n .md-details[open] > summary .md-chevron { transform: rotate(180deg); transition: transform .25s cubic-bezier(.2,.8,.2,1); }\n .md-details > summary .md-chevron { transition: transform .25s cubic-bezier(.2,.8,.2,1); }\n\n /* Normal details open look */\n .md-details--block[open] {\n \n padding: 8px 10px;\n border-radius: 8px;\n }\n\n /* Inline trigger never reveals inner content */\n .md-details--inline > :not(summary) { display: none !important; }\n\n /* Target popups (animated) */\n .md-details--target .md-popup,\n .md-details--target [data-popup] {\n display: block;\n margin-top: 6px;\n border: 1px solid #6D28D9;\n color: #6D28D9;\n border-radius: 10px;\n padding: 12px;\n box-shadow: 0 8px 24px rgba(0,0,0,.06);\n opacity: 0;\n transform: translateY(-4px);\n transition: opacity .2s ease, transform .2s ease;\n font-size: 12px;\n line-height: 1.35;\n background: #6D28D91A;\n }\n .md-details--target[open] .md-popup,\n .md-details--target[open] [data-popup] {\n opacity: 1;\n transform: translateY(0);\n }\n\n /* Popup body for normal details (✓ items) */\n .md-details--block[open] .md-popup,\n .md-details--block[open] [data-popup] {\n display: block;\n border: 1px solid #6D28D9;\n color: #6D28D9;\n border-radius: 10px;\n padding: 12px; \n font-size: 12px;\n line-height: 1.35;\n font-weight: 500;\n background: #6D28D91A;\n }\n\n /* ---- NESTED POPUP GUARD: if a popup is inside a popup, neutralize the inner one ---- */\n .md-popup .md-popup,\n .md-popup [data-popup] {\n border: none !important;\n background: transparent !important;\n padding: 0 !important;\n box-shadow: none !important;\n color: inherit !important;\n }\n "})]}))};export{v as default};
|
|
2
|
+
//# sourceMappingURL=MarkdownRenderer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MarkdownRenderer.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{default as CodeCitation}from"./features/CodeCitation/CodeCitation.js";export{default as ProjectAccordian}from"./features/ProjectAccordion/ProjectAccordion.js";export{default as BookCitation}from"./features/BookCitation/BookCitation.js";export{default as Bookemon}from"./features/Bookemon/Bookemon.js";export{PdfEditorCitation as PdfCitation}from"./features/PdfEditorCitation/PdfEditorCitation.js";export{default as CitationRenderer}from"./features/CitationRenderer/CitationRenderer.js";export{DiagnosticSeverity}from"./features/CodeCitation/_components/CodeEditor.js";export{default as PaginatedTable}from"./features/PaginatedTable/PaginatedTable.js";
|
|
1
|
+
export{default as CodeCitation}from"./features/CodeCitation/CodeCitation.js";export{default as ProjectAccordian}from"./features/ProjectAccordion/ProjectAccordion.js";export{default as BookCitation}from"./features/BookCitation/BookCitation.js";export{default as Bookemon}from"./features/Bookemon/Bookemon.js";export{PdfEditorCitation as PdfCitation}from"./features/PdfEditorCitation/PdfEditorCitation.js";export{default as CitationRenderer}from"./features/CitationRenderer/CitationRenderer.js";export{default as MarkdownRenderer}from"./features/CitationRenderer/MarkdownRenderer.js";export{DiagnosticSeverity}from"./features/CodeCitation/_components/CodeEditor.js";export{default as PaginatedTable}from"./features/PaginatedTable/PaginatedTable.js";
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../node_modules/ccount/index.js"],"sourcesContent":["/**\n * Count how often a character (or substring) is used in a string.\n *\n * @param {string} value\n * Value to search in.\n * @param {string} character\n * Character (or substring) to look for.\n * @return {number}\n * Number of times `character` occurred in `value`.\n */\nexport function ccount(value, character) {\n const source = String(value)\n\n if (typeof character !== 'string') {\n throw new TypeError('Expected character')\n }\n\n let count = 0\n let index = source.indexOf(character)\n\n while (index !== -1) {\n count++\n index = source.indexOf(character, index + character.length)\n }\n\n return count\n}\n"],"names":["ccount","value","character","source","String","TypeError","count","index","indexOf","length"],"mappings":"AAUO,SAASA,EAAOC,EAAOC,GAC5B,MAAMC,EAASC,OAAOH,GAEtB,GAAyB,iBAAdC,EACT,MAAM,IAAIG,UAAU,sBAGtB,IAAIC,EAAQ,EACRC,EAAQJ,EAAOK,QAAQN,GAE3B,MAAkB,IAAXK,GACLD,IACAC,EAAQJ,EAAOK,QAAQN,EAAWK,EAAQL,EAAUO,QAGtD,OAAOH,CACT"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../node_modules/longest-streak/index.js"],"sourcesContent":["/**\n * Get the count of the longest repeating streak of `substring` in `value`.\n *\n * @param {string} value\n * Content to search in.\n * @param {string} substring\n * Substring to look for, typically one character.\n * @returns {number}\n * Count of most frequent adjacent `substring`s in `value`.\n */\nexport function longestStreak(value, substring) {\n const source = String(value)\n let index = source.indexOf(substring)\n let expected = index\n let count = 0\n let max = 0\n\n if (typeof substring !== 'string') {\n throw new TypeError('Expected substring')\n }\n\n while (index !== -1) {\n if (index === expected) {\n if (++count > max) {\n max = count\n }\n } else {\n count = 1\n }\n\n expected = index + substring.length\n index = source.indexOf(substring, expected)\n }\n\n return max\n}\n"],"names":["longestStreak","value","substring","source","String","index","indexOf","expected","count","max","TypeError","length"],"mappings":"AAUO,SAASA,EAAcC,EAAOC,GACnC,MAAMC,EAASC,OAAOH,GACtB,IAAII,EAAQF,EAAOG,QAAQJ,GACvBK,EAAWF,EACXG,EAAQ,EACRC,EAAM,EAEV,GAAyB,iBAAdP,EACT,MAAM,IAAIQ,UAAU,sBAGtB,MAAkB,IAAXL,GACDA,IAAUE,IACNC,EAAQC,IACZA,EAAMD,GAGRA,EAAQ,EAGVD,EAAWF,EAAQH,EAAUS,OAC7BN,EAAQF,EAAOG,QAAQJ,EAAWK,GAGpC,OAAOE,CACT"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
function t(t){return t.length}function e(e,i){const l=i||{},r=(l.align||[]).concat(),o=l.stringLength||t,s=[],g=[],c=[],a=[];let p=0,h=-1;for(;++h<e.length;){const t=[],n=[];let i=-1;for(e[h].length>p&&(p=e[h].length);++i<e[h].length;){const r=null==(u=e[h][i])?"":String(u);if(!1!==l.alignDelimiters){const t=o(r);n[i]=t,(void 0===a[i]||t>a[i])&&(a[i]=t)}t.push(r)}g[h]=t,c[h]=n}var u;let f=-1;if("object"==typeof r&&"length"in r)for(;++f<p;)s[f]=n(r[f]);else{const t=n(r);for(;++f<p;)s[f]=t}f=-1;const d=[],m=[];for(;++f<p;){const t=s[f];let e="",n="";99===t?(e=":",n=":"):108===t?e=":":114===t&&(n=":");let i=!1===l.alignDelimiters?1:Math.max(1,a[f]-e.length-n.length);const r=e+"-".repeat(i)+n;!1!==l.alignDelimiters&&(i=e.length+i+n.length,i>a[f]&&(a[f]=i),m[f]=i),d[f]=r}g.splice(1,0,d),c.splice(1,0,m),h=-1;const D=[];for(;++h<g.length;){const t=g[h],e=c[h];f=-1;const n=[];for(;++f<p;){const i=t[f]||"";let r="",o="";if(!1!==l.alignDelimiters){const t=a[f]-(e[f]||0),n=s[f];114===n?r=" ".repeat(t):99===n?t%2?(r=" ".repeat(t/2+.5),o=" ".repeat(t/2-.5)):(r=" ".repeat(t/2),o=r):o=" ".repeat(t)}!1===l.delimiterStart||f||n.push("|"),!1===l.padding||!1===l.alignDelimiters&&""===i||!1===l.delimiterStart&&!f||n.push(" "),!1!==l.alignDelimiters&&n.push(r),n.push(i),!1!==l.alignDelimiters&&n.push(o),!1!==l.padding&&n.push(" "),!1===l.delimiterEnd&&f===p-1||n.push("|")}D.push(!1===l.delimiterEnd?n.join("").replace(/ +$/,""):n.join(""))}return D.join("\n")}function n(t){const e="string"==typeof t?t.codePointAt(0):0;return 67===e||99===e?99:76===e||108===e?108:82===e||114===e?114:0}export{e as markdownTable};
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../node_modules/markdown-table/index.js"],"sourcesContent":["// To do: next major: remove.\n/**\n * @typedef {Options} MarkdownTableOptions\n * Configuration.\n */\n\n/**\n * @typedef Options\n * Configuration.\n * @property {boolean | null | undefined} [alignDelimiters=true]\n * Whether to align the delimiters (default: `true`);\n * they are aligned by default:\n *\n * ```markdown\n * | Alpha | B |\n * | ----- | ----- |\n * | C | Delta |\n * ```\n *\n * Pass `false` to make them staggered:\n *\n * ```markdown\n * | Alpha | B |\n * | - | - |\n * | C | Delta |\n * ```\n * @property {ReadonlyArray<string | null | undefined> | string | null | undefined} [align]\n * How to align columns (default: `''`);\n * one style for all columns or styles for their respective columns;\n * each style is either `'l'` (left), `'r'` (right), or `'c'` (center);\n * other values are treated as `''`, which doesn’t place the colon in the\n * alignment row but does align left;\n * *only the lowercased first character is used, so `Right` is fine.*\n * @property {boolean | null | undefined} [delimiterEnd=true]\n * Whether to end each row with the delimiter (default: `true`).\n *\n * > 👉 **Note**: please don’t use this: it could create fragile structures\n * > that aren’t understandable to some markdown parsers.\n *\n * When `true`, there are ending delimiters:\n *\n * ```markdown\n * | Alpha | B |\n * | ----- | ----- |\n * | C | Delta |\n * ```\n *\n * When `false`, there are no ending delimiters:\n *\n * ```markdown\n * | Alpha | B\n * | ----- | -----\n * | C | Delta\n * ```\n * @property {boolean | null | undefined} [delimiterStart=true]\n * Whether to begin each row with the delimiter (default: `true`).\n *\n * > 👉 **Note**: please don’t use this: it could create fragile structures\n * > that aren’t understandable to some markdown parsers.\n *\n * When `true`, there are starting delimiters:\n *\n * ```markdown\n * | Alpha | B |\n * | ----- | ----- |\n * | C | Delta |\n * ```\n *\n * When `false`, there are no starting delimiters:\n *\n * ```markdown\n * Alpha | B |\n * ----- | ----- |\n * C | Delta |\n * ```\n * @property {boolean | null | undefined} [padding=true]\n * Whether to add a space of padding between delimiters and cells\n * (default: `true`).\n *\n * When `true`, there is padding:\n *\n * ```markdown\n * | Alpha | B |\n * | ----- | ----- |\n * | C | Delta |\n * ```\n *\n * When `false`, there is no padding:\n *\n * ```markdown\n * |Alpha|B |\n * |-----|-----|\n * |C |Delta|\n * ```\n * @property {((value: string) => number) | null | undefined} [stringLength]\n * Function to detect the length of table cell content (optional);\n * this is used when aligning the delimiters (`|`) between table cells;\n * full-width characters and emoji mess up delimiter alignment when viewing\n * the markdown source;\n * to fix this, you can pass this function,\n * which receives the cell content and returns its “visible” size;\n * note that what is and isn’t visible depends on where the text is displayed.\n *\n * Without such a function, the following:\n *\n * ```js\n * markdownTable([\n * ['Alpha', 'Bravo'],\n * ['中文', 'Charlie'],\n * ['👩❤️👩', 'Delta']\n * ])\n * ```\n *\n * Yields:\n *\n * ```markdown\n * | Alpha | Bravo |\n * | - | - |\n * | 中文 | Charlie |\n * | 👩❤️👩 | Delta |\n * ```\n *\n * With [`string-width`](https://github.com/sindresorhus/string-width):\n *\n * ```js\n * import stringWidth from 'string-width'\n *\n * markdownTable(\n * [\n * ['Alpha', 'Bravo'],\n * ['中文', 'Charlie'],\n * ['👩❤️👩', 'Delta']\n * ],\n * {stringLength: stringWidth}\n * )\n * ```\n *\n * Yields:\n *\n * ```markdown\n * | Alpha | Bravo |\n * | ----- | ------- |\n * | 中文 | Charlie |\n * | 👩❤️👩 | Delta |\n * ```\n */\n\n/**\n * @param {string} value\n * Cell value.\n * @returns {number}\n * Cell size.\n */\nfunction defaultStringLength(value) {\n return value.length\n}\n\n/**\n * Generate a markdown\n * ([GFM](https://docs.github.com/en/github/writing-on-github/working-with-advanced-formatting/organizing-information-with-tables))\n * table.\n *\n * @param {ReadonlyArray<ReadonlyArray<string | null | undefined>>} table\n * Table data (matrix of strings).\n * @param {Readonly<Options> | null | undefined} [options]\n * Configuration (optional).\n * @returns {string}\n * Result.\n */\nexport function markdownTable(table, options) {\n const settings = options || {}\n // To do: next major: change to spread.\n const align = (settings.align || []).concat()\n const stringLength = settings.stringLength || defaultStringLength\n /** @type {Array<number>} Character codes as symbols for alignment per column. */\n const alignments = []\n /** @type {Array<Array<string>>} Cells per row. */\n const cellMatrix = []\n /** @type {Array<Array<number>>} Sizes of each cell per row. */\n const sizeMatrix = []\n /** @type {Array<number>} */\n const longestCellByColumn = []\n let mostCellsPerRow = 0\n let rowIndex = -1\n\n // This is a superfluous loop if we don’t align delimiters, but otherwise we’d\n // do superfluous work when aligning, so optimize for aligning.\n while (++rowIndex < table.length) {\n /** @type {Array<string>} */\n const row = []\n /** @type {Array<number>} */\n const sizes = []\n let columnIndex = -1\n\n if (table[rowIndex].length > mostCellsPerRow) {\n mostCellsPerRow = table[rowIndex].length\n }\n\n while (++columnIndex < table[rowIndex].length) {\n const cell = serialize(table[rowIndex][columnIndex])\n\n if (settings.alignDelimiters !== false) {\n const size = stringLength(cell)\n sizes[columnIndex] = size\n\n if (\n longestCellByColumn[columnIndex] === undefined ||\n size > longestCellByColumn[columnIndex]\n ) {\n longestCellByColumn[columnIndex] = size\n }\n }\n\n row.push(cell)\n }\n\n cellMatrix[rowIndex] = row\n sizeMatrix[rowIndex] = sizes\n }\n\n // Figure out which alignments to use.\n let columnIndex = -1\n\n if (typeof align === 'object' && 'length' in align) {\n while (++columnIndex < mostCellsPerRow) {\n alignments[columnIndex] = toAlignment(align[columnIndex])\n }\n } else {\n const code = toAlignment(align)\n\n while (++columnIndex < mostCellsPerRow) {\n alignments[columnIndex] = code\n }\n }\n\n // Inject the alignment row.\n columnIndex = -1\n /** @type {Array<string>} */\n const row = []\n /** @type {Array<number>} */\n const sizes = []\n\n while (++columnIndex < mostCellsPerRow) {\n const code = alignments[columnIndex]\n let before = ''\n let after = ''\n\n if (code === 99 /* `c` */) {\n before = ':'\n after = ':'\n } else if (code === 108 /* `l` */) {\n before = ':'\n } else if (code === 114 /* `r` */) {\n after = ':'\n }\n\n // There *must* be at least one hyphen-minus in each alignment cell.\n let size =\n settings.alignDelimiters === false\n ? 1\n : Math.max(\n 1,\n longestCellByColumn[columnIndex] - before.length - after.length\n )\n\n const cell = before + '-'.repeat(size) + after\n\n if (settings.alignDelimiters !== false) {\n size = before.length + size + after.length\n\n if (size > longestCellByColumn[columnIndex]) {\n longestCellByColumn[columnIndex] = size\n }\n\n sizes[columnIndex] = size\n }\n\n row[columnIndex] = cell\n }\n\n // Inject the alignment row.\n cellMatrix.splice(1, 0, row)\n sizeMatrix.splice(1, 0, sizes)\n\n rowIndex = -1\n /** @type {Array<string>} */\n const lines = []\n\n while (++rowIndex < cellMatrix.length) {\n const row = cellMatrix[rowIndex]\n const sizes = sizeMatrix[rowIndex]\n columnIndex = -1\n /** @type {Array<string>} */\n const line = []\n\n while (++columnIndex < mostCellsPerRow) {\n const cell = row[columnIndex] || ''\n let before = ''\n let after = ''\n\n if (settings.alignDelimiters !== false) {\n const size =\n longestCellByColumn[columnIndex] - (sizes[columnIndex] || 0)\n const code = alignments[columnIndex]\n\n if (code === 114 /* `r` */) {\n before = ' '.repeat(size)\n } else if (code === 99 /* `c` */) {\n if (size % 2) {\n before = ' '.repeat(size / 2 + 0.5)\n after = ' '.repeat(size / 2 - 0.5)\n } else {\n before = ' '.repeat(size / 2)\n after = before\n }\n } else {\n after = ' '.repeat(size)\n }\n }\n\n if (settings.delimiterStart !== false && !columnIndex) {\n line.push('|')\n }\n\n if (\n settings.padding !== false &&\n // Don’t add the opening space if we’re not aligning and the cell is\n // empty: there will be a closing space.\n !(settings.alignDelimiters === false && cell === '') &&\n (settings.delimiterStart !== false || columnIndex)\n ) {\n line.push(' ')\n }\n\n if (settings.alignDelimiters !== false) {\n line.push(before)\n }\n\n line.push(cell)\n\n if (settings.alignDelimiters !== false) {\n line.push(after)\n }\n\n if (settings.padding !== false) {\n line.push(' ')\n }\n\n if (\n settings.delimiterEnd !== false ||\n columnIndex !== mostCellsPerRow - 1\n ) {\n line.push('|')\n }\n }\n\n lines.push(\n settings.delimiterEnd === false\n ? line.join('').replace(/ +$/, '')\n : line.join('')\n )\n }\n\n return lines.join('\\n')\n}\n\n/**\n * @param {string | null | undefined} [value]\n * Value to serialize.\n * @returns {string}\n * Result.\n */\nfunction serialize(value) {\n return value === null || value === undefined ? '' : String(value)\n}\n\n/**\n * @param {string | null | undefined} value\n * Value.\n * @returns {number}\n * Alignment.\n */\nfunction toAlignment(value) {\n const code = typeof value === 'string' ? value.codePointAt(0) : 0\n\n return code === 67 /* `C` */ || code === 99 /* `c` */\n ? 99 /* `c` */\n : code === 76 /* `L` */ || code === 108 /* `l` */\n ? 108 /* `l` */\n : code === 82 /* `R` */ || code === 114 /* `r` */\n ? 114 /* `r` */\n : 0\n}\n"],"names":["defaultStringLength","value","length","markdownTable","table","options","settings","align","concat","stringLength","alignments","cellMatrix","sizeMatrix","longestCellByColumn","mostCellsPerRow","rowIndex","row","sizes","columnIndex","cell","String","alignDelimiters","size","undefined","push","toAlignment","code","before","after","Math","max","repeat","splice","lines","line","delimiterStart","padding","delimiterEnd","join","replace","codePointAt"],"mappings":"AAyJA,SAASA,EAAoBC,GAC3B,OAAOA,EAAMC,MACf,CAcO,SAASC,EAAcC,EAAOC,GACnC,MAAMC,EAAWD,GAAW,CAAE,EAExBE,GAASD,EAASC,OAAS,IAAIC,SAC/BC,EAAeH,EAASG,cAAgBT,EAExCU,EAAa,GAEbC,EAAa,GAEbC,EAAa,GAEbC,EAAsB,GAC5B,IAAIC,EAAkB,EAClBC,GAAY,EAIhB,OAASA,EAAWX,EAAMF,QAAQ,CAEhC,MAAMc,EAAM,GAENC,EAAQ,GACd,IAAIC,GAAe,EAMnB,IAJId,EAAMW,GAAUb,OAASY,IAC3BA,EAAkBV,EAAMW,GAAUb,UAG3BgB,EAAcd,EAAMW,GAAUb,QAAQ,CAC7C,MAAMiB,EA8KHlB,OADUA,EA7KUG,EAAMW,GAAUG,IA8KI,GAAKE,OAAOnB,GA5KvD,IAAiC,IAA7BK,EAASe,gBAA2B,CACtC,MAAMC,EAAOb,EAAaU,GAC1BF,EAAMC,GAAeI,QAGkBC,IAArCV,EAAoBK,IACpBI,EAAOT,EAAoBK,MAE3BL,EAAoBK,GAAeI,EAEtC,CAEDN,EAAIQ,KAAKL,EACV,CAEDR,EAAWI,GAAYC,EACvBJ,EAAWG,GAAYE,CACxB,CA0JH,IAAmBhB,EAvJjB,IAAIiB,GAAe,EAEnB,GAAqB,iBAAVX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OAAOT,EAAO,EAAI,IAC/BM,EAAQ,IAAIG,OAAOT,EAAO,EAAI,MAE9BK,EAAS,IAAII,OAAOT,EAAO,GAC3BM,EAAQD,GAGVC,EAAQ,IAAIG,OAAOT,EAEtB,EAE+B,IAA5BhB,EAAS6B,gBAA6BjB,GACxCgB,EAAKV,KAAK,MAIW,IAArBlB,EAAS8B,UAGsB,IAA7B9B,EAASe,iBAAsC,KAATF,IACX,IAA5Bb,EAAS6B,iBAA4BjB,GAEtCgB,EAAKV,KAAK,MAGqB,IAA7BlB,EAASe,iBACXa,EAAKV,KAAKG,GAGZO,EAAKV,KAAKL,IAEuB,IAA7Bb,EAASe,iBACXa,EAAKV,KAAKI,IAGa,IAArBtB,EAAS8B,SACXF,EAAKV,KAAK,MAIgB,IAA1BlB,EAAS+B,cACTnB,IAAgBJ,EAAkB,GAElCoB,EAAKV,KAAK,IAEb,CAEDS,EAAMT,MACsB,IAA1BlB,EAAS+B,aACLH,EAAKI,KAAK,IAAIC,QAAQ,MAAO,IAC7BL,EAAKI,KAAK,IAEjB,CAED,OAAOL,EAAMK,KAAK,KACpB,CAkBA,SAASb,EAAYxB,GACnB,MAAMyB,EAAwB,iBAAVzB,EAAqBA,EAAMuC,YAAY,GAAK,EAEhE,OAAgB,KAATd,GAAkC,KAATA,EAC5B,GACS,KAATA,GAAkC,MAATA,EACvB,IACS,KAATA,GAAkC,MAATA,EACvB,IACA,CACV"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{gfmAutolinkLiteralFromMarkdown as t,gfmAutolinkLiteralToMarkdown as i}from"../../mdast-util-gfm-autolink-literal/lib/index.js";import{gfmFootnoteFromMarkdown as m,gfmFootnoteToMarkdown as o}from"../../mdast-util-gfm-footnote/lib/index.js";import{gfmStrikethroughFromMarkdown as r,gfmStrikethroughToMarkdown as e}from"../../mdast-util-gfm-strikethrough/lib/index.js";import{gfmTableFromMarkdown as l,gfmTableToMarkdown as n}from"../../mdast-util-gfm-table/lib/index.js";import{gfmTaskListItemFromMarkdown as s,gfmTaskListItemToMarkdown as f}from"../../mdast-util-gfm-task-list-item/lib/index.js";function u(){return[t(),m(),r(),l(),s()]}function d(t){return{extensions:[i(),o(t),e(),n(t),f()]}}export{u as gfmFromMarkdown,d as gfmToMarkdown};
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../node_modules/mdast-util-gfm/lib/index.js"],"sourcesContent":["/**\n * @import {Extension as FromMarkdownExtension} from 'mdast-util-from-markdown'\n * @import {Options} from 'mdast-util-gfm'\n * @import {Options as ToMarkdownExtension} from 'mdast-util-to-markdown'\n */\n\nimport {\n gfmAutolinkLiteralFromMarkdown,\n gfmAutolinkLiteralToMarkdown\n} from 'mdast-util-gfm-autolink-literal'\nimport {\n gfmFootnoteFromMarkdown,\n gfmFootnoteToMarkdown\n} from 'mdast-util-gfm-footnote'\nimport {\n gfmStrikethroughFromMarkdown,\n gfmStrikethroughToMarkdown\n} from 'mdast-util-gfm-strikethrough'\nimport {gfmTableFromMarkdown, gfmTableToMarkdown} from 'mdast-util-gfm-table'\nimport {\n gfmTaskListItemFromMarkdown,\n gfmTaskListItemToMarkdown\n} from 'mdast-util-gfm-task-list-item'\n\n/**\n * Create an extension for `mdast-util-from-markdown` to enable GFM (autolink\n * literals, footnotes, strikethrough, tables, tasklists).\n *\n * @returns {Array<FromMarkdownExtension>}\n * Extension for `mdast-util-from-markdown` to enable GFM (autolink literals,\n * footnotes, strikethrough, tables, tasklists).\n */\nexport function gfmFromMarkdown() {\n return [\n gfmAutolinkLiteralFromMarkdown(),\n gfmFootnoteFromMarkdown(),\n gfmStrikethroughFromMarkdown(),\n gfmTableFromMarkdown(),\n gfmTaskListItemFromMarkdown()\n ]\n}\n\n/**\n * Create an extension for `mdast-util-to-markdown` to enable GFM (autolink\n * literals, footnotes, strikethrough, tables, tasklists).\n *\n * @param {Options | null | undefined} [options]\n * Configuration (optional).\n * @returns {ToMarkdownExtension}\n * Extension for `mdast-util-to-markdown` to enable GFM (autolink literals,\n * footnotes, strikethrough, tables, tasklists).\n */\nexport function gfmToMarkdown(options) {\n return {\n extensions: [\n gfmAutolinkLiteralToMarkdown(),\n gfmFootnoteToMarkdown(options),\n gfmStrikethroughToMarkdown(),\n gfmTableToMarkdown(options),\n gfmTaskListItemToMarkdown()\n ]\n }\n}\n"],"names":["gfmFromMarkdown","gfmAutolinkLiteralFromMarkdown","gfmFootnoteFromMarkdown","gfmStrikethroughFromMarkdown","gfmTableFromMarkdown","gfmTaskListItemFromMarkdown","gfmToMarkdown","options","extensions","gfmAutolinkLiteralToMarkdown","gfmFootnoteToMarkdown","gfmStrikethroughToMarkdown","gfmTableToMarkdown","gfmTaskListItemToMarkdown"],"mappings":"0lBAgCO,SAASA,IACd,MAAO,CACLC,IACAC,IACAC,IACAC,IACAC,IAEJ,CAYO,SAASC,EAAcC,GAC5B,MAAO,CACLC,WAAY,CACVC,IACAC,EAAsBH,GACtBI,IACAC,EAAmBL,GACnBM,KAGN"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{ccount as t}from"../../ccount/index.js";import{ok as n}from"../../devlop/lib/default.js";import{unicodeWhitespace as i,unicodePunctuation as e}from"../../micromark-util-character/index.js";import{findAndReplace as l}from"../../mdast-util-find-and-replace/lib/index.js";const r="phrasing",o=["autolink","link","image","label"];function c(){return{transforms:[k],enter:{literalAutolink:a,literalAutolinkEmail:s,literalAutolinkHttp:s,literalAutolinkWww:s},exit:{literalAutolink:d,literalAutolinkEmail:p,literalAutolinkHttp:f,literalAutolinkWww:h}}}function u(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:r,notInConstruct:o},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:r,notInConstruct:o},{character:":",before:"[ps]",after:"\\/",inConstruct:r,notInConstruct:o}]}}function a(t){this.enter({type:"link",title:null,url:"",children:[]},t)}function s(t){this.config.enter.autolinkProtocol.call(this,t)}function f(t){this.config.exit.autolinkProtocol.call(this,t)}function h(t){this.config.exit.data.call(this,t);const i=this.stack[this.stack.length-1];n("link"===i.type),i.url="http://"+this.sliceSerialize(t)}function p(t){this.config.exit.autolinkEmail.call(this,t)}function d(t){this.exit(t)}function k(t){l(t,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,x],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,g]],{ignore:["link","linkReference"]})}function x(n,i,e,l,r){let o="";if(!m(r))return!1;if(/^w/i.test(i)&&(e=i+e,i="",o="http://"),!function(t){const n=t.split(".");if(n.length<2||n[n.length-1]&&(/_/.test(n[n.length-1])||!/[a-zA-Z\d]/.test(n[n.length-1]))||n[n.length-2]&&(/_/.test(n[n.length-2])||!/[a-zA-Z\d]/.test(n[n.length-2])))return!1;return!0}(e))return!1;const c=function(n){const i=/[!"&'),.:;<>?\]}]+$/.exec(n);if(!i)return[n,void 0];n=n.slice(0,i.index);let e=i[0],l=e.indexOf(")");const r=t(n,"(");let o=t(n,")");for(;-1!==l&&r>o;)n+=e.slice(0,l+1),e=e.slice(l+1),l=e.indexOf(")"),o++;return[n,e]}(e+l);if(!c[0])return!1;const u={type:"link",title:null,url:o+i+c[0],children:[{type:"text",value:i+c[0]}]};return c[1]?[u,{type:"text",value:c[1]}]:u}function g(t,n,i,e){return!(!m(e,!0)||/[-\d_]$/.test(i))&&{type:"link",title:null,url:"mailto:"+n+"@"+i,children:[{type:"text",value:n+"@"+i}]}}function m(t,n){const l=t.input.charCodeAt(t.index-1);return(0===t.index||i(l)||e(l))&&(!n||47!==l)}export{c as gfmAutolinkLiteralFromMarkdown,u as gfmAutolinkLiteralToMarkdown};
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../node_modules/mdast-util-gfm-autolink-literal/lib/index.js"],"sourcesContent":["/**\n * @import {RegExpMatchObject, ReplaceFunction} from 'mdast-util-find-and-replace'\n * @import {CompileContext, Extension as FromMarkdownExtension, Handle as FromMarkdownHandle, Transform as FromMarkdownTransform} from 'mdast-util-from-markdown'\n * @import {ConstructName, Options as ToMarkdownExtension} from 'mdast-util-to-markdown'\n * @import {Link, PhrasingContent} from 'mdast'\n */\n\nimport {ccount} from 'ccount'\nimport {ok as assert} from 'devlop'\nimport {unicodePunctuation, unicodeWhitespace} from 'micromark-util-character'\nimport {findAndReplace} from 'mdast-util-find-and-replace'\n\n/** @type {ConstructName} */\nconst inConstruct = 'phrasing'\n/** @type {Array<ConstructName>} */\nconst notInConstruct = ['autolink', 'link', 'image', 'label']\n\n/**\n * Create an extension for `mdast-util-from-markdown` to enable GFM autolink\n * literals in markdown.\n *\n * @returns {FromMarkdownExtension}\n * Extension for `mdast-util-to-markdown` to enable GFM autolink literals.\n */\nexport function gfmAutolinkLiteralFromMarkdown() {\n return {\n transforms: [transformGfmAutolinkLiterals],\n enter: {\n literalAutolink: enterLiteralAutolink,\n literalAutolinkEmail: enterLiteralAutolinkValue,\n literalAutolinkHttp: enterLiteralAutolinkValue,\n literalAutolinkWww: enterLiteralAutolinkValue\n },\n exit: {\n literalAutolink: exitLiteralAutolink,\n literalAutolinkEmail: exitLiteralAutolinkEmail,\n literalAutolinkHttp: exitLiteralAutolinkHttp,\n literalAutolinkWww: exitLiteralAutolinkWww\n }\n }\n}\n\n/**\n * Create an extension for `mdast-util-to-markdown` to enable GFM autolink\n * literals in markdown.\n *\n * @returns {ToMarkdownExtension}\n * Extension for `mdast-util-to-markdown` to enable GFM autolink literals.\n */\nexport function gfmAutolinkLiteralToMarkdown() {\n return {\n unsafe: [\n {\n character: '@',\n before: '[+\\\\-.\\\\w]',\n after: '[\\\\-.\\\\w]',\n inConstruct,\n notInConstruct\n },\n {\n character: '.',\n before: '[Ww]',\n after: '[\\\\-.\\\\w]',\n inConstruct,\n notInConstruct\n },\n {\n character: ':',\n before: '[ps]',\n after: '\\\\/',\n inConstruct,\n notInConstruct\n }\n ]\n }\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction enterLiteralAutolink(token) {\n this.enter({type: 'link', title: null, url: '', children: []}, token)\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction enterLiteralAutolinkValue(token) {\n this.config.enter.autolinkProtocol.call(this, token)\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exitLiteralAutolinkHttp(token) {\n this.config.exit.autolinkProtocol.call(this, token)\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exitLiteralAutolinkWww(token) {\n this.config.exit.data.call(this, token)\n const node = this.stack[this.stack.length - 1]\n assert(node.type === 'link')\n node.url = 'http://' + this.sliceSerialize(token)\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exitLiteralAutolinkEmail(token) {\n this.config.exit.autolinkEmail.call(this, token)\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exitLiteralAutolink(token) {\n this.exit(token)\n}\n\n/** @type {FromMarkdownTransform} */\nfunction transformGfmAutolinkLiterals(tree) {\n findAndReplace(\n tree,\n [\n [/(https?:\\/\\/|www(?=\\.))([-.\\w]+)([^ \\t\\r\\n]*)/gi, findUrl],\n [/(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)/gu, findEmail]\n ],\n {ignore: ['link', 'linkReference']}\n )\n}\n\n/**\n * @type {ReplaceFunction}\n * @param {string} _\n * @param {string} protocol\n * @param {string} domain\n * @param {string} path\n * @param {RegExpMatchObject} match\n * @returns {Array<PhrasingContent> | Link | false}\n */\n// eslint-disable-next-line max-params\nfunction findUrl(_, protocol, domain, path, match) {\n let prefix = ''\n\n // Not an expected previous character.\n if (!previous(match)) {\n return false\n }\n\n // Treat `www` as part of the domain.\n if (/^w/i.test(protocol)) {\n domain = protocol + domain\n protocol = ''\n prefix = 'http://'\n }\n\n if (!isCorrectDomain(domain)) {\n return false\n }\n\n const parts = splitUrl(domain + path)\n\n if (!parts[0]) return false\n\n /** @type {Link} */\n const result = {\n type: 'link',\n title: null,\n url: prefix + protocol + parts[0],\n children: [{type: 'text', value: protocol + parts[0]}]\n }\n\n if (parts[1]) {\n return [result, {type: 'text', value: parts[1]}]\n }\n\n return result\n}\n\n/**\n * @type {ReplaceFunction}\n * @param {string} _\n * @param {string} atext\n * @param {string} label\n * @param {RegExpMatchObject} match\n * @returns {Link | false}\n */\nfunction findEmail(_, atext, label, match) {\n if (\n // Not an expected previous character.\n !previous(match, true) ||\n // Label ends in not allowed character.\n /[-\\d_]$/.test(label)\n ) {\n return false\n }\n\n return {\n type: 'link',\n title: null,\n url: 'mailto:' + atext + '@' + label,\n children: [{type: 'text', value: atext + '@' + label}]\n }\n}\n\n/**\n * @param {string} domain\n * @returns {boolean}\n */\nfunction isCorrectDomain(domain) {\n const parts = domain.split('.')\n\n if (\n parts.length < 2 ||\n (parts[parts.length - 1] &&\n (/_/.test(parts[parts.length - 1]) ||\n !/[a-zA-Z\\d]/.test(parts[parts.length - 1]))) ||\n (parts[parts.length - 2] &&\n (/_/.test(parts[parts.length - 2]) ||\n !/[a-zA-Z\\d]/.test(parts[parts.length - 2])))\n ) {\n return false\n }\n\n return true\n}\n\n/**\n * @param {string} url\n * @returns {[string, string | undefined]}\n */\nfunction splitUrl(url) {\n const trailExec = /[!\"&'),.:;<>?\\]}]+$/.exec(url)\n\n if (!trailExec) {\n return [url, undefined]\n }\n\n url = url.slice(0, trailExec.index)\n\n let trail = trailExec[0]\n let closingParenIndex = trail.indexOf(')')\n const openingParens = ccount(url, '(')\n let closingParens = ccount(url, ')')\n\n while (closingParenIndex !== -1 && openingParens > closingParens) {\n url += trail.slice(0, closingParenIndex + 1)\n trail = trail.slice(closingParenIndex + 1)\n closingParenIndex = trail.indexOf(')')\n closingParens++\n }\n\n return [url, trail]\n}\n\n/**\n * @param {RegExpMatchObject} match\n * @param {boolean | null | undefined} [email=false]\n * @returns {boolean}\n */\nfunction previous(match, email) {\n const code = match.input.charCodeAt(match.index - 1)\n\n return (\n (match.index === 0 ||\n unicodeWhitespace(code) ||\n unicodePunctuation(code)) &&\n // If it’s an email, the previous character should not be a slash.\n (!email || code !== 47)\n )\n}\n"],"names":["inConstruct","notInConstruct","gfmAutolinkLiteralFromMarkdown","transforms","transformGfmAutolinkLiterals","enter","literalAutolink","enterLiteralAutolink","literalAutolinkEmail","enterLiteralAutolinkValue","literalAutolinkHttp","literalAutolinkWww","exit","exitLiteralAutolink","exitLiteralAutolinkEmail","exitLiteralAutolinkHttp","exitLiteralAutolinkWww","gfmAutolinkLiteralToMarkdown","unsafe","character","before","after","token","this","type","title","url","children","config","autolinkProtocol","call","data","node","stack","length","assert","sliceSerialize","autolinkEmail","tree","findAndReplace","findUrl","findEmail","ignore","_","protocol","domain","path","match","prefix","previous","test","parts","split","isCorrectDomain","trailExec","exec","undefined","slice","index","trail","closingParenIndex","indexOf","openingParens","ccount","closingParens","splitUrl","result","value","atext","label","email","code","input","charCodeAt","unicodeWhitespace","unicodePunctuation"],"mappings":"oRAaA,MAAMA,EAAc,WAEdC,EAAiB,CAAC,WAAY,OAAQ,QAAS,SAS9C,SAASC,IACd,MAAO,CACLC,WAAY,CAACC,GACbC,MAAO,CACLC,gBAAiBC,EACjBC,qBAAsBC,EACtBC,oBAAqBD,EACrBE,mBAAoBF,GAEtBG,KAAM,CACJN,gBAAiBO,EACjBL,qBAAsBM,EACtBJ,oBAAqBK,EACrBJ,mBAAoBK,GAG1B,CASO,SAASC,IACd,MAAO,CACLC,OAAQ,CACN,CACEC,UAAW,IACXC,OAAQ,aACRC,MAAO,YACPrB,cACAC,kBAEF,CACEkB,UAAW,IACXC,OAAQ,OACRC,MAAO,YACPrB,cACAC,kBAEF,CACEkB,UAAW,IACXC,OAAQ,OACRC,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kB,KAATC,EAEf"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{ok as e}from"../../devlop/lib/default.js";import{normalizeIdentifier as t}from"../../micromark-util-normalize-identifier/index.js";function n(){this.buffer()}function o(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function i(){this.buffer()}function r(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function f(n){const o=this.resume(),i=this.stack[this.stack.length-1];e("footnoteReference"===i.type),i.identifier=t(this.sliceSerialize(n)).toLowerCase(),i.label=o}function c(e){this.exit(e)}function s(n){const o=this.resume(),i=this.stack[this.stack.length-1];e("footnoteDefinition"===i.type),i.identifier=t(this.sliceSerialize(n)).toLowerCase(),i.label=o}function l(e){this.exit(e)}function a(e,t,n,o){const i=n.createTracker(o);let r=i.move("[^");const f=n.enter("footnoteReference"),c=n.enter("reference");return r+=i.move(n.safe(n.associationId(e),{after:"]",before:r})),c(),f(),r+=i.move("]"),r}function u(){return{enter:{gfmFootnoteCallString:n,gfmFootnoteCall:o,gfmFootnoteDefinitionLabelString:i,gfmFootnoteDefinition:r},exit:{gfmFootnoteCallString:f,gfmFootnoteCall:c,gfmFootnoteDefinitionLabelString:s,gfmFootnoteDefinition:l}}}function h(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:function(e,n,o,i){const r=o.createTracker(i);let f=r.move("[^");const c=o.enter("footnoteDefinition"),s=o.enter("label");f+=r.move(o.safe(o.associationId(e),{before:f,after:"]"})),s(),f+=r.move("]:"),e.children&&e.children.length>0&&(r.shift(4),f+=r.move((t?"\n":" ")+o.indentLines(o.containerFlow(e,r.current()),t?g:m)));return c(),f},footnoteReference:a},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]}}function m(e,t,n){return 0===t?e:g(e,t,n)}function g(e,t,n){return(n?"":" ")+e}a.peek=function(){return"["};export{u as gfmFootnoteFromMarkdown,h as gfmFootnoteToMarkdown};
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../node_modules/mdast-util-gfm-footnote/lib/index.js"],"sourcesContent":["/**\n * @import {\n * CompileContext,\n * Extension as FromMarkdownExtension,\n * Handle as FromMarkdownHandle\n * } from 'mdast-util-from-markdown'\n * @import {ToMarkdownOptions} from 'mdast-util-gfm-footnote'\n * @import {\n * Handle as ToMarkdownHandle,\n * Map,\n * Options as ToMarkdownExtension\n * } from 'mdast-util-to-markdown'\n * @import {FootnoteDefinition, FootnoteReference} from 'mdast'\n */\n\nimport {ok as assert} from 'devlop'\nimport {normalizeIdentifier} from 'micromark-util-normalize-identifier'\n\nfootnoteReference.peek = footnoteReferencePeek\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction enterFootnoteCallString() {\n this.buffer()\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction enterFootnoteCall(token) {\n this.enter({type: 'footnoteReference', identifier: '', label: ''}, token)\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction enterFootnoteDefinitionLabelString() {\n this.buffer()\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction enterFootnoteDefinition(token) {\n this.enter(\n {type: 'footnoteDefinition', identifier: '', label: '', children: []},\n token\n )\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exitFootnoteCallString(token) {\n const label = this.resume()\n const node = this.stack[this.stack.length - 1]\n assert(node.type === 'footnoteReference')\n node.identifier = normalizeIdentifier(\n this.sliceSerialize(token)\n ).toLowerCase()\n node.label = label\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exitFootnoteCall(token) {\n this.exit(token)\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exitFootnoteDefinitionLabelString(token) {\n const label = this.resume()\n const node = this.stack[this.stack.length - 1]\n assert(node.type === 'footnoteDefinition')\n node.identifier = normalizeIdentifier(\n this.sliceSerialize(token)\n ).toLowerCase()\n node.label = label\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exitFootnoteDefinition(token) {\n this.exit(token)\n}\n\n/** @type {ToMarkdownHandle} */\nfunction footnoteReferencePeek() {\n return '['\n}\n\n/**\n * @type {ToMarkdownHandle}\n * @param {FootnoteReference} node\n */\nfunction footnoteReference(node, _, state, info) {\n const tracker = state.createTracker(info)\n let value = tracker.move('[^')\n const exit = state.enter('footnoteReference')\n const subexit = state.enter('reference')\n value += tracker.move(\n state.safe(state.associationId(node), {after: ']', before: value})\n )\n subexit()\n exit()\n value += tracker.move(']')\n return value\n}\n\n/**\n * Create an extension for `mdast-util-from-markdown` to enable GFM footnotes\n * in markdown.\n *\n * @returns {FromMarkdownExtension}\n * Extension for `mdast-util-from-markdown`.\n */\nexport function gfmFootnoteFromMarkdown() {\n return {\n enter: {\n gfmFootnoteCallString: enterFootnoteCallString,\n gfmFootnoteCall: enterFootnoteCall,\n gfmFootnoteDefinitionLabelString: enterFootnoteDefinitionLabelString,\n gfmFootnoteDefinition: enterFootnoteDefinition\n },\n exit: {\n gfmFootnoteCallString: exitFootnoteCallString,\n gfmFootnoteCall: exitFootnoteCall,\n gfmFootnoteDefinitionLabelString: exitFootnoteDefinitionLabelString,\n gfmFootnoteDefinition: exitFootnoteDefinition\n }\n }\n}\n\n/**\n * Create an extension for `mdast-util-to-markdown` to enable GFM footnotes\n * in markdown.\n *\n * @param {ToMarkdownOptions | null | undefined} [options]\n * Configuration (optional).\n * @returns {ToMarkdownExtension}\n * Extension for `mdast-util-to-markdown`.\n */\nexport function gfmFootnoteToMarkdown(options) {\n // To do: next major: change default.\n let firstLineBlank = false\n\n if (options && options.firstLineBlank) {\n firstLineBlank = true\n }\n\n return {\n handlers: {footnoteDefinition, footnoteReference},\n // This is on by default already.\n unsafe: [{character: '[', inConstruct: ['label', 'phrasing', 'reference']}]\n }\n\n /**\n * @type {ToMarkdownHandle}\n * @param {FootnoteDefinition} node\n */\n function footnoteDefinition(node, _, state, info) {\n const tracker = state.createTracker(info)\n let value = tracker.move('[^')\n const exit = state.enter('footnoteDefinition')\n const subexit = state.enter('label')\n value += tracker.move(\n state.safe(state.associationId(node), {before: value, after: ']'})\n )\n subexit()\n\n value += tracker.move(']:')\n\n if (node.children && node.children.length > 0) {\n tracker.shift(4)\n\n value += tracker.move(\n (firstLineBlank ? '\\n' : ' ') +\n state.indentLines(\n state.containerFlow(node, tracker.current()),\n firstLineBlank ? mapAll : mapExceptFirst\n )\n )\n }\n\n exit()\n\n return value\n }\n}\n\n/** @type {Map} */\nfunction mapExceptFirst(line, index, blank) {\n return index === 0 ? line : mapAll(line, index, blank)\n}\n\n/** @type {Map} */\nfunction mapAll(line, index, blank) {\n return (blank ? '' : ' ') + line\n}\n"],"names":["enterFootnoteCallString","this","buffer","enterFootnoteCall","token","enter","type","identifier","label","enterFootnoteDefinitionLabelString","enterFootnoteDefinition","children","exitFootnoteCallString","resume","node","stack","length","assert","normalizeIdentifier","sliceSerialize","toLowerCase","exitFootnoteCall","exit","exitFootnoteDefinitionLabelString","exitFootnoteDefinition","footnoteReference","_","state","info","tracker","createTracker","value","move","subexit","safe","associationId","after","before","gfmFootnoteFromMarkdown","gfmFootnoteCallString","gfmFootnoteCall","gfmFootnoteDefinitionLabelString","gfmFootnoteDefinition","gfmFootnoteToMarkdown","options","firstLineBlank","handlers","footnoteDefinition","shift","indentLines","containerFlow","current","mapAll","mapExceptFirst","unsafe","character","inConstruct","line","index","blank","peek"],"mappings":"0IAwBA,SAASA,IACPC,KAAKC,QACP,CAMA,SAASC,EAAkBC,GACzBH,KAAKI,MAAM,CAACC,KAAM,oBAAqBC,WAAY,GAAIC,MAAO,IAAKJ,EACrE,CAMA,SAASK,IACPR,KAAKC,QACP,CAMA,SAASQ,EAAwBN,GAC/BH,KAAKI,MACH,CAACC,KAAM,qBAAsBC,WAA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,EAAGC,EAAOC,GAC1C,MAAMC,EAAUF,EAAMG,cAAcF,GACpC,IAAIG,EAAQF,EAAQG,KAAK,MACzB,MAAMV,EAAOK,EAAMtB,MAAM,sBACnB4B,EAAUN,EAAMtB,MAAM,SAC5B0B,GAASF,EAAQG,KACfL,EAAMO,KAAKP,EAAMQ,cAAcrB,GAAO,CAACuB,OAAQN,EAAOK,MAAO,OAE/DH,IAEAF,GAASF,EAAQG,KAAK,MAElBlB,EAAKH,UAAYG,EAAKH,SAASK,OAAS,IAC1Ca,EAAQmB,MAAM,GAEdjB,GAASF,EAAQG,MACda,EAAiB,KAAO,KACvBlB,EAAMsB,YACJtB,EAAMuB,cAAcpC,EAAMe,EAAQsB,WAClCN,EAAiBO,EAASC,KAOlC,OAFA/B,IAEOS,CACR,EApCgCN,qBAE/B6B,OAAQ,CAAC,CAACC,UAAW,IAAKC,YAAa,CAAC,QAAS,WAAY,eAmCjE,CAGA,SAASH,EAAeI,EAAMC,EAAOC,GACnC,OAAiB,IAAVD,EAAcD,EAAOL,EAAOK,EAAMC,EAAOC,EAClD,CAGA,SAASP,EAAOK,EAAMC,EAAOC,GAC3B,OAAQA,EAAQ,GAAK,QAAUF,CACjC,CAjMAhC,EAAkBmC,KAkFlB,WACE,MAAO,GACT"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const e=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];function t(){return{canContainEols:["delete"],enter:{strikethrough:r},exit:{strikethrough:i}}}function n(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:e}],handlers:{delete:o}}}function r(e){this.enter({type:"delete",children:[]},e)}function i(e){this.exit(e)}function o(e,t,n,r){const i=n.createTracker(r),o=n.enter("strikethrough");let c=i.move("~~");return c+=n.containerPhrasing(e,{...i.current(),before:c,after:"~"}),c+=i.move("~~"),o(),c}o.peek=function(){return"~"};export{t as gfmStrikethroughFromMarkdown,n as gfmStrikethroughToMarkdown};
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../node_modules/mdast-util-gfm-strikethrough/lib/index.js"],"sourcesContent":["/**\n * @typedef {import('mdast').Delete} Delete\n *\n * @typedef {import('mdast-util-from-markdown').CompileContext} CompileContext\n * @typedef {import('mdast-util-from-markdown').Extension} FromMarkdownExtension\n * @typedef {import('mdast-util-from-markdown').Handle} FromMarkdownHandle\n *\n * @typedef {import('mdast-util-to-markdown').ConstructName} ConstructName\n * @typedef {import('mdast-util-to-markdown').Handle} ToMarkdownHandle\n * @typedef {import('mdast-util-to-markdown').Options} ToMarkdownExtension\n */\n\n/**\n * List of constructs that occur in phrasing (paragraphs, headings), but cannot\n * contain strikethrough.\n * So they sort of cancel each other out.\n * Note: could use a better name.\n *\n * Note: keep in sync with: <https://github.com/syntax-tree/mdast-util-to-markdown/blob/8ce8dbf/lib/unsafe.js#L14>\n *\n * @type {Array<ConstructName>}\n */\nconst constructsWithoutStrikethrough = [\n 'autolink',\n 'destinationLiteral',\n 'destinationRaw',\n 'reference',\n 'titleQuote',\n 'titleApostrophe'\n]\n\nhandleDelete.peek = peekDelete\n\n/**\n * Create an extension for `mdast-util-from-markdown` to enable GFM\n * strikethrough in markdown.\n *\n * @returns {FromMarkdownExtension}\n * Extension for `mdast-util-from-markdown` to enable GFM strikethrough.\n */\nexport function gfmStrikethroughFromMarkdown() {\n return {\n canContainEols: ['delete'],\n enter: {strikethrough: enterStrikethrough},\n exit: {strikethrough: exitStrikethrough}\n }\n}\n\n/**\n * Create an extension for `mdast-util-to-markdown` to enable GFM\n * strikethrough in markdown.\n *\n * @returns {ToMarkdownExtension}\n * Extension for `mdast-util-to-markdown` to enable GFM strikethrough.\n */\nexport function gfmStrikethroughToMarkdown() {\n return {\n unsafe: [\n {\n character: '~',\n inConstruct: 'phrasing',\n notInConstruct: constructsWithoutStrikethrough\n }\n ],\n handlers: {delete: handleDelete}\n }\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction enterStrikethrough(token) {\n this.enter({type: 'delete', children: []}, token)\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exitStrikethrough(token) {\n this.exit(token)\n}\n\n/**\n * @type {ToMarkdownHandle}\n * @param {Delete} node\n */\nfunction handleDelete(node, _, state, info) {\n const tracker = state.createTracker(info)\n const exit = state.enter('strikethrough')\n let value = tracker.move('~~')\n value += state.containerPhrasing(node, {\n ...tracker.current(),\n before: value,\n after: '~'\n })\n value += tracker.move('~~')\n exit()\n return value\n}\n\n/** @type {ToMarkdownHandle} */\nfunction peekDelete() {\n return '~'\n}\n"],"names":["constructsWithoutStrikethrough","gfmStrikethroughFromMarkdown","canContainEols","enter","strikethrough","enterStrikethrough","exit","exitStrikethrough","gfmStrikethroughToMarkdown","unsafe","character","inConstruct","notInConstruct","handlers","delete","handleDelete","token","this","type","children","node","_","state","info","tracker","createTracker","value","move","containerPhrasing","current","before","after","peek"],"mappings":"AAsBA,MAAMA,EAAiC,CACrC,WACA,qBACA,iBACA,YACA,aACA,mBAYK,SAASC,IACd,MAAO,CACLC,eAAgB,CAAC,UACjBC,MAAO,CAACC,cAAeC,GACvBC,KAAM,CAACF,cAAeG,GAE1B,CASO,SAASC,IACd,MAAO,CACLC,OAAQ,CACN,CACEC,UAAW,IACXC,YAAa,WACbC,eAAgBZ,IAGpBa,SAAU,CAACC,OAAQC,GAEvB,CAMA,SAASV,EAAmBW,GAC1BC,KAAKd,MAAM,CAACe,KAAM,SAAUC,SAAU,IAAKH,EAC7C,CAMA,SAAST,EAAkBS,GACzBC,KAAKX,KAAKU,EACZ,CAMA,SAASD,EAAaK,EAAMC,EAAGC,EAAOC,GACpC,MAAMC,EAAUF,EAAMG,cAAcF,GAC9BjB,EAAOgB,EAAMnB,MAAM,iBACzB,IAAIuB,EAAQF,EAAQG,KAAK,MAQzB,OAPAD,GAASJ,EAAMM,kBAAkBR,EAAM,IAClCI,EAAQK,UACXC,OAAQJ,EACRK,MAAO,MAETL,GAASF,EAAQG,KAAK,MACtBrB,IACOoB,CACT,CArEAX,EAAaiB,KAwEb,WACE,MAAO,GACT"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{ok as e}from"../../devlop/lib/default.js";import{markdownTable as t}from"../../markdown-table/index.js";import{handle as n}from"../../mdast-util-to-markdown/lib/handle/index.js";import"../../decode-named-character-reference/index.dom.js";function a(){return{enter:{table:r,tableData:o,tableHeader:o,tableRow:l},exit:{codeText:s,table:i,tableData:c,tableHeader:c,tableRow:c}}}function r(e){const t=e._align;this.enter({type:"table",align:t.map((function(e){return"none"===e?null:e})),children:[]},e),this.data.inTable=!0}function i(e){this.exit(e),this.data.inTable=void 0}function l(e){this.enter({type:"tableRow",children:[]},e)}function c(e){this.exit(e)}function o(e){this.enter({type:"tableCell",children:[]},e)}function s(t){let n=this.resume();this.data.inTable&&(n=n.replace(/\\([\\|])/g,u));const a=this.stack[this.stack.length-1];e("inlineCode"===a.type),a.value=n,this.exit(t)}function u(e,t){return"|"===t?t:e}function d(e){const a=e||{},r=a.tableCellPadding,i=a.tablePipeAlign,l=a.stringLength,c=r?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:"\n",inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[\t :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:function(e,t,a){let r=n.inlineCode(e,t,a);a.stack.includes("tableCell")&&(r=r.replace(/\|/g,"\\$&"));return r},table:function(e,t,n,a){return s(function(e,t,n){const a=e.children;let r=-1;const i=[],l=t.enter("table");for(;++r<a.length;)i[r]=u(a[r],t,n);return l(),i}(e,n,a),e.align)},tableCell:o,tableRow:function(e,t,n,a){const r=s([u(e,n,a)]);return r.slice(0,r.indexOf("\n"))}}};function o(e,t,n,a){const r=n.enter("tableCell"),i=n.enter("phrasing"),l=n.containerPhrasing(e,{...a,before:c,after:c});return i(),r(),l}function s(e,n){return t(e,{align:n,alignDelimiters:i,padding:r,stringLength:l})}function u(e,t,n){const a=e.children;let r=-1;const i=[],l=t.enter("tableRow");for(;++r<a.length;)i[r]=o(a[r],0,t,n);return l(),i}}export{a as gfmTableFromMarkdown,d as gfmTableToMarkdown};
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../node_modules/mdast-util-gfm-table/lib/index.js"],"sourcesContent":["/**\n * @typedef {import('mdast').InlineCode} InlineCode\n * @typedef {import('mdast').Table} Table\n * @typedef {import('mdast').TableCell} TableCell\n * @typedef {import('mdast').TableRow} TableRow\n *\n * @typedef {import('markdown-table').Options} MarkdownTableOptions\n *\n * @typedef {import('mdast-util-from-markdown').CompileContext} CompileContext\n * @typedef {import('mdast-util-from-markdown').Extension} FromMarkdownExtension\n * @typedef {import('mdast-util-from-markdown').Handle} FromMarkdownHandle\n *\n * @typedef {import('mdast-util-to-markdown').Options} ToMarkdownExtension\n * @typedef {import('mdast-util-to-markdown').Handle} ToMarkdownHandle\n * @typedef {import('mdast-util-to-markdown').State} State\n * @typedef {import('mdast-util-to-markdown').Info} Info\n */\n\n/**\n * @typedef Options\n * Configuration.\n * @property {boolean | null | undefined} [tableCellPadding=true]\n * Whether to add a space of padding between delimiters and cells (default:\n * `true`).\n * @property {boolean | null | undefined} [tablePipeAlign=true]\n * Whether to align the delimiters (default: `true`).\n * @property {MarkdownTableOptions['stringLength'] | null | undefined} [stringLength]\n * Function to detect the length of table cell content, used when aligning\n * the delimiters between cells (optional).\n */\n\nimport {ok as assert} from 'devlop'\nimport {markdownTable} from 'markdown-table'\nimport {defaultHandlers} from 'mdast-util-to-markdown'\n\n/**\n * Create an extension for `mdast-util-from-markdown` to enable GFM tables in\n * markdown.\n *\n * @returns {FromMarkdownExtension}\n * Extension for `mdast-util-from-markdown` to enable GFM tables.\n */\nexport function gfmTableFromMarkdown() {\n return {\n enter: {\n table: enterTable,\n tableData: enterCell,\n tableHeader: enterCell,\n tableRow: enterRow\n },\n exit: {\n codeText: exitCodeText,\n table: exitTable,\n tableData: exit,\n tableHeader: exit,\n tableRow: exit\n }\n }\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction enterTable(token) {\n const align = token._align\n assert(align, 'expected `_align` on table')\n this.enter(\n {\n type: 'table',\n align: align.map(function (d) {\n return d === 'none' ? null : d\n }),\n children: []\n },\n token\n )\n this.data.inTable = true\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exitTable(token) {\n this.exit(token)\n this.data.inTable = undefined\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction enterRow(token) {\n this.enter({type: 'tableRow', children: []}, token)\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exit(token) {\n this.exit(token)\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction enterCell(token) {\n this.enter({type: 'tableCell', children: []}, token)\n}\n\n// Overwrite the default code text data handler to unescape escaped pipes when\n// they are in tables.\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exitCodeText(token) {\n let value = this.resume()\n\n if (this.data.inTable) {\n value = value.replace(/\\\\([\\\\|])/g, replace)\n }\n\n const node = this.stack[this.stack.length - 1]\n assert(node.type === 'inlineCode')\n node.value = value\n this.exit(token)\n}\n\n/**\n * @param {string} $0\n * @param {string} $1\n * @returns {string}\n */\nfunction replace($0, $1) {\n // Pipes work, backslashes don’t (but can’t escape pipes).\n return $1 === '|' ? $1 : $0\n}\n\n/**\n * Create an extension for `mdast-util-to-markdown` to enable GFM tables in\n * markdown.\n *\n * @param {Options | null | undefined} [options]\n * Configuration.\n * @returns {ToMarkdownExtension}\n * Extension for `mdast-util-to-markdown` to enable GFM tables.\n */\nexport function gfmTableToMarkdown(options) {\n const settings = options || {}\n const padding = settings.tableCellPadding\n const alignDelimiters = settings.tablePipeAlign\n const stringLength = settings.stringLength\n const around = padding ? ' ' : '|'\n\n return {\n unsafe: [\n {character: '\\r', inConstruct: 'tableCell'},\n {character: '\\n', inConstruct: 'tableCell'},\n // A pipe, when followed by a tab or space (padding), or a dash or colon\n // (unpadded delimiter row), could result in a table.\n {atBreak: true, character: '|', after: '[\\t :-]'},\n // A pipe in a cell must be encoded.\n {character: '|', inConstruct: 'tableCell'},\n // A colon must be followed by a dash, in which case it could start a\n // delimiter row.\n {atBreak: true, character: ':', after: '-'},\n // A delimiter row can also start with a dash, when followed by more\n // dashes, a colon, or a pipe.\n // This is a stricter version than the built in check for lists, thematic\n // breaks, and setex heading underlines though:\n // <https://github.com/syntax-tree/mdast-util-to-markdown/blob/51a2038/lib/unsafe.js#L57>\n {atBreak: true, character: '-', after: '[:|-]'}\n ],\n handlers: {\n inlineCode: inlineCodeWithTable,\n table: handleTable,\n tableCell: handleTableCell,\n tableRow: handleTableRow\n }\n }\n\n /**\n * @type {ToMarkdownHandle}\n * @param {Table} node\n */\n function handleTable(node, _, state, info) {\n return serializeData(handleTableAsData(node, state, info), node.align)\n }\n\n /**\n * This function isn’t really used normally, because we handle rows at the\n * table level.\n * But, if someone passes in a table row, this ensures we make somewhat sense.\n *\n * @type {ToMarkdownHandle}\n * @param {TableRow} node\n */\n function handleTableRow(node, _, state, info) {\n const row = handleTableRowAsData(node, state, info)\n const value = serializeData([row])\n // `markdown-table` will always add an align row\n return value.slice(0, value.indexOf('\\n'))\n }\n\n /**\n * @type {ToMarkdownHandle}\n * @param {TableCell} node\n */\n function handleTableCell(node, _, state, info) {\n const exit = state.enter('tableCell')\n const subexit = state.enter('phrasing')\n const value = state.containerPhrasing(node, {\n ...info,\n before: around,\n after: around\n })\n subexit()\n exit()\n return value\n }\n\n /**\n * @param {Array<Array<string>>} matrix\n * @param {Array<string | null | undefined> | null | undefined} [align]\n */\n function serializeData(matrix, align) {\n return markdownTable(matrix, {\n align,\n // @ts-expect-error: `markdown-table` types should support `null`.\n alignDelimiters,\n // @ts-expect-error: `markdown-table` types should support `null`.\n padding,\n // @ts-expect-error: `markdown-table` types should support `null`.\n stringLength\n })\n }\n\n /**\n * @param {Table} node\n * @param {State} state\n * @param {Info} info\n */\n function handleTableAsData(node, state, info) {\n const children = node.children\n let index = -1\n /** @type {Array<Array<string>>} */\n const result = []\n const subexit = state.enter('table')\n\n while (++index < children.length) {\n result[index] = handleTableRowAsData(children[index], state, info)\n }\n\n subexit()\n\n return result\n }\n\n /**\n * @param {TableRow} node\n * @param {State} state\n * @param {Info} info\n */\n function handleTableRowAsData(node, state, info) {\n const children = node.children\n let index = -1\n /** @type {Array<string>} */\n const result = []\n const subexit = state.enter('tableRow')\n\n while (++index < children.length) {\n // Note: the positional info as used here is incorrect.\n // Making it correct would be impossible due to aligning cells?\n // And it would need copy/pasting `markdown-table` into this project.\n result[index] = handleTableCell(children[index], node, state, info)\n }\n\n subexit()\n\n return result\n }\n\n /**\n * @type {ToMarkdownHandle}\n * @param {InlineCode} node\n */\n function inlineCodeWithTable(node, parent, state) {\n let value = defaultHandlers.inlineCode(node, parent, state)\n\n if (state.stack.includes('tableCell')) {\n value = value.replace(/\\|/g, '\\\\$&')\n }\n\n return value\n }\n}\n"],"names":["gfmTableFromMarkdown","enter","table","enterTable","tableData","enterCell","tableHeader","tableRow","enterRow","exit","codeText","exitCodeText","exitTable","token","align","_align","this","type","map","d","children","data","inTable","undefined","value","resume","replace","node","stack","length","assert","$0","$1","gfmTableToMarkdown","options","settings","padding","tableCellPadding","alignDelimiters","tablePipeAlign","stringLength","around","unsafe","character","inConstruct","atBreak","after","handlers","inlineCode","parent","state","defaultHandlers","includes","_","info","serializeData","index","result","subexit","handleTableRowAsData","handleTableAsData","tableCell","handleTableCell","slice","indexOf","containerPhrasing","before","matrix","markdownTable"],"mappings":"qPA0CO,SAASA,IACd,MAAO,CACLC,MAAO,CACLC,MAAOC,EACPC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Eb,MAAMC,EAAS,GACTC,EAAUR,EAAMjD,MAAM,YAE5B,OAASuD,EAAQpC,EAASS,QAIxB4B,EAAOD,GAASM,EAAgB1C,EAASoC,GAAQ7B,EAAMuB,EAAOI,GAKhE,OAFAI,IAEOD,CACR,CAeH"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{ok as t}from"../../devlop/lib/default.js";import{handle as e}from"../../mdast-util-to-markdown/lib/handle/index.js";import"../../decode-named-character-reference/index.dom.js";function n(){return{exit:{taskListCheckValueChecked:s,taskListCheckValueUnchecked:s,paragraph:a}}}function i(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:c}}}function s(e){const n=this.stack[this.stack.length-2];t("listItem"===n.type),n.checked="taskListCheckValueChecked"===e.type}function a(e){const n=this.stack[this.stack.length-2];if(n&&"listItem"===n.type&&"boolean"==typeof n.checked){const e=this.stack[this.stack.length-1];t("paragraph"===e.type);const i=e.children[0];if(i&&"text"===i.type){const t=n.children;let s,a=-1;for(;++a<t.length;){const e=t[a];if("paragraph"===e.type){s=e;break}}s===e&&(i.value=i.value.slice(1),0===i.value.length?e.children.shift():e.position&&i.position&&"number"==typeof i.position.start.offset&&(i.position.start.column++,i.position.start.offset++,e.position.start=Object.assign({},i.position.start)))}}this.exit(e)}function c(t,n,i,s){const a=t.children[0],c="boolean"==typeof t.checked&&a&&"paragraph"===a.type,r="["+(t.checked?"x":" ")+"] ",o=i.createTracker(s);c&&o.move(r);let h=e.listItem(t,n,i,{...s,...o.current()});return c&&(h=h.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,(function(t){return t+r}))),h}export{n as gfmTaskListItemFromMarkdown,i as gfmTaskListItemToMarkdown};
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../node_modules/mdast-util-gfm-task-list-item/lib/index.js"],"sourcesContent":["/**\n * @typedef {import('mdast').ListItem} ListItem\n * @typedef {import('mdast').Paragraph} Paragraph\n * @typedef {import('mdast-util-from-markdown').CompileContext} CompileContext\n * @typedef {import('mdast-util-from-markdown').Extension} FromMarkdownExtension\n * @typedef {import('mdast-util-from-markdown').Handle} FromMarkdownHandle\n * @typedef {import('mdast-util-to-markdown').Options} ToMarkdownExtension\n * @typedef {import('mdast-util-to-markdown').Handle} ToMarkdownHandle\n */\n\nimport {ok as assert} from 'devlop'\nimport {defaultHandlers} from 'mdast-util-to-markdown'\n\n/**\n * Create an extension for `mdast-util-from-markdown` to enable GFM task\n * list items in markdown.\n *\n * @returns {FromMarkdownExtension}\n * Extension for `mdast-util-from-markdown` to enable GFM task list items.\n */\nexport function gfmTaskListItemFromMarkdown() {\n return {\n exit: {\n taskListCheckValueChecked: exitCheck,\n taskListCheckValueUnchecked: exitCheck,\n paragraph: exitParagraphWithTaskListItem\n }\n }\n}\n\n/**\n * Create an extension for `mdast-util-to-markdown` to enable GFM task list\n * items in markdown.\n *\n * @returns {ToMarkdownExtension}\n * Extension for `mdast-util-to-markdown` to enable GFM task list items.\n */\nexport function gfmTaskListItemToMarkdown() {\n return {\n unsafe: [{atBreak: true, character: '-', after: '[:|-]'}],\n handlers: {listItem: listItemWithTaskListItem}\n }\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exitCheck(token) {\n // We’re always in a paragraph, in a list item.\n const node = this.stack[this.stack.length - 2]\n assert(node.type === 'listItem')\n node.checked = token.type === 'taskListCheckValueChecked'\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exitParagraphWithTaskListItem(token) {\n const parent = this.stack[this.stack.length - 2]\n\n if (\n parent &&\n parent.type === 'listItem' &&\n typeof parent.checked === 'boolean'\n ) {\n const node = this.stack[this.stack.length - 1]\n assert(node.type === 'paragraph')\n const head = node.children[0]\n\n if (head && head.type === 'text') {\n const siblings = parent.children\n let index = -1\n /** @type {Paragraph | undefined} */\n let firstParaghraph\n\n while (++index < siblings.length) {\n const sibling = siblings[index]\n if (sibling.type === 'paragraph') {\n firstParaghraph = sibling\n break\n }\n }\n\n if (firstParaghraph === node) {\n // Must start with a space or a tab.\n head.value = head.value.slice(1)\n\n if (head.value.length === 0) {\n node.children.shift()\n } else if (\n node.position &&\n head.position &&\n typeof head.position.start.offset === 'number'\n ) {\n head.position.start.column++\n head.position.start.offset++\n node.position.start = Object.assign({}, head.position.start)\n }\n }\n }\n }\n\n this.exit(token)\n}\n\n/**\n * @type {ToMarkdownHandle}\n * @param {ListItem} node\n */\nfunction listItemWithTaskListItem(node, parent, state, info) {\n const head = node.children[0]\n const checkable =\n typeof node.checked === 'boolean' && head && head.type === 'paragraph'\n const checkbox = '[' + (node.checked ? 'x' : ' ') + '] '\n const tracker = state.createTracker(info)\n\n if (checkable) {\n tracker.move(checkbox)\n }\n\n let value = defaultHandlers.listItem(node, parent, state, {\n ...info,\n ...tracker.current()\n })\n\n if (checkable) {\n value = value.replace(/^(?:[*+-]|\\d+\\.)([\\r\\n]| {1,3})/, check)\n }\n\n return value\n\n /**\n * @param {string} $0\n * @returns {string}\n */\n function check($0) {\n return $0 + checkbox\n }\n}\n"],"names":["gfmTaskListItemFromMarkdown","exit","taskListCheckValueChecked","exitCheck","taskListCheckValueUnchecked","paragraph","exitParagraphWithTaskListItem","gfmTaskListItemToMarkdown","unsafe","atBreak","character","after","handlers","listItem","listItemWithTaskListItem","token","node","this","stack","length","assert","type","checked","parent","head","children","siblings","firstParaghraph","index","sibling","value","slice","shift","position","start","offset","column","Object","assign","state","info","checkable","checkbox","tracker","createTracker","move","defaultHandlers","current","replace","$0"],"mappings":"uLAoBO,SAASA,IACd,MAAO,CACLC,KAAM,CACJC,0BAA2BC,EAC3BC,4BAA6BD,EAC7BE,UAAWC,GAGjB,CASO,SAASC,IACd,MAAO,CACLC,OAAQ,CAAC,CAACC,SAAS,EAAMC,UAAW,IAAKC,MAAO,UAChDC,SAAU,CAACC,SAAUC,GAEzB,CAMA,SA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,EAAgBjC,SAASG,EAAMO,EAAQgB,EAAO,IACrDC,KACAG,EAAQI,YAOb,OAJIN,IACFX,EAAQA,EAAMkB,QAAQ,mCASxB,SAAeC,GACb,OAAOA,EAAKP,CACb,KARMZ,CAST"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{convert as e}from"../../unist-util-is/lib/index.js";const t=e(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);export{t as phrasing};
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../node_modules/mdast-util-phrasing/lib/index.js"],"sourcesContent":["/**\n * @typedef {import('mdast').Html} Html\n * @typedef {import('mdast').PhrasingContent} PhrasingContent\n */\n\nimport {convert} from 'unist-util-is'\n\n/**\n * Check if the given value is *phrasing content*.\n *\n * > 👉 **Note**: Excludes `html`, which can be both phrasing or flow.\n *\n * @param node\n * Thing to check, typically `Node`.\n * @returns\n * Whether `value` is phrasing content.\n */\n\nexport const phrasing =\n /** @type {(node?: unknown) => node is Exclude<PhrasingContent, Html>} */\n (\n convert([\n 'break',\n 'delete',\n 'emphasis',\n // To do: next major: removed since footnotes were added to GFM.\n 'footnote',\n 'footnoteReference',\n 'image',\n 'imageReference',\n 'inlineCode',\n // Enabled by `mdast-util-math`:\n 'inlineMath',\n 'link',\n 'linkReference',\n // Enabled by `mdast-util-mdx`:\n 'mdxJsxTextElement',\n // Enabled by `mdast-util-mdx`:\n 'mdxTextExpression',\n 'strong',\n 'text',\n // Enabled by `mdast-util-directive`:\n 'textDirective'\n ])\n )\n"],"names":["phrasing","convert"],"mappings":"2DAkBY,MAACA,EAGTC,EAAQ,CACN,QACA,SACA,WAEA,WACA,oBACA,QACA,iBACA,aAEA,aACA,OACA,gBAEA,oBAEA,oBACA,SACA,OAEA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blockquote.js","sources":["../../../../../node_modules/mdast-util-to-markdown/lib/handle/blockquote.js"],"sourcesContent":["/**\n * @import {Blockquote, Parents} from 'mdast'\n * @import {Info, Map, State} from 'mdast-util-to-markdown'\n */\n\n/**\n * @param {Blockquote} node\n * @param {Parents | undefined} _\n * @param {State} state\n * @param {Info} info\n * @returns {string}\n */\nexport function blockquote(node, _, state, info) {\n const exit = state.enter('blockquote')\n const tracker = state.createTracker(info)\n tracker.move('> ')\n tracker.shift(2)\n const value = state.indentLines(\n state.containerFlow(node, tracker.current()),\n map\n )\n exit()\n return value\n}\n\n/** @type {Map} */\nfunction map(line, _, blank) {\n return '>' + (blank ? '' : ' ') + line\n}\n"],"names":["blockquote","node","_","state","info","exit","enter","tracker","createTracker","move","shift","value","indentLines","containerFlow","current","map","line","blank"],"mappings":"AAYO,SAASA,EAAWC,EAAMC,EAAGC,EAAOC,GACzC,MAAMC,EAAOF,EAAMG,MAAM,cACnBC,EAAUJ,EAAMK,cAAcJ,GACpCG,EAAQE,KAAK,MACbF,EAAQG,MAAM,GACd,MAAMC,EAAQR,EAAMS,YAClBT,EAAMU,cAAcZ,EAAMM,EAAQO,WAClCC,GAGF,OADAV,IACOM,CACT,CAGA,SAASI,EAAIC,EAAMd,EAAGe,GACpB,MAAO,KAAOA,EAAQ,GAAK,KAAOD,CACpC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{patternInScope as t}from"../util/pattern-in-scope.js";function e(e,n,r,f){let a=-1;for(;++a<r.unsafe.length;)if("\n"===r.unsafe[a].character&&t(r.stack,r.unsafe[a]))return/[ \t]/.test(f.before)?"":" ";return"\\\n"}export{e as hardBreak};
|
|
2
|
+
//# sourceMappingURL=break.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"break.js","sources":["../../../../../node_modules/mdast-util-to-markdown/lib/handle/break.js"],"sourcesContent":["/**\n * @import {Break, Parents} from 'mdast'\n * @import {Info, State} from 'mdast-util-to-markdown'\n */\n\nimport {patternInScope} from '../util/pattern-in-scope.js'\n\n/**\n * @param {Break} _\n * @param {Parents | undefined} _1\n * @param {State} state\n * @param {Info} info\n * @returns {string}\n */\nexport function hardBreak(_, _1, state, info) {\n let index = -1\n\n while (++index < state.unsafe.length) {\n // If we can’t put eols in this construct (setext headings, tables), use a\n // space instead.\n if (\n state.unsafe[index].character === '\\n' &&\n patternInScope(state.stack, state.unsafe[index])\n ) {\n return /[ \\t]/.test(info.before) ? '' : ' '\n }\n }\n\n return '\\\\\\n'\n}\n"],"names":["hardBreak","_","_1","state","info","index","unsafe","length","character","patternInScope","stack","test","before"],"mappings":"6DAcO,SAASA,EAAUC,EAAGC,EAAIC,EAAOC,GACtC,IAAIC,GAAS,EAEb,OAASA,EAAQF,EAAMG,OAAOC,QAG5B,GACoC,OAAlCJ,EAAMG,OAAOD,GAAOG,WACpBC,EAAeN,EAAMO,MAAOP,EAAMG,OAAOD,IAEzC,MAAO,QAAQM,KAAKP,EAAKQ,QAAU,GAAK,IAI5C,MAAO,MACT"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{longestStreak as e}from"../../../longest-streak/index.js";import{formatCodeAsIndented as n}from"../util/format-code-as-indented.js";import{checkFence as t}from"../util/check-fence.js";function o(o,c,a,d){const m=t(a),f=o.value||"",i="`"===m?"GraveAccent":"Tilde";if(n(o,a)){const e=a.enter("codeIndented"),n=a.indentLines(f,r);return e(),n}const s=a.createTracker(d),u=m.repeat(Math.max(e(f,m)+1,3)),l=a.enter("codeFenced");let v=s.move(u);if(o.lang){const e=a.enter(`codeFencedLang${i}`);v+=s.move(a.safe(o.lang,{before:v,after:" ",encode:["`"],...s.current()})),e()}if(o.lang&&o.meta){const e=a.enter(`codeFencedMeta${i}`);v+=s.move(" "),v+=s.move(a.safe(o.meta,{before:v,after:"\n",encode:["`"],...s.current()})),e()}return v+=s.move("\n"),f&&(v+=s.move(f+"\n")),v+=s.move(u),l(),v}function r(e,n,t){return(t?"":" ")+e}export{o as code};
|
|
2
|
+
//# sourceMappingURL=code.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"code.js","sources":["../../../../../node_modules/mdast-util-to-markdown/lib/handle/code.js"],"sourcesContent":["/**\n * @import {Info, Map, State} from 'mdast-util-to-markdown'\n * @import {Code, Parents} from 'mdast'\n */\n\nimport {longestStreak} from 'longest-streak'\nimport {formatCodeAsIndented} from '../util/format-code-as-indented.js'\nimport {checkFence} from '../util/check-fence.js'\n\n/**\n * @param {Code} node\n * @param {Parents | undefined} _\n * @param {State} state\n * @param {Info} info\n * @returns {string}\n */\nexport function code(node, _, state, info) {\n const marker = checkFence(state)\n const raw = node.value || ''\n const suffix = marker === '`' ? 'GraveAccent' : 'Tilde'\n\n if (formatCodeAsIndented(node, state)) {\n const exit = state.enter('codeIndented')\n const value = state.indentLines(raw, map)\n exit()\n return value\n }\n\n const tracker = state.createTracker(info)\n const sequence = marker.repeat(Math.max(longestStreak(raw, marker) + 1, 3))\n const exit = state.enter('codeFenced')\n let value = tracker.move(sequence)\n\n if (node.lang) {\n const subexit = state.enter(`codeFencedLang${suffix}`)\n value += tracker.move(\n state.safe(node.lang, {\n before: value,\n after: ' ',\n encode: ['`'],\n ...tracker.current()\n })\n )\n subexit()\n }\n\n if (node.lang && node.meta) {\n const subexit = state.enter(`codeFencedMeta${suffix}`)\n value += tracker.move(' ')\n value += tracker.move(\n state.safe(node.meta, {\n before: value,\n after: '\\n',\n encode: ['`'],\n ...tracker.current()\n })\n )\n subexit()\n }\n\n value += tracker.move('\\n')\n\n if (raw) {\n value += tracker.move(raw + '\\n')\n }\n\n value += tracker.move(sequence)\n exit()\n return value\n}\n\n/** @type {Map} */\nfunction map(line, _, blank) {\n return (blank ? '' : ' ') + line\n}\n"],"names":["code","node","_","state","info","marker","checkFence","raw","value","suffix","formatCodeAsIndented","exit","enter","indentLines","map","tracker","createTracker","sequence","repeat","Math","max","longestStreak","move","lang","subexit","safe","before","after","encode","current","meta","line","blank"],"mappings":"+LAgBO,SAASA,EAAKC,EAAMC,EAAGC,EAAOC,GACnC,MAAMC,EAASC,EAAWH,GACpBI,EAAMN,EAAKO,OAAS,GACpBC,EAAoB,MAAXJ,EAAiB,cAAgB,QAEhD,GAAIK,EAAqBT,EAAME,GAAQ,CACrC,MAAMQ,EAAOR,EAAMS,MAAM,gBACnBJ,EAAQL,EAAMU,YAAYN,EAAKO,GAErC,OADAH,IACOH,CACR,CAED,MAAMO,EAAUZ,EAAMa,cAAcZ,GAC9Ba,EAAWZ,EAAOa,OAAOC,KAAKC,IAAIC,EAAcd,EAAKF,GAAU,EAAG,IAClEM,EAAOR,EAAMS,MAAM,cACzB,IAAIJ,EAAQO,EAAQO,KAAKL,GAEzB,GAAIhB,EAAKsB,KAAM,CACb,MAAMC,EAAUrB,EAAMS,MAAM,iBAAiBH,KAC7CD,GAASO,EAAQO,KACfnB,EAAMsB,KAAKxB,EAAKsB,KAAM,CACpBG,OAAQlB,EACRmB,MAAO,IACPC,OAAQ,CAAC,QACNb,EAAQc,aAGfL,GACD,CAED,GAAIvB,EAAKsB,MAAQtB,EAAK6B,KAAM,CAC1B,MAAMN,EAAUrB,EAAMS,MAAM,iBAAiBH,KAC7CD,GAASO,EAAQO,KAAK,KACtBd,GAASO,EAAQO,KACfnB,EAAMsB,KAAKxB,EAAK6B,KAAM,CACpBJ,OAAQlB,EACRmB,MAAO,KACPC,OAAQ,CAAC,QACNb,EAAQc,aAGfL,GACD,CAUD,OARAhB,GAASO,EAAQO,KAAK,MAElBf,IACFC,GAASO,EAAQO,KAAKf,EAAM,OAG9BC,GAASO,EAAQO,KAAKL,GACtBN,IACOH,CACT,CAGA,SAASM,EAAIiB,EAAM7B,EAAG8B,GACpB,OAAQA,EAAQ,GAAK,QAAUD,CACjC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{checkQuote as e}from"../util/check-quote.js";function t(t,r,o,n){const a=e(o),i='"'===a?"Quote":"Apostrophe",f=o.enter("definition");let l=o.enter("label");const u=o.createTracker(n);let s=u.move("[");return s+=u.move(o.safe(o.associationId(t),{before:s,after:"]",...u.current()})),s+=u.move("]: "),l(),!t.url||/[\0- \u007F]/.test(t.url)?(l=o.enter("destinationLiteral"),s+=u.move("<"),s+=u.move(o.safe(t.url,{before:s,after:">",...u.current()})),s+=u.move(">")):(l=o.enter("destinationRaw"),s+=u.move(o.safe(t.url,{before:s,after:t.title?" ":"\n",...u.current()}))),l(),t.title&&(l=o.enter(`title${i}`),s+=u.move(" "+a),s+=u.move(o.safe(t.title,{before:s,after:a,...u.current()})),s+=u.move(a),l()),f(),s}export{t as definition};
|
|
2
|
+
//# sourceMappingURL=definition.js.map
|