taskchef 8.6.2 → 8.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.codex-plugin/plugin.json +1 -1
- package/README.md +8 -4
- package/assets/README.md +19 -0
- package/assets/taskchef-app-rounded.png +0 -0
- package/assets/taskchef-avatar-square.png +0 -0
- package/assets/taskchef-avatar-square.svg +8 -0
- package/assets/taskchef-sidebar-dark.svg +6 -0
- package/assets/taskchef-sidebar-light.svg +6 -0
- package/assets/taskchef-sidebar.svg +6 -0
- package/docs/advanced-guide.md +20 -29
- package/docs/dashboard-ui.md +15 -0
- package/docs/diagrams/taskchef-next-reply-lookup.drawio +38 -0
- package/docs/diagrams/taskchef-next-reply-lookup.drawio.png +0 -0
- package/docs/diagrams/taskchef-next-storage.drawio +41 -0
- package/docs/diagrams/taskchef-next-storage.drawio.png +0 -0
- package/docs/images/taskchef-pr-icon-comparison.jpg +0 -0
- package/docs/images/taskchef-unified-status-popup.jpg +0 -0
- package/docs/mcp-app.md +261 -6
- package/docs/spec.md +24 -69
- package/docs/taskchef-next-github.md +206 -0
- package/docs/taskchef-next-status-research.md +102 -0
- package/docs/taskchef-next-storage.md +167 -0
- package/docs/workflows.md +4 -2
- package/node_modules/@napi-rs/keyring/LICENSE +21 -0
- package/node_modules/@napi-rs/keyring/README.md +45 -0
- package/node_modules/@napi-rs/keyring/index.d.ts +232 -0
- package/node_modules/@napi-rs/keyring/index.js +706 -0
- package/node_modules/@napi-rs/keyring/keytar.d.ts +53 -0
- package/node_modules/@napi-rs/keyring/keytar.js +26 -0
- package/node_modules/@napi-rs/keyring/package.json +126 -0
- package/node_modules/@napi-rs/keyring-darwin-arm64/README.md +3 -0
- package/node_modules/@napi-rs/keyring-darwin-arm64/keyring.darwin-arm64.node +0 -0
- package/node_modules/@napi-rs/keyring-darwin-arm64/package.json +32 -0
- package/node_modules/@napi-rs/keyring-darwin-x64/README.md +3 -0
- package/node_modules/@napi-rs/keyring-darwin-x64/keyring.darwin-x64.node +0 -0
- package/node_modules/@napi-rs/keyring-darwin-x64/package.json +32 -0
- package/node_modules/@napi-rs/keyring-linux-arm64-gnu/README.md +3 -0
- package/node_modules/@napi-rs/keyring-linux-arm64-gnu/keyring.linux-arm64-gnu.node +0 -0
- package/node_modules/@napi-rs/keyring-linux-arm64-gnu/package.json +35 -0
- package/node_modules/@napi-rs/keyring-linux-arm64-musl/README.md +3 -0
- package/node_modules/@napi-rs/keyring-linux-arm64-musl/keyring.linux-arm64-musl.node +0 -0
- package/node_modules/@napi-rs/keyring-linux-arm64-musl/package.json +35 -0
- package/node_modules/@napi-rs/keyring-linux-x64-gnu/README.md +3 -0
- package/node_modules/@napi-rs/keyring-linux-x64-gnu/keyring.linux-x64-gnu.node +0 -0
- package/node_modules/@napi-rs/keyring-linux-x64-gnu/package.json +35 -0
- package/node_modules/@napi-rs/keyring-linux-x64-musl/README.md +3 -0
- package/node_modules/@napi-rs/keyring-linux-x64-musl/keyring.linux-x64-musl.node +0 -0
- package/node_modules/@napi-rs/keyring-linux-x64-musl/package.json +35 -0
- package/node_modules/@napi-rs/keyring-win32-arm64-msvc/README.md +3 -0
- package/node_modules/@napi-rs/keyring-win32-arm64-msvc/keyring.win32-arm64-msvc.node +0 -0
- package/node_modules/@napi-rs/keyring-win32-arm64-msvc/package.json +32 -0
- package/node_modules/@napi-rs/keyring-win32-x64-msvc/README.md +3 -0
- package/node_modules/@napi-rs/keyring-win32-x64-msvc/keyring.win32-x64-msvc.node +0 -0
- package/node_modules/@napi-rs/keyring-win32-x64-msvc/package.json +32 -0
- package/node_modules/@types/debug/LICENSE +21 -0
- package/node_modules/@types/debug/README.md +69 -0
- package/node_modules/@types/debug/index.d.ts +50 -0
- package/node_modules/@types/debug/package.json +58 -0
- package/node_modules/@types/mdast/LICENSE +21 -0
- package/node_modules/@types/mdast/README.md +15 -0
- package/node_modules/@types/mdast/index.d.ts +1123 -0
- package/node_modules/@types/mdast/package.json +47 -0
- package/node_modules/@types/ms/LICENSE +21 -0
- package/node_modules/@types/ms/README.md +82 -0
- package/node_modules/@types/ms/index.d.ts +63 -0
- package/node_modules/@types/ms/package.json +26 -0
- package/node_modules/@types/unist/LICENSE +21 -0
- package/node_modules/@types/unist/README.md +15 -0
- package/node_modules/@types/unist/index.d.ts +119 -0
- package/node_modules/@types/unist/package.json +60 -0
- package/node_modules/character-entities/index.d.ts +6 -0
- package/node_modules/character-entities/index.js +2132 -0
- package/node_modules/character-entities/license +22 -0
- package/node_modules/character-entities/package.json +78 -0
- package/node_modules/character-entities/readme.md +152 -0
- package/node_modules/decode-named-character-reference/index.d.ts +13 -0
- package/node_modules/decode-named-character-reference/index.d.ts.map +1 -0
- package/node_modules/decode-named-character-reference/index.dom.d.ts +6 -0
- package/node_modules/decode-named-character-reference/index.dom.d.ts.map +1 -0
- package/node_modules/decode-named-character-reference/index.dom.js +32 -0
- package/node_modules/decode-named-character-reference/index.js +19 -0
- package/node_modules/decode-named-character-reference/license +22 -0
- package/node_modules/decode-named-character-reference/package.json +90 -0
- package/node_modules/decode-named-character-reference/readme.md +136 -0
- package/node_modules/dequal/dist/index.js +86 -0
- package/node_modules/dequal/dist/index.min.js +1 -0
- package/node_modules/dequal/dist/index.mjs +84 -0
- package/node_modules/dequal/index.d.ts +1 -0
- package/node_modules/dequal/license +21 -0
- package/node_modules/dequal/lite/index.d.ts +1 -0
- package/node_modules/dequal/lite/index.js +31 -0
- package/node_modules/dequal/lite/index.min.js +1 -0
- package/node_modules/dequal/lite/index.mjs +29 -0
- package/node_modules/dequal/package.json +57 -0
- package/node_modules/dequal/readme.md +112 -0
- package/node_modules/devlop/lib/default.js +9 -0
- package/node_modules/devlop/lib/development.d.ts +84 -0
- package/node_modules/devlop/lib/development.js +238 -0
- package/node_modules/devlop/license +22 -0
- package/node_modules/devlop/package.json +80 -0
- package/node_modules/devlop/readme.md +360 -0
- package/node_modules/mdast-util-from-markdown/dev/index.d.ts +23 -0
- package/node_modules/mdast-util-from-markdown/dev/index.js +2 -0
- package/node_modules/mdast-util-from-markdown/dev/lib/index.d.ts +53 -0
- package/node_modules/mdast-util-from-markdown/dev/lib/index.d.ts.map +1 -0
- package/node_modules/mdast-util-from-markdown/dev/lib/index.js +1348 -0
- package/node_modules/mdast-util-from-markdown/dev/lib/types.d.ts +295 -0
- package/node_modules/mdast-util-from-markdown/dev/lib/types.js +2 -0
- package/node_modules/mdast-util-from-markdown/index.d.ts +23 -0
- package/node_modules/mdast-util-from-markdown/index.js +2 -0
- package/node_modules/mdast-util-from-markdown/lib/index.d.ts +53 -0
- package/node_modules/mdast-util-from-markdown/lib/index.js +1177 -0
- package/node_modules/mdast-util-from-markdown/lib/types.d.ts +295 -0
- package/node_modules/mdast-util-from-markdown/lib/types.js +2 -0
- package/node_modules/mdast-util-from-markdown/license +22 -0
- package/node_modules/mdast-util-from-markdown/package.json +139 -0
- package/node_modules/mdast-util-from-markdown/readme.md +537 -0
- package/node_modules/mdast-util-to-string/index.d.ts +2 -0
- package/node_modules/mdast-util-to-string/index.js +5 -0
- package/node_modules/mdast-util-to-string/lib/index.d.ts +31 -0
- package/node_modules/mdast-util-to-string/lib/index.js +108 -0
- package/node_modules/mdast-util-to-string/license +22 -0
- package/node_modules/mdast-util-to-string/package.json +78 -0
- package/node_modules/mdast-util-to-string/readme.md +218 -0
- package/node_modules/micromark/dev/index.d.ts +82 -0
- package/node_modules/micromark/dev/index.d.ts.map +1 -0
- package/node_modules/micromark/dev/index.js +68 -0
- package/node_modules/micromark/dev/lib/compile.d.ts +16 -0
- package/node_modules/micromark/dev/lib/compile.d.ts.map +1 -0
- package/node_modules/micromark/dev/lib/compile.js +1162 -0
- package/node_modules/micromark/dev/lib/constructs.d.ts +73 -0
- package/node_modules/micromark/dev/lib/constructs.d.ts.map +1 -0
- package/node_modules/micromark/dev/lib/constructs.js +101 -0
- package/node_modules/micromark/dev/lib/create-tokenizer.d.ts +46 -0
- package/node_modules/micromark/dev/lib/create-tokenizer.d.ts.map +1 -0
- package/node_modules/micromark/dev/lib/create-tokenizer.js +718 -0
- package/node_modules/micromark/dev/lib/initialize/content.d.ts +4 -0
- package/node_modules/micromark/dev/lib/initialize/content.d.ts.map +1 -0
- package/node_modules/micromark/dev/lib/initialize/content.js +99 -0
- package/node_modules/micromark/dev/lib/initialize/document.d.ts +10 -0
- package/node_modules/micromark/dev/lib/initialize/document.d.ts.map +1 -0
- package/node_modules/micromark/dev/lib/initialize/document.js +449 -0
- package/node_modules/micromark/dev/lib/initialize/flow.d.ts +4 -0
- package/node_modules/micromark/dev/lib/initialize/flow.d.ts.map +1 -0
- package/node_modules/micromark/dev/lib/initialize/flow.js +86 -0
- package/node_modules/micromark/dev/lib/initialize/text.d.ts +8 -0
- package/node_modules/micromark/dev/lib/initialize/text.d.ts.map +1 -0
- package/node_modules/micromark/dev/lib/initialize/text.js +248 -0
- package/node_modules/micromark/dev/lib/parse.d.ts +10 -0
- package/node_modules/micromark/dev/lib/parse.d.ts.map +1 -0
- package/node_modules/micromark/dev/lib/parse.js +58 -0
- package/node_modules/micromark/dev/lib/postprocess.d.ts +9 -0
- package/node_modules/micromark/dev/lib/postprocess.d.ts.map +1 -0
- package/node_modules/micromark/dev/lib/postprocess.js +19 -0
- package/node_modules/micromark/dev/lib/preprocess.d.ts +13 -0
- package/node_modules/micromark/dev/lib/preprocess.d.ts.map +1 -0
- package/node_modules/micromark/dev/lib/preprocess.js +139 -0
- package/node_modules/micromark/dev/stream.d.ts +35 -0
- package/node_modules/micromark/dev/stream.d.ts.map +1 -0
- package/node_modules/micromark/dev/stream.js +270 -0
- package/node_modules/micromark/index.d.ts +82 -0
- package/node_modules/micromark/index.d.ts.map +1 -0
- package/node_modules/micromark/index.js +60 -0
- package/node_modules/micromark/lib/compile.d.ts +16 -0
- package/node_modules/micromark/lib/compile.d.ts.map +1 -0
- package/node_modules/micromark/lib/compile.js +1068 -0
- package/node_modules/micromark/lib/constructs.d.ts +73 -0
- package/node_modules/micromark/lib/constructs.d.ts.map +1 -0
- package/node_modules/micromark/lib/constructs.js +85 -0
- package/node_modules/micromark/lib/create-tokenizer.d.ts +46 -0
- package/node_modules/micromark/lib/create-tokenizer.d.ts.map +1 -0
- package/node_modules/micromark/lib/create-tokenizer.js +613 -0
- package/node_modules/micromark/lib/initialize/content.d.ts +4 -0
- package/node_modules/micromark/lib/initialize/content.d.ts.map +1 -0
- package/node_modules/micromark/lib/initialize/content.js +79 -0
- package/node_modules/micromark/lib/initialize/document.d.ts +10 -0
- package/node_modules/micromark/lib/initialize/document.d.ts.map +1 -0
- package/node_modules/micromark/lib/initialize/document.js +370 -0
- package/node_modules/micromark/lib/initialize/flow.d.ts +4 -0
- package/node_modules/micromark/lib/initialize/flow.d.ts.map +1 -0
- package/node_modules/micromark/lib/initialize/flow.js +58 -0
- package/node_modules/micromark/lib/initialize/text.d.ts +8 -0
- package/node_modules/micromark/lib/initialize/text.d.ts.map +1 -0
- package/node_modules/micromark/lib/initialize/text.js +216 -0
- package/node_modules/micromark/lib/parse.d.ts +10 -0
- package/node_modules/micromark/lib/parse.d.ts.map +1 -0
- package/node_modules/micromark/lib/parse.js +56 -0
- package/node_modules/micromark/lib/postprocess.d.ts +9 -0
- package/node_modules/micromark/lib/postprocess.d.ts.map +1 -0
- package/node_modules/micromark/lib/postprocess.js +18 -0
- package/node_modules/micromark/lib/preprocess.d.ts +13 -0
- package/node_modules/micromark/lib/preprocess.d.ts.map +1 -0
- package/node_modules/micromark/lib/preprocess.js +112 -0
- package/node_modules/micromark/license +22 -0
- package/node_modules/micromark/package.json +87 -0
- package/node_modules/micromark/readme.md +488 -0
- package/node_modules/micromark/stream.d.ts +35 -0
- package/node_modules/micromark/stream.d.ts.map +1 -0
- package/node_modules/micromark/stream.js +256 -0
- package/node_modules/micromark-core-commonmark/dev/index.d.ts +23 -0
- package/node_modules/micromark-core-commonmark/dev/index.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/dev/index.js +22 -0
- package/node_modules/micromark-core-commonmark/dev/lib/attention.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/dev/lib/attention.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/dev/lib/attention.js +294 -0
- package/node_modules/micromark-core-commonmark/dev/lib/autolink.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/dev/lib/autolink.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/dev/lib/autolink.js +269 -0
- package/node_modules/micromark-core-commonmark/dev/lib/blank-line.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/dev/lib/blank-line.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/dev/lib/blank-line.js +62 -0
- package/node_modules/micromark-core-commonmark/dev/lib/block-quote.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/dev/lib/block-quote.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/dev/lib/block-quote.js +162 -0
- package/node_modules/micromark-core-commonmark/dev/lib/character-escape.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/dev/lib/character-escape.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/dev/lib/character-escape.js +69 -0
- package/node_modules/micromark-core-commonmark/dev/lib/character-reference.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/dev/lib/character-reference.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/dev/lib/character-reference.js +166 -0
- package/node_modules/micromark-core-commonmark/dev/lib/code-fenced.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/dev/lib/code-fenced.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/dev/lib/code-fenced.js +472 -0
- package/node_modules/micromark-core-commonmark/dev/lib/code-indented.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/dev/lib/code-indented.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/dev/lib/code-indented.js +178 -0
- package/node_modules/micromark-core-commonmark/dev/lib/code-text.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/dev/lib/code-text.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/dev/lib/code-text.js +257 -0
- package/node_modules/micromark-core-commonmark/dev/lib/content.d.ts +7 -0
- package/node_modules/micromark-core-commonmark/dev/lib/content.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/dev/lib/content.js +185 -0
- package/node_modules/micromark-core-commonmark/dev/lib/definition.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/dev/lib/definition.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/dev/lib/definition.js +295 -0
- package/node_modules/micromark-core-commonmark/dev/lib/hard-break-escape.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/dev/lib/hard-break-escape.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/dev/lib/hard-break-escape.js +65 -0
- package/node_modules/micromark-core-commonmark/dev/lib/heading-atx.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/dev/lib/heading-atx.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/dev/lib/heading-atx.js +229 -0
- package/node_modules/micromark-core-commonmark/dev/lib/html-flow.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/dev/lib/html-flow.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/dev/lib/html-flow.js +938 -0
- package/node_modules/micromark-core-commonmark/dev/lib/html-text.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/dev/lib/html-text.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/dev/lib/html-text.js +783 -0
- package/node_modules/micromark-core-commonmark/dev/lib/label-end.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/dev/lib/label-end.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/dev/lib/label-end.js +658 -0
- package/node_modules/micromark-core-commonmark/dev/lib/label-start-image.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/dev/lib/label-start-image.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/dev/lib/label-start-image.js +119 -0
- package/node_modules/micromark-core-commonmark/dev/lib/label-start-link.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/dev/lib/label-start-link.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/dev/lib/label-start-link.js +71 -0
- package/node_modules/micromark-core-commonmark/dev/lib/line-ending.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/dev/lib/line-ending.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/dev/lib/line-ending.js +34 -0
- package/node_modules/micromark-core-commonmark/dev/lib/list.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/dev/lib/list.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/dev/lib/list.js +306 -0
- package/node_modules/micromark-core-commonmark/dev/lib/partial-non-lazy-continuation.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/dev/lib/partial-non-lazy-continuation.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/dev/lib/partial-non-lazy-continuation.js +67 -0
- package/node_modules/micromark-core-commonmark/dev/lib/setext-underline.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/dev/lib/setext-underline.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/dev/lib/setext-underline.js +213 -0
- package/node_modules/micromark-core-commonmark/dev/lib/thematic-break.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/dev/lib/thematic-break.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/dev/lib/thematic-break.js +120 -0
- package/node_modules/micromark-core-commonmark/index.d.ts +23 -0
- package/node_modules/micromark-core-commonmark/index.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/index.js +22 -0
- package/node_modules/micromark-core-commonmark/lib/attention.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/lib/attention.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/lib/attention.js +231 -0
- package/node_modules/micromark-core-commonmark/lib/autolink.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/lib/autolink.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/lib/autolink.js +233 -0
- package/node_modules/micromark-core-commonmark/lib/blank-line.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/lib/blank-line.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/lib/blank-line.js +61 -0
- package/node_modules/micromark-core-commonmark/lib/block-quote.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/lib/block-quote.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/lib/block-quote.js +143 -0
- package/node_modules/micromark-core-commonmark/lib/character-escape.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/lib/character-escape.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/lib/character-escape.js +64 -0
- package/node_modules/micromark-core-commonmark/lib/character-reference.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/lib/character-reference.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/lib/character-reference.js +149 -0
- package/node_modules/micromark-core-commonmark/lib/code-fenced.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/lib/code-fenced.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/lib/code-fenced.js +422 -0
- package/node_modules/micromark-core-commonmark/lib/code-indented.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/lib/code-indented.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/lib/code-indented.js +159 -0
- package/node_modules/micromark-core-commonmark/lib/code-text.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/lib/code-text.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/lib/code-text.js +225 -0
- package/node_modules/micromark-core-commonmark/lib/content.d.ts +7 -0
- package/node_modules/micromark-core-commonmark/lib/content.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/lib/content.js +163 -0
- package/node_modules/micromark-core-commonmark/lib/definition.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/lib/definition.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/lib/definition.js +254 -0
- package/node_modules/micromark-core-commonmark/lib/hard-break-escape.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/lib/hard-break-escape.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/lib/hard-break-escape.js +60 -0
- package/node_modules/micromark-core-commonmark/lib/heading-atx.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/lib/heading-atx.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/lib/heading-atx.js +191 -0
- package/node_modules/micromark-core-commonmark/lib/html-flow.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/lib/html-flow.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/lib/html-flow.js +827 -0
- package/node_modules/micromark-core-commonmark/lib/html-text.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/lib/html-text.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/lib/html-text.js +678 -0
- package/node_modules/micromark-core-commonmark/lib/label-end.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/lib/label-end.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/lib/label-end.js +561 -0
- package/node_modules/micromark-core-commonmark/lib/label-start-image.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/lib/label-start-image.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/lib/label-start-image.js +110 -0
- package/node_modules/micromark-core-commonmark/lib/label-start-link.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/lib/label-start-link.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/lib/label-start-link.js +63 -0
- package/node_modules/micromark-core-commonmark/lib/line-ending.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/lib/line-ending.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/lib/line-ending.js +33 -0
- package/node_modules/micromark-core-commonmark/lib/list.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/lib/list.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/lib/list.js +213 -0
- package/node_modules/micromark-core-commonmark/lib/partial-non-lazy-continuation.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/lib/partial-non-lazy-continuation.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/lib/partial-non-lazy-continuation.js +61 -0
- package/node_modules/micromark-core-commonmark/lib/setext-underline.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/lib/setext-underline.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/lib/setext-underline.js +187 -0
- package/node_modules/micromark-core-commonmark/lib/thematic-break.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/lib/thematic-break.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/lib/thematic-break.js +102 -0
- package/node_modules/micromark-core-commonmark/license +22 -0
- package/node_modules/micromark-core-commonmark/package.json +62 -0
- package/node_modules/micromark-core-commonmark/readme.md +171 -0
- package/node_modules/micromark-factory-destination/dev/index.d.ts +42 -0
- package/node_modules/micromark-factory-destination/dev/index.d.ts.map +1 -0
- package/node_modules/micromark-factory-destination/dev/index.js +255 -0
- package/node_modules/micromark-factory-destination/index.d.ts +42 -0
- package/node_modules/micromark-factory-destination/index.d.ts.map +1 -0
- package/node_modules/micromark-factory-destination/index.js +206 -0
- package/node_modules/micromark-factory-destination/license +22 -0
- package/node_modules/micromark-factory-destination/package.json +57 -0
- package/node_modules/micromark-factory-destination/readme.md +234 -0
- package/node_modules/micromark-factory-label/dev/index.d.ts +37 -0
- package/node_modules/micromark-factory-label/dev/index.d.ts.map +1 -0
- package/node_modules/micromark-factory-label/dev/index.js +172 -0
- package/node_modules/micromark-factory-label/index.d.ts +37 -0
- package/node_modules/micromark-factory-label/index.d.ts.map +1 -0
- package/node_modules/micromark-factory-label/index.js +148 -0
- package/node_modules/micromark-factory-label/license +22 -0
- package/node_modules/micromark-factory-label/package.json +60 -0
- package/node_modules/micromark-factory-label/readme.md +224 -0
- package/node_modules/micromark-factory-space/dev/index.d.ts +60 -0
- package/node_modules/micromark-factory-space/dev/index.d.ts.map +1 -0
- package/node_modules/micromark-factory-space/dev/index.js +122 -0
- package/node_modules/micromark-factory-space/index.d.ts +60 -0
- package/node_modules/micromark-factory-space/index.d.ts.map +1 -0
- package/node_modules/micromark-factory-space/index.js +116 -0
- package/node_modules/micromark-factory-space/license +22 -0
- package/node_modules/micromark-factory-space/package.json +46 -0
- package/node_modules/micromark-factory-space/readme.md +225 -0
- package/node_modules/micromark-factory-title/dev/index.d.ts +36 -0
- package/node_modules/micromark-factory-title/dev/index.d.ts.map +1 -0
- package/node_modules/micromark-factory-title/dev/index.js +169 -0
- package/node_modules/micromark-factory-title/index.d.ts +36 -0
- package/node_modules/micromark-factory-title/index.d.ts.map +1 -0
- package/node_modules/micromark-factory-title/index.js +158 -0
- package/node_modules/micromark-factory-title/license +22 -0
- package/node_modules/micromark-factory-title/package.json +58 -0
- package/node_modules/micromark-factory-title/readme.md +229 -0
- package/node_modules/micromark-factory-whitespace/dev/index.d.ts +22 -0
- package/node_modules/micromark-factory-whitespace/dev/index.d.ts.map +1 -0
- package/node_modules/micromark-factory-whitespace/dev/index.js +53 -0
- package/node_modules/micromark-factory-whitespace/index.d.ts +22 -0
- package/node_modules/micromark-factory-whitespace/index.d.ts.map +1 -0
- package/node_modules/micromark-factory-whitespace/index.js +44 -0
- package/node_modules/micromark-factory-whitespace/license +22 -0
- package/node_modules/micromark-factory-whitespace/package.json +57 -0
- package/node_modules/micromark-factory-whitespace/readme.md +205 -0
- package/node_modules/micromark-util-character/dev/index.d.ts +195 -0
- package/node_modules/micromark-util-character/dev/index.d.ts.map +1 -0
- package/node_modules/micromark-util-character/dev/index.js +252 -0
- package/node_modules/micromark-util-character/index.d.ts +195 -0
- package/node_modules/micromark-util-character/index.d.ts.map +1 -0
- package/node_modules/micromark-util-character/index.js +246 -0
- package/node_modules/micromark-util-character/license +22 -0
- package/node_modules/micromark-util-character/package.json +57 -0
- package/node_modules/micromark-util-character/readme.md +446 -0
- package/node_modules/micromark-util-chunked/dev/index.d.ts +41 -0
- package/node_modules/micromark-util-chunked/dev/index.d.ts.map +1 -0
- package/node_modules/micromark-util-chunked/dev/index.js +89 -0
- package/node_modules/micromark-util-chunked/index.d.ts +41 -0
- package/node_modules/micromark-util-chunked/index.d.ts.map +1 -0
- package/node_modules/micromark-util-chunked/index.js +81 -0
- package/node_modules/micromark-util-chunked/license +22 -0
- package/node_modules/micromark-util-chunked/package.json +57 -0
- package/node_modules/micromark-util-chunked/readme.md +219 -0
- package/node_modules/micromark-util-classify-character/dev/index.d.ts +18 -0
- package/node_modules/micromark-util-classify-character/dev/index.d.ts.map +1 -0
- package/node_modules/micromark-util-classify-character/dev/index.js +38 -0
- package/node_modules/micromark-util-classify-character/index.d.ts +18 -0
- package/node_modules/micromark-util-classify-character/index.d.ts.map +1 -0
- package/node_modules/micromark-util-classify-character/index.js +27 -0
- package/node_modules/micromark-util-classify-character/license +22 -0
- package/node_modules/micromark-util-classify-character/package.json +59 -0
- package/node_modules/micromark-util-classify-character/readme.md +205 -0
- package/node_modules/micromark-util-combine-extensions/index.d.ts +22 -0
- package/node_modules/micromark-util-combine-extensions/index.d.ts.map +1 -0
- package/node_modules/micromark-util-combine-extensions/index.js +143 -0
- package/node_modules/micromark-util-combine-extensions/license +22 -0
- package/node_modules/micromark-util-combine-extensions/package.json +52 -0
- package/node_modules/micromark-util-combine-extensions/readme.md +201 -0
- package/node_modules/micromark-util-decode-numeric-character-reference/dev/index.d.ts +16 -0
- package/node_modules/micromark-util-decode-numeric-character-reference/dev/index.d.ts.map +1 -0
- package/node_modules/micromark-util-decode-numeric-character-reference/dev/index.js +42 -0
- package/node_modules/micromark-util-decode-numeric-character-reference/index.d.ts +16 -0
- package/node_modules/micromark-util-decode-numeric-character-reference/index.d.ts.map +1 -0
- package/node_modules/micromark-util-decode-numeric-character-reference/index.js +32 -0
- package/node_modules/micromark-util-decode-numeric-character-reference/license +22 -0
- package/node_modules/micromark-util-decode-numeric-character-reference/package.json +59 -0
- package/node_modules/micromark-util-decode-numeric-character-reference/readme.md +184 -0
- package/node_modules/micromark-util-decode-string/dev/index.d.ts +14 -0
- package/node_modules/micromark-util-decode-string/dev/index.d.ts.map +1 -0
- package/node_modules/micromark-util-decode-string/dev/index.js +53 -0
- package/node_modules/micromark-util-decode-string/index.d.ts +14 -0
- package/node_modules/micromark-util-decode-string/index.d.ts.map +1 -0
- package/node_modules/micromark-util-decode-string/index.js +45 -0
- package/node_modules/micromark-util-decode-string/license +22 -0
- package/node_modules/micromark-util-decode-string/package.json +63 -0
- package/node_modules/micromark-util-decode-string/readme.md +179 -0
- package/node_modules/micromark-util-edit-map/dev/index.d.ts +78 -0
- package/node_modules/micromark-util-edit-map/dev/index.d.ts.map +1 -0
- package/node_modules/micromark-util-edit-map/dev/index.js +237 -0
- package/node_modules/micromark-util-edit-map/index.d.ts +78 -0
- package/node_modules/micromark-util-edit-map/index.d.ts.map +1 -0
- package/node_modules/micromark-util-edit-map/index.js +225 -0
- package/node_modules/micromark-util-edit-map/license +22 -0
- package/node_modules/micromark-util-edit-map/package.json +48 -0
- package/node_modules/micromark-util-edit-map/readme.md +234 -0
- package/node_modules/micromark-util-encode/index.d.ts +14 -0
- package/node_modules/micromark-util-encode/index.d.ts.map +1 -0
- package/node_modules/micromark-util-encode/index.js +33 -0
- package/node_modules/micromark-util-encode/license +22 -0
- package/node_modules/micromark-util-encode/package.json +47 -0
- package/node_modules/micromark-util-encode/readme.md +176 -0
- package/node_modules/micromark-util-html-tag-name/index.d.ts +30 -0
- package/node_modules/micromark-util-html-tag-name/index.d.ts.map +1 -0
- package/node_modules/micromark-util-html-tag-name/index.js +93 -0
- package/node_modules/micromark-util-html-tag-name/license +22 -0
- package/node_modules/micromark-util-html-tag-name/package.json +47 -0
- package/node_modules/micromark-util-html-tag-name/readme.md +193 -0
- package/node_modules/micromark-util-normalize-identifier/dev/index.d.ts +21 -0
- package/node_modules/micromark-util-normalize-identifier/dev/index.d.ts.map +1 -0
- package/node_modules/micromark-util-normalize-identifier/dev/index.js +38 -0
- package/node_modules/micromark-util-normalize-identifier/index.d.ts +21 -0
- package/node_modules/micromark-util-normalize-identifier/index.d.ts.map +1 -0
- package/node_modules/micromark-util-normalize-identifier/index.js +33 -0
- package/node_modules/micromark-util-normalize-identifier/license +22 -0
- package/node_modules/micromark-util-normalize-identifier/package.json +58 -0
- package/node_modules/micromark-util-normalize-identifier/readme.md +187 -0
- package/node_modules/micromark-util-resolve-all/index.d.ts +22 -0
- package/node_modules/micromark-util-resolve-all/index.d.ts.map +1 -0
- package/node_modules/micromark-util-resolve-all/index.js +32 -0
- package/node_modules/micromark-util-resolve-all/license +22 -0
- package/node_modules/micromark-util-resolve-all/package.json +48 -0
- package/node_modules/micromark-util-resolve-all/readme.md +238 -0
- package/node_modules/micromark-util-sanitize-uri/dev/index.d.ts +36 -0
- package/node_modules/micromark-util-sanitize-uri/dev/index.d.ts.map +1 -0
- package/node_modules/micromark-util-sanitize-uri/dev/index.js +124 -0
- package/node_modules/micromark-util-sanitize-uri/index.d.ts +36 -0
- package/node_modules/micromark-util-sanitize-uri/index.d.ts.map +1 -0
- package/node_modules/micromark-util-sanitize-uri/index.js +107 -0
- package/node_modules/micromark-util-sanitize-uri/license +22 -0
- package/node_modules/micromark-util-sanitize-uri/package.json +59 -0
- package/node_modules/micromark-util-sanitize-uri/readme.md +214 -0
- package/node_modules/micromark-util-subtokenize/dev/index.d.ts +12 -0
- package/node_modules/micromark-util-subtokenize/dev/index.d.ts.map +1 -0
- package/node_modules/micromark-util-subtokenize/dev/index.js +284 -0
- package/node_modules/micromark-util-subtokenize/dev/lib/splice-buffer.d.ts +161 -0
- package/node_modules/micromark-util-subtokenize/dev/lib/splice-buffer.d.ts.map +1 -0
- package/node_modules/micromark-util-subtokenize/dev/lib/splice-buffer.js +288 -0
- package/node_modules/micromark-util-subtokenize/index.d.ts +12 -0
- package/node_modules/micromark-util-subtokenize/index.d.ts.map +1 -0
- package/node_modules/micromark-util-subtokenize/index.js +228 -0
- package/node_modules/micromark-util-subtokenize/lib/splice-buffer.d.ts +161 -0
- package/node_modules/micromark-util-subtokenize/lib/splice-buffer.d.ts.map +1 -0
- package/node_modules/micromark-util-subtokenize/lib/splice-buffer.js +251 -0
- package/node_modules/micromark-util-subtokenize/license +22 -0
- package/node_modules/micromark-util-subtokenize/package.json +60 -0
- package/node_modules/micromark-util-subtokenize/readme.md +181 -0
- package/node_modules/micromark-util-symbol/lib/codes.d.ts +139 -0
- package/node_modules/micromark-util-symbol/lib/codes.d.ts.map +1 -0
- package/node_modules/micromark-util-symbol/lib/codes.js +158 -0
- package/node_modules/micromark-util-symbol/lib/constants.d.ts +37 -0
- package/node_modules/micromark-util-symbol/lib/constants.d.ts.map +1 -0
- package/node_modules/micromark-util-symbol/lib/constants.js +44 -0
- package/node_modules/micromark-util-symbol/lib/default.d.ts +5 -0
- package/node_modules/micromark-util-symbol/lib/default.d.ts.map +1 -0
- package/node_modules/micromark-util-symbol/lib/default.js +4 -0
- package/node_modules/micromark-util-symbol/lib/types.d.ts +106 -0
- package/node_modules/micromark-util-symbol/lib/types.d.ts.map +1 -0
- package/node_modules/micromark-util-symbol/lib/types.js +453 -0
- package/node_modules/micromark-util-symbol/lib/values.d.ts +102 -0
- package/node_modules/micromark-util-symbol/lib/values.d.ts.map +1 -0
- package/node_modules/micromark-util-symbol/lib/values.js +109 -0
- package/node_modules/micromark-util-symbol/license +22 -0
- package/node_modules/micromark-util-symbol/package.json +43 -0
- package/node_modules/micromark-util-symbol/readme.md +168 -0
- package/node_modules/micromark-util-types/index.d.ts +1315 -0
- package/node_modules/micromark-util-types/index.js +2 -0
- package/node_modules/micromark-util-types/license +22 -0
- package/node_modules/micromark-util-types/package.json +37 -0
- package/node_modules/micromark-util-types/readme.md +151 -0
- package/node_modules/smol-toml/LICENSE +24 -0
- package/node_modules/smol-toml/README.md +605 -0
- package/node_modules/smol-toml/dist/date.d.ts +41 -0
- package/node_modules/smol-toml/dist/date.js +156 -0
- package/node_modules/smol-toml/dist/error.d.ts +37 -0
- package/node_modules/smol-toml/dist/error.js +67 -0
- package/node_modules/smol-toml/dist/extract.js +289 -0
- package/node_modules/smol-toml/dist/index.cjs +770 -0
- package/node_modules/smol-toml/dist/index.d.ts +44 -0
- package/node_modules/smol-toml/dist/index.js +34 -0
- package/node_modules/smol-toml/dist/parse.d.ts +73 -0
- package/node_modules/smol-toml/dist/parse.js +164 -0
- package/node_modules/smol-toml/dist/primitive.js +151 -0
- package/node_modules/smol-toml/dist/stringify.d.ts +32 -0
- package/node_modules/smol-toml/dist/stringify.js +219 -0
- package/node_modules/smol-toml/dist/struct.js +156 -0
- package/node_modules/smol-toml/dist/util.d.ts +43 -0
- package/node_modules/smol-toml/dist/util.js +57 -0
- package/node_modules/smol-toml/package.json +68 -0
- package/node_modules/unist-util-stringify-position/index.d.ts +1 -0
- package/node_modules/unist-util-stringify-position/index.js +1 -0
- package/node_modules/unist-util-stringify-position/lib/index.d.ts +61 -0
- package/node_modules/unist-util-stringify-position/lib/index.js +84 -0
- package/node_modules/unist-util-stringify-position/license +22 -0
- package/node_modules/unist-util-stringify-position/package.json +80 -0
- package/node_modules/unist-util-stringify-position/readme.md +206 -0
- package/package.json +27 -8
- package/scripts/prepare-github-keyring.js +29 -0
- package/src/codex-app.js +20 -2
- package/src/codex-pricing.js +79 -0
- package/src/codex-projects.js +90 -0
- package/src/codex-session-scanner.js +748 -0
- package/src/codex-session-usage.js +332 -0
- package/src/dashboard/app.js +2 -2
- package/src/dashboard/dist/app.js +135 -60
- package/src/dashboard/dist/app.js.map +1 -1
- package/src/dashboard/dist/styles.css +1 -1
- package/src/dashboard/react/components/AnimatedUsage.test.tsx +78 -0
- package/src/dashboard/react/components/CardStatusIcons.test.tsx +146 -0
- package/src/dashboard/react/components/CardStatusIcons.tsx +138 -0
- package/src/dashboard/react/components/ImageGallery.tsx +22 -0
- package/src/dashboard/react/components/ModelSettings.test.tsx +4 -4
- package/src/dashboard/react/components/ModelSettings.tsx +1 -1
- package/src/dashboard/react/components/OpenChatButton.test.tsx +19 -0
- package/src/dashboard/react/components/OpenChatButton.tsx +2 -1
- package/src/dashboard/react/components/PrGlyph.tsx +35 -0
- package/src/dashboard/react/components/PullRequestBadges.tsx +18 -0
- package/src/dashboard/react/components/QueuedPrompts.test.tsx +42 -0
- package/src/dashboard/react/components/QueuedPrompts.tsx +34 -0
- package/src/dashboard/react/components/RelativeTime.test.tsx +100 -0
- package/src/dashboard/react/components/RelativeTime.tsx +46 -11
- package/src/dashboard/react/components/ReplyCover.test.tsx +30 -0
- package/src/dashboard/react/components/ReplyCover.tsx +33 -0
- package/src/dashboard/react/components/ReplyImagePreview.test.tsx +90 -0
- package/src/dashboard/react/components/ReplyImagePreview.tsx +34 -0
- package/src/dashboard/react/components/ReplyMarkdown.test.tsx +108 -0
- package/src/dashboard/react/components/ReplyMarkdown.tsx +112 -0
- package/src/dashboard/react/components/SavedUsageFormat.test.tsx +11 -0
- package/src/dashboard/react/components/SavedUsageFormat.tsx +68 -0
- package/src/dashboard/react/components/StatusBadge.tsx +2 -2
- package/src/dashboard/react/components/TaskBoard.test.tsx +256 -1
- package/src/dashboard/react/components/TaskBoard.tsx +136 -28
- package/src/dashboard/react/components/TaskCard.tsx +7 -4
- package/src/dashboard/react/components/TaskDetail.test.tsx +92 -1
- package/src/dashboard/react/components/TaskDetail.tsx +37 -10
- package/src/dashboard/react/components/TurnContent.test.tsx +44 -0
- package/src/dashboard/react/components/TurnContent.tsx +53 -0
- package/src/dashboard/react/components/UsagePanel.tsx +2 -2
- package/src/dashboard/react/image-cache.test.ts +23 -0
- package/src/dashboard/react/image-cache.ts +33 -0
- package/src/dashboard/react/presentation.test.tsx +31 -0
- package/src/dashboard/react/styles.css +126 -2
- package/src/dashboard/react/types.ts +55 -1
- package/src/dashboard/time.js +39 -0
- package/src/dashboard.js +4 -3
- package/src/data/codex-pricing.json +537 -0
- package/src/mcp-app/dist/index.html +216 -112
- package/src/mcp-app/react/AppearancePicker.test.tsx +50 -0
- package/src/mcp-app/react/AppearancePicker.tsx +56 -0
- package/src/mcp-app/react/GitHubConnection.test.tsx +78 -0
- package/src/mcp-app/react/GitHubConnection.tsx +78 -0
- package/src/mcp-app/react/NextNotificationCenter.test.tsx +121 -0
- package/src/mcp-app/react/NextNotificationCenter.tsx +94 -0
- package/src/mcp-app/react/NextTaskDetail.test.tsx +124 -0
- package/src/mcp-app/react/NextTaskDetail.tsx +147 -0
- package/src/mcp-app/react/ProjectPicker.tsx +49 -0
- package/src/mcp-app/react/main.test.tsx +499 -49
- package/src/mcp-app/react/main.tsx +359 -86
- package/src/mcp-app/react/styles.css +186 -9
- package/src/mcp-app/react/themes.test.ts +34 -0
- package/src/mcp-app/react/themes.ts +112 -0
- package/src/mcp-app.js +238 -120
- package/src/mcp.js +8 -1
- package/src/next-cache.js +16 -0
- package/src/next-github.js +273 -0
- package/src/next-notifications.js +90 -0
- package/src/recorded-usage-tracker.js +92 -0
- package/src/reply-image.js +65 -0
- package/src/usage-tracker.js +7 -6
- package/src/usage.js +7 -355
- package/src/user-prompt.js +55 -0
- package/src/version.js +0 -1
- package/node_modules/proper-lockfile/CHANGELOG.md +0 -108
- package/node_modules/which/CHANGELOG.md +0 -166
- package/src/resolve-ccusage.js +0 -17
|
@@ -0,0 +1,537 @@
|
|
|
1
|
+
# mdast-util-from-markdown
|
|
2
|
+
|
|
3
|
+
[![Build][build-badge]][build]
|
|
4
|
+
[![Coverage][coverage-badge]][coverage]
|
|
5
|
+
[![Downloads][downloads-badge]][downloads]
|
|
6
|
+
[![Size][size-badge]][size]
|
|
7
|
+
[![Sponsors][sponsors-badge]][collective]
|
|
8
|
+
[![Backers][backers-badge]][collective]
|
|
9
|
+
[![Chat][chat-badge]][chat]
|
|
10
|
+
|
|
11
|
+
**[mdast][]** utility that turns markdown into a syntax tree.
|
|
12
|
+
|
|
13
|
+
## Contents
|
|
14
|
+
|
|
15
|
+
* [What is this?](#what-is-this)
|
|
16
|
+
* [When should I use this?](#when-should-i-use-this)
|
|
17
|
+
* [Install](#install)
|
|
18
|
+
* [Use](#use)
|
|
19
|
+
* [API](#api)
|
|
20
|
+
* [`fromMarkdown(value[, encoding][, options])`](#frommarkdownvalue-encoding-options)
|
|
21
|
+
* [`CompileContext`](#compilecontext)
|
|
22
|
+
* [`CompileData`](#compiledata)
|
|
23
|
+
* [`Encoding`](#encoding)
|
|
24
|
+
* [`Extension`](#extension)
|
|
25
|
+
* [`Handle`](#handle)
|
|
26
|
+
* [`OnEnterError`](#onentererror)
|
|
27
|
+
* [`OnExitError`](#onexiterror)
|
|
28
|
+
* [`Options`](#options)
|
|
29
|
+
* [`Token`](#token)
|
|
30
|
+
* [`Transform`](#transform)
|
|
31
|
+
* [`Value`](#value)
|
|
32
|
+
* [List of extensions](#list-of-extensions)
|
|
33
|
+
* [Syntax](#syntax)
|
|
34
|
+
* [Syntax tree](#syntax-tree)
|
|
35
|
+
* [Types](#types)
|
|
36
|
+
* [Compatibility](#compatibility)
|
|
37
|
+
* [Security](#security)
|
|
38
|
+
* [Related](#related)
|
|
39
|
+
* [Contribute](#contribute)
|
|
40
|
+
* [License](#license)
|
|
41
|
+
|
|
42
|
+
## What is this?
|
|
43
|
+
|
|
44
|
+
This package is a utility that takes markdown input and turns it into an
|
|
45
|
+
[mdast][] syntax tree.
|
|
46
|
+
|
|
47
|
+
This utility uses [`micromark`][micromark], which turns markdown into tokens,
|
|
48
|
+
and then turns those tokens into nodes.
|
|
49
|
+
This package is used inside [`remark-parse`][remark-parse], which focusses on
|
|
50
|
+
making it easier to transform content by abstracting these internals away.
|
|
51
|
+
|
|
52
|
+
## When should I use this?
|
|
53
|
+
|
|
54
|
+
If you want to handle syntax trees manually, use this.
|
|
55
|
+
When you *just* want to turn markdown into HTML, use [`micromark`][micromark]
|
|
56
|
+
instead.
|
|
57
|
+
For an easier time processing content, use the **[remark][]** ecosystem instead.
|
|
58
|
+
|
|
59
|
+
You can combine this package with other packages to add syntax extensions to
|
|
60
|
+
markdown.
|
|
61
|
+
Notable examples that deeply integrate with this package are
|
|
62
|
+
[`mdast-util-gfm`][mdast-util-gfm],
|
|
63
|
+
[`mdast-util-mdx`][mdast-util-mdx],
|
|
64
|
+
[`mdast-util-frontmatter`][mdast-util-frontmatter],
|
|
65
|
+
[`mdast-util-math`][mdast-util-math], and
|
|
66
|
+
[`mdast-util-directive`][mdast-util-directive].
|
|
67
|
+
|
|
68
|
+
## Install
|
|
69
|
+
|
|
70
|
+
This package is [ESM only][esm].
|
|
71
|
+
In Node.js (version 16+), install with [npm][]:
|
|
72
|
+
|
|
73
|
+
```sh
|
|
74
|
+
npm install mdast-util-from-markdown
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
In Deno with [`esm.sh`][esmsh]:
|
|
78
|
+
|
|
79
|
+
```js
|
|
80
|
+
import {fromMarkdown} from 'https://esm.sh/mdast-util-from-markdown@2'
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
In browsers with [`esm.sh`][esmsh]:
|
|
84
|
+
|
|
85
|
+
```html
|
|
86
|
+
<script type="module">
|
|
87
|
+
import {fromMarkdown} from 'https://esm.sh/mdast-util-from-markdown@2?bundle'
|
|
88
|
+
</script>
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## Use
|
|
92
|
+
|
|
93
|
+
Say we have the following markdown file `example.md`:
|
|
94
|
+
|
|
95
|
+
```markdown
|
|
96
|
+
## Hello, *World*!
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
…and our module `example.js` looks as follows:
|
|
100
|
+
|
|
101
|
+
```js
|
|
102
|
+
import fs from 'node:fs/promises'
|
|
103
|
+
import {fromMarkdown} from 'mdast-util-from-markdown'
|
|
104
|
+
|
|
105
|
+
const doc = await fs.readFile('example.md')
|
|
106
|
+
const tree = fromMarkdown(doc)
|
|
107
|
+
|
|
108
|
+
console.log(tree)
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
…now running `node example.js` yields (positional info removed for brevity):
|
|
112
|
+
|
|
113
|
+
```js
|
|
114
|
+
{
|
|
115
|
+
type: 'root',
|
|
116
|
+
children: [
|
|
117
|
+
{
|
|
118
|
+
type: 'heading',
|
|
119
|
+
depth: 2,
|
|
120
|
+
children: [
|
|
121
|
+
{type: 'text', value: 'Hello, '},
|
|
122
|
+
{type: 'emphasis', children: [{type: 'text', value: 'World'}]},
|
|
123
|
+
{type: 'text', value: '!'}
|
|
124
|
+
]
|
|
125
|
+
}
|
|
126
|
+
]
|
|
127
|
+
}
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
## API
|
|
131
|
+
|
|
132
|
+
This package exports the identifier [`fromMarkdown`][api-from-markdown].
|
|
133
|
+
There is no default export.
|
|
134
|
+
|
|
135
|
+
The export map supports the [`development` condition][development].
|
|
136
|
+
Run `node --conditions development example.js` to get instrumented dev code.
|
|
137
|
+
Without this condition, production code is loaded.
|
|
138
|
+
|
|
139
|
+
### `fromMarkdown(value[, encoding][, options])`
|
|
140
|
+
|
|
141
|
+
Turn markdown into a syntax tree.
|
|
142
|
+
|
|
143
|
+
###### Overloads
|
|
144
|
+
|
|
145
|
+
* `(value: Value, encoding: Encoding, options?: Options) => Root`
|
|
146
|
+
* `(value: Value, options?: Options) => Root`
|
|
147
|
+
|
|
148
|
+
###### Parameters
|
|
149
|
+
|
|
150
|
+
* `value` ([`Value`][api-value])
|
|
151
|
+
— markdown to parse
|
|
152
|
+
* `encoding` ([`Encoding`][api-encoding], default: `'utf8'`)
|
|
153
|
+
— [character encoding][encoding] for when `value` is
|
|
154
|
+
[`Uint8Array`][uint8-array]
|
|
155
|
+
* `options` ([`Options`][api-options], optional)
|
|
156
|
+
— configuration
|
|
157
|
+
|
|
158
|
+
###### Returns
|
|
159
|
+
|
|
160
|
+
mdast tree ([`Root`][root]).
|
|
161
|
+
|
|
162
|
+
### `CompileContext`
|
|
163
|
+
|
|
164
|
+
mdast compiler context (TypeScript type).
|
|
165
|
+
|
|
166
|
+
###### Fields
|
|
167
|
+
|
|
168
|
+
* `stack` ([`Array<Node>`][node])
|
|
169
|
+
— stack of nodes
|
|
170
|
+
* `tokenStack` (`Array<[Token, OnEnterError | undefined]>`)
|
|
171
|
+
— stack of tokens
|
|
172
|
+
* `data` ([`CompileData`][api-compile-data])
|
|
173
|
+
— info passed around; key/value store
|
|
174
|
+
* `buffer` (`() => undefined`)
|
|
175
|
+
— capture some of the output data
|
|
176
|
+
* `resume` (`() => string`)
|
|
177
|
+
— stop capturing and access the output data
|
|
178
|
+
* `enter` (`(node: Node, token: Token, onError?: OnEnterError) => undefined`)
|
|
179
|
+
— enter a node
|
|
180
|
+
* `exit` (`(token: Token, onError?: OnExitError) => undefined`)
|
|
181
|
+
— exit a node
|
|
182
|
+
* `sliceSerialize` (`(token: Token, expandTabs?: boolean) => string`)
|
|
183
|
+
— get the string value of a token
|
|
184
|
+
* `config` (`Required<Extension>`)
|
|
185
|
+
— configuration
|
|
186
|
+
|
|
187
|
+
### `CompileData`
|
|
188
|
+
|
|
189
|
+
Interface of tracked data (TypeScript type).
|
|
190
|
+
|
|
191
|
+
###### Type
|
|
192
|
+
|
|
193
|
+
```ts
|
|
194
|
+
interface CompileData { /* see code */ }
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
When working on extensions that use more data, extend the corresponding
|
|
198
|
+
interface to register their types:
|
|
199
|
+
|
|
200
|
+
```ts
|
|
201
|
+
declare module 'mdast-util-from-markdown' {
|
|
202
|
+
interface CompileData {
|
|
203
|
+
// Register a new field.
|
|
204
|
+
mathFlowInside?: boolean | undefined
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
### `Encoding`
|
|
210
|
+
|
|
211
|
+
Encodings supported by the [`Uint8Array`][uint8-array] class (TypeScript type).
|
|
212
|
+
|
|
213
|
+
See [`micromark`][micromark-api] for more info.
|
|
214
|
+
|
|
215
|
+
###### Type
|
|
216
|
+
|
|
217
|
+
```ts
|
|
218
|
+
type Encoding = 'utf8' | /* … */
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
### `Extension`
|
|
222
|
+
|
|
223
|
+
Change how markdown tokens from micromark are turned into mdast (TypeScript
|
|
224
|
+
type).
|
|
225
|
+
|
|
226
|
+
###### Properties
|
|
227
|
+
|
|
228
|
+
* `canContainEols` (`Array<string>`, optional)
|
|
229
|
+
— token types where line endings are used
|
|
230
|
+
* `enter` ([`Record<string, Handle>`][api-handle], optional)
|
|
231
|
+
— opening handles
|
|
232
|
+
* `exit` ([`Record<string, Handle>`][api-handle], optional)
|
|
233
|
+
— closing handles
|
|
234
|
+
* `transforms` ([`Array<Transform>`][api-transform], optional)
|
|
235
|
+
— tree transforms
|
|
236
|
+
|
|
237
|
+
### `Handle`
|
|
238
|
+
|
|
239
|
+
Handle a token (TypeScript type).
|
|
240
|
+
|
|
241
|
+
###### Parameters
|
|
242
|
+
|
|
243
|
+
* `this` ([`CompileContext`][api-compile-context])
|
|
244
|
+
— context
|
|
245
|
+
* `token` ([`Token`][api-token])
|
|
246
|
+
— current token
|
|
247
|
+
|
|
248
|
+
###### Returns
|
|
249
|
+
|
|
250
|
+
Nothing (`undefined`).
|
|
251
|
+
|
|
252
|
+
### `OnEnterError`
|
|
253
|
+
|
|
254
|
+
Handle the case where the `right` token is open, but it is closed (by the
|
|
255
|
+
`left` token) or because we reached the end of the document (TypeScript type).
|
|
256
|
+
|
|
257
|
+
###### Parameters
|
|
258
|
+
|
|
259
|
+
* `this` ([`CompileContext`][api-compile-context])
|
|
260
|
+
— context
|
|
261
|
+
* `left` ([`Token`][api-token] or `undefined`)
|
|
262
|
+
— left token
|
|
263
|
+
* `right` ([`Token`][api-token])
|
|
264
|
+
— right token
|
|
265
|
+
|
|
266
|
+
###### Returns
|
|
267
|
+
|
|
268
|
+
Nothing (`undefined`).
|
|
269
|
+
|
|
270
|
+
### `OnExitError`
|
|
271
|
+
|
|
272
|
+
Handle the case where the `right` token is open but it is closed by
|
|
273
|
+
exiting the `left` token (TypeScript type).
|
|
274
|
+
|
|
275
|
+
###### Parameters
|
|
276
|
+
|
|
277
|
+
* `this` ([`CompileContext`][api-compile-context])
|
|
278
|
+
— context
|
|
279
|
+
* `left` ([`Token`][api-token])
|
|
280
|
+
— left token
|
|
281
|
+
* `right` ([`Token`][api-token])
|
|
282
|
+
— right token
|
|
283
|
+
|
|
284
|
+
###### Returns
|
|
285
|
+
|
|
286
|
+
Nothing (`undefined`).
|
|
287
|
+
|
|
288
|
+
### `Options`
|
|
289
|
+
|
|
290
|
+
Configuration (TypeScript type).
|
|
291
|
+
|
|
292
|
+
###### Properties
|
|
293
|
+
|
|
294
|
+
* `extensions` ([`Array<MicromarkExtension>`][micromark-extension], optional)
|
|
295
|
+
— micromark extensions to change how markdown is parsed
|
|
296
|
+
* `mdastExtensions` ([`Array<Extension | Array<Extension>>`][api-extension],
|
|
297
|
+
optional)
|
|
298
|
+
— extensions for this utility to change how tokens are turned into a tree
|
|
299
|
+
|
|
300
|
+
### `Token`
|
|
301
|
+
|
|
302
|
+
Token from micromark (TypeScript type).
|
|
303
|
+
|
|
304
|
+
###### Type
|
|
305
|
+
|
|
306
|
+
```ts
|
|
307
|
+
type Token = { /* … */ }
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
### `Transform`
|
|
311
|
+
|
|
312
|
+
Extra transform, to change the AST afterwards (TypeScript type).
|
|
313
|
+
|
|
314
|
+
###### Parameters
|
|
315
|
+
|
|
316
|
+
* `tree` ([`Root`][root])
|
|
317
|
+
— tree to transform
|
|
318
|
+
|
|
319
|
+
###### Returns
|
|
320
|
+
|
|
321
|
+
New tree ([`Root`][root]) or nothing (in which case the current tree is used).
|
|
322
|
+
|
|
323
|
+
### `Value`
|
|
324
|
+
|
|
325
|
+
Contents of the file (TypeScript type).
|
|
326
|
+
|
|
327
|
+
See [`micromark`][micromark-api] for more info.
|
|
328
|
+
|
|
329
|
+
###### Type
|
|
330
|
+
|
|
331
|
+
```ts
|
|
332
|
+
type Value = Uint8Array | string
|
|
333
|
+
```
|
|
334
|
+
|
|
335
|
+
## List of extensions
|
|
336
|
+
|
|
337
|
+
* [`syntax-tree/mdast-util-directive`](https://github.com/syntax-tree/mdast-util-directive)
|
|
338
|
+
— directives
|
|
339
|
+
* [`syntax-tree/mdast-util-frontmatter`](https://github.com/syntax-tree/mdast-util-frontmatter)
|
|
340
|
+
— frontmatter (YAML, TOML, more)
|
|
341
|
+
* [`syntax-tree/mdast-util-gfm`](https://github.com/syntax-tree/mdast-util-gfm)
|
|
342
|
+
— GFM
|
|
343
|
+
* [`syntax-tree/mdast-util-gfm-autolink-literal`](https://github.com/syntax-tree/mdast-util-gfm-autolink-literal)
|
|
344
|
+
— GFM autolink literals
|
|
345
|
+
* [`syntax-tree/mdast-util-gfm-footnote`](https://github.com/syntax-tree/mdast-util-gfm-footnote)
|
|
346
|
+
— GFM footnotes
|
|
347
|
+
* [`syntax-tree/mdast-util-gfm-strikethrough`](https://github.com/syntax-tree/mdast-util-gfm-strikethrough)
|
|
348
|
+
— GFM strikethrough
|
|
349
|
+
* [`syntax-tree/mdast-util-gfm-table`](https://github.com/syntax-tree/mdast-util-gfm-table)
|
|
350
|
+
— GFM tables
|
|
351
|
+
* [`syntax-tree/mdast-util-gfm-task-list-item`](https://github.com/syntax-tree/mdast-util-gfm-task-list-item)
|
|
352
|
+
— GFM task list items
|
|
353
|
+
* [`syntax-tree/mdast-util-math`](https://github.com/syntax-tree/mdast-util-math)
|
|
354
|
+
— math
|
|
355
|
+
* [`syntax-tree/mdast-util-mdx`](https://github.com/syntax-tree/mdast-util-mdx)
|
|
356
|
+
— MDX
|
|
357
|
+
* [`syntax-tree/mdast-util-mdx-expression`](https://github.com/syntax-tree/mdast-util-mdx-expression)
|
|
358
|
+
— MDX expressions
|
|
359
|
+
* [`syntax-tree/mdast-util-mdx-jsx`](https://github.com/syntax-tree/mdast-util-mdx-jsx)
|
|
360
|
+
— MDX JSX
|
|
361
|
+
* [`syntax-tree/mdast-util-mdxjs-esm`](https://github.com/syntax-tree/mdast-util-mdxjs-esm)
|
|
362
|
+
— MDX ESM
|
|
363
|
+
|
|
364
|
+
## Syntax
|
|
365
|
+
|
|
366
|
+
Markdown is parsed according to CommonMark.
|
|
367
|
+
Extensions can add support for other syntax.
|
|
368
|
+
If you’re interested in extending markdown,
|
|
369
|
+
[more information is available in micromark’s readme][micromark-extension].
|
|
370
|
+
|
|
371
|
+
## Syntax tree
|
|
372
|
+
|
|
373
|
+
The syntax tree is [mdast][].
|
|
374
|
+
|
|
375
|
+
## Types
|
|
376
|
+
|
|
377
|
+
This package is fully typed with [TypeScript][].
|
|
378
|
+
It exports the additional types [`CompileContext`][api-compile-context],
|
|
379
|
+
[`CompileData`][api-compile-data],
|
|
380
|
+
[`Encoding`][api-encoding],
|
|
381
|
+
[`Extension`][api-extension],
|
|
382
|
+
[`Handle`][api-handle],
|
|
383
|
+
[`OnEnterError`][api-on-enter-error],
|
|
384
|
+
[`OnExitError`][api-on-exit-error],
|
|
385
|
+
[`Options`][api-options],
|
|
386
|
+
[`Token`][api-token],
|
|
387
|
+
[`Transform`][api-transform], and
|
|
388
|
+
[`Value`][api-value].
|
|
389
|
+
|
|
390
|
+
## Compatibility
|
|
391
|
+
|
|
392
|
+
Projects maintained by the unified collective are compatible with maintained
|
|
393
|
+
versions of Node.js.
|
|
394
|
+
|
|
395
|
+
When we cut a new major release, we drop support for unmaintained versions of
|
|
396
|
+
Node.
|
|
397
|
+
This means we try to keep the current release line,
|
|
398
|
+
`mdast-util-from-markdown@^2`, compatible with Node.js 16.
|
|
399
|
+
|
|
400
|
+
## Security
|
|
401
|
+
|
|
402
|
+
As markdown is sometimes used for HTML, and improper use of HTML can open you up
|
|
403
|
+
to a [cross-site scripting (XSS)][xss] attack, use of `mdast-util-from-markdown`
|
|
404
|
+
can also be unsafe.
|
|
405
|
+
When going to HTML, use this utility in combination with
|
|
406
|
+
[`hast-util-sanitize`][hast-util-sanitize] to make the tree safe.
|
|
407
|
+
|
|
408
|
+
## Related
|
|
409
|
+
|
|
410
|
+
* [`syntax-tree/mdast-util-to-markdown`](https://github.com/syntax-tree/mdast-util-to-markdown)
|
|
411
|
+
— serialize mdast as markdown
|
|
412
|
+
* [`micromark/micromark`](https://github.com/micromark/micromark)
|
|
413
|
+
— parse markdown
|
|
414
|
+
* [`remarkjs/remark`](https://github.com/remarkjs/remark)
|
|
415
|
+
— process markdown
|
|
416
|
+
|
|
417
|
+
## Contribute
|
|
418
|
+
|
|
419
|
+
See [`contributing.md`][contributing] in [`syntax-tree/.github`][health] for
|
|
420
|
+
ways to get started.
|
|
421
|
+
See [`support.md`][support] for ways to get help.
|
|
422
|
+
|
|
423
|
+
This project has a [code of conduct][coc].
|
|
424
|
+
By interacting with this repository, organization, or community you agree to
|
|
425
|
+
abide by its terms.
|
|
426
|
+
|
|
427
|
+
## License
|
|
428
|
+
|
|
429
|
+
[MIT][license] © [Titus Wormer][author]
|
|
430
|
+
|
|
431
|
+
<!-- Definitions -->
|
|
432
|
+
|
|
433
|
+
[build-badge]: https://github.com/syntax-tree/mdast-util-from-markdown/workflows/main/badge.svg
|
|
434
|
+
|
|
435
|
+
[build]: https://github.com/syntax-tree/mdast-util-from-markdown/actions
|
|
436
|
+
|
|
437
|
+
[coverage-badge]: https://img.shields.io/codecov/c/github/syntax-tree/mdast-util-from-markdown.svg
|
|
438
|
+
|
|
439
|
+
[coverage]: https://codecov.io/github/syntax-tree/mdast-util-from-markdown
|
|
440
|
+
|
|
441
|
+
[downloads-badge]: https://img.shields.io/npm/dm/mdast-util-from-markdown.svg
|
|
442
|
+
|
|
443
|
+
[downloads]: https://www.npmjs.com/package/mdast-util-from-markdown
|
|
444
|
+
|
|
445
|
+
[size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=mdast-util-from-markdown
|
|
446
|
+
|
|
447
|
+
[size]: https://bundlejs.com/?q=mdast-util-from-markdown
|
|
448
|
+
|
|
449
|
+
[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg
|
|
450
|
+
|
|
451
|
+
[backers-badge]: https://opencollective.com/unified/backers/badge.svg
|
|
452
|
+
|
|
453
|
+
[collective]: https://opencollective.com/unified
|
|
454
|
+
|
|
455
|
+
[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg
|
|
456
|
+
|
|
457
|
+
[chat]: https://github.com/syntax-tree/unist/discussions
|
|
458
|
+
|
|
459
|
+
[npm]: https://docs.npmjs.com/cli/install
|
|
460
|
+
|
|
461
|
+
[esmsh]: https://esm.sh
|
|
462
|
+
|
|
463
|
+
[license]: license
|
|
464
|
+
|
|
465
|
+
[author]: https://wooorm.com
|
|
466
|
+
|
|
467
|
+
[health]: https://github.com/syntax-tree/.github
|
|
468
|
+
|
|
469
|
+
[contributing]: https://github.com/syntax-tree/.github/blob/main/contributing.md
|
|
470
|
+
|
|
471
|
+
[support]: https://github.com/syntax-tree/.github/blob/main/support.md
|
|
472
|
+
|
|
473
|
+
[coc]: https://github.com/syntax-tree/.github/blob/main/code-of-conduct.md
|
|
474
|
+
|
|
475
|
+
[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c
|
|
476
|
+
|
|
477
|
+
[typescript]: https://www.typescriptlang.org
|
|
478
|
+
|
|
479
|
+
[mdast]: https://github.com/syntax-tree/mdast
|
|
480
|
+
|
|
481
|
+
[node]: https://github.com/syntax-tree/mdast#nodes
|
|
482
|
+
|
|
483
|
+
[mdast-util-gfm]: https://github.com/syntax-tree/mdast-util-gfm
|
|
484
|
+
|
|
485
|
+
[mdast-util-mdx]: https://github.com/syntax-tree/mdast-util-mdx
|
|
486
|
+
|
|
487
|
+
[mdast-util-frontmatter]: https://github.com/syntax-tree/mdast-util-frontmatter
|
|
488
|
+
|
|
489
|
+
[mdast-util-math]: https://github.com/syntax-tree/mdast-util-math
|
|
490
|
+
|
|
491
|
+
[mdast-util-directive]: https://github.com/syntax-tree/mdast-util-directive
|
|
492
|
+
|
|
493
|
+
[root]: https://github.com/syntax-tree/mdast#root
|
|
494
|
+
|
|
495
|
+
[uint8-array]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array
|
|
496
|
+
|
|
497
|
+
[encoding]: https://nodejs.org/api/util.html#whatwg-supported-encodings
|
|
498
|
+
|
|
499
|
+
[xss]: https://en.wikipedia.org/wiki/Cross-site_scripting
|
|
500
|
+
|
|
501
|
+
[hast-util-sanitize]: https://github.com/syntax-tree/hast-util-sanitize
|
|
502
|
+
|
|
503
|
+
[micromark]: https://github.com/micromark/micromark
|
|
504
|
+
|
|
505
|
+
[micromark-api]: https://github.com/micromark/micromark/tree/main/packages/micromark#micromarkvalue-encoding-options
|
|
506
|
+
|
|
507
|
+
[micromark-extension]: https://github.com/micromark/micromark#extensions
|
|
508
|
+
|
|
509
|
+
[remark]: https://github.com/remarkjs/remark
|
|
510
|
+
|
|
511
|
+
[remark-parse]: https://github.com/remarkjs/remark/tree/main/packages/remark-parse
|
|
512
|
+
|
|
513
|
+
[development]: https://nodejs.org/api/packages.html#packages_resolving_user_conditions
|
|
514
|
+
|
|
515
|
+
[api-from-markdown]: #frommarkdownvalue-encoding-options
|
|
516
|
+
|
|
517
|
+
[api-compile-context]: #compilecontext
|
|
518
|
+
|
|
519
|
+
[api-compile-data]: #compiledata
|
|
520
|
+
|
|
521
|
+
[api-encoding]: #encoding
|
|
522
|
+
|
|
523
|
+
[api-extension]: #extension
|
|
524
|
+
|
|
525
|
+
[api-handle]: #handle
|
|
526
|
+
|
|
527
|
+
[api-on-enter-error]: #onentererror
|
|
528
|
+
|
|
529
|
+
[api-on-exit-error]: #onexiterror
|
|
530
|
+
|
|
531
|
+
[api-options]: #options
|
|
532
|
+
|
|
533
|
+
[api-token]: #token
|
|
534
|
+
|
|
535
|
+
[api-transform]: #transform
|
|
536
|
+
|
|
537
|
+
[api-value]: #value
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Get the text content of a node or list of nodes.
|
|
3
|
+
*
|
|
4
|
+
* Prefers the node’s plain-text fields, otherwise serializes its children,
|
|
5
|
+
* and if the given value is an array, serialize the nodes in it.
|
|
6
|
+
*
|
|
7
|
+
* @param {unknown} [value]
|
|
8
|
+
* Thing to serialize, typically `Node`.
|
|
9
|
+
* @param {Options | null | undefined} [options]
|
|
10
|
+
* Configuration (optional).
|
|
11
|
+
* @returns {string}
|
|
12
|
+
* Serialized `value`.
|
|
13
|
+
*/
|
|
14
|
+
export function toString(
|
|
15
|
+
value?: unknown,
|
|
16
|
+
options?: Options | null | undefined
|
|
17
|
+
): string
|
|
18
|
+
export type Nodes = import('mdast').Nodes
|
|
19
|
+
/**
|
|
20
|
+
* Configuration (optional).
|
|
21
|
+
*/
|
|
22
|
+
export type Options = {
|
|
23
|
+
/**
|
|
24
|
+
* Whether to use `alt` for `image`s (default: `true`).
|
|
25
|
+
*/
|
|
26
|
+
includeImageAlt?: boolean | null | undefined
|
|
27
|
+
/**
|
|
28
|
+
* Whether to use `value` of HTML (default: `true`).
|
|
29
|
+
*/
|
|
30
|
+
includeHtml?: boolean | null | undefined
|
|
31
|
+
}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {import('mdast').Nodes} Nodes
|
|
3
|
+
*
|
|
4
|
+
* @typedef Options
|
|
5
|
+
* Configuration (optional).
|
|
6
|
+
* @property {boolean | null | undefined} [includeImageAlt=true]
|
|
7
|
+
* Whether to use `alt` for `image`s (default: `true`).
|
|
8
|
+
* @property {boolean | null | undefined} [includeHtml=true]
|
|
9
|
+
* Whether to use `value` of HTML (default: `true`).
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
/** @type {Options} */
|
|
13
|
+
const emptyOptions = {}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Get the text content of a node or list of nodes.
|
|
17
|
+
*
|
|
18
|
+
* Prefers the node’s plain-text fields, otherwise serializes its children,
|
|
19
|
+
* and if the given value is an array, serialize the nodes in it.
|
|
20
|
+
*
|
|
21
|
+
* @param {unknown} [value]
|
|
22
|
+
* Thing to serialize, typically `Node`.
|
|
23
|
+
* @param {Options | null | undefined} [options]
|
|
24
|
+
* Configuration (optional).
|
|
25
|
+
* @returns {string}
|
|
26
|
+
* Serialized `value`.
|
|
27
|
+
*/
|
|
28
|
+
export function toString(value, options) {
|
|
29
|
+
const settings = options || emptyOptions
|
|
30
|
+
const includeImageAlt =
|
|
31
|
+
typeof settings.includeImageAlt === 'boolean'
|
|
32
|
+
? settings.includeImageAlt
|
|
33
|
+
: true
|
|
34
|
+
const includeHtml =
|
|
35
|
+
typeof settings.includeHtml === 'boolean' ? settings.includeHtml : true
|
|
36
|
+
|
|
37
|
+
return one(value, includeImageAlt, includeHtml)
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* One node or several nodes.
|
|
42
|
+
*
|
|
43
|
+
* @param {unknown} value
|
|
44
|
+
* Thing to serialize.
|
|
45
|
+
* @param {boolean} includeImageAlt
|
|
46
|
+
* Include image `alt`s.
|
|
47
|
+
* @param {boolean} includeHtml
|
|
48
|
+
* Include HTML.
|
|
49
|
+
* @returns {string}
|
|
50
|
+
* Serialized node.
|
|
51
|
+
*/
|
|
52
|
+
function one(value, includeImageAlt, includeHtml) {
|
|
53
|
+
if (node(value)) {
|
|
54
|
+
if ('value' in value) {
|
|
55
|
+
return value.type === 'html' && !includeHtml ? '' : value.value
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
if (includeImageAlt && 'alt' in value && value.alt) {
|
|
59
|
+
return value.alt
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
if ('children' in value) {
|
|
63
|
+
return all(value.children, includeImageAlt, includeHtml)
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
if (Array.isArray(value)) {
|
|
68
|
+
return all(value, includeImageAlt, includeHtml)
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
return ''
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Serialize a list of nodes.
|
|
76
|
+
*
|
|
77
|
+
* @param {Array<unknown>} values
|
|
78
|
+
* Thing to serialize.
|
|
79
|
+
* @param {boolean} includeImageAlt
|
|
80
|
+
* Include image `alt`s.
|
|
81
|
+
* @param {boolean} includeHtml
|
|
82
|
+
* Include HTML.
|
|
83
|
+
* @returns {string}
|
|
84
|
+
* Serialized nodes.
|
|
85
|
+
*/
|
|
86
|
+
function all(values, includeImageAlt, includeHtml) {
|
|
87
|
+
/** @type {Array<string>} */
|
|
88
|
+
const result = []
|
|
89
|
+
let index = -1
|
|
90
|
+
|
|
91
|
+
while (++index < values.length) {
|
|
92
|
+
result[index] = one(values[index], includeImageAlt, includeHtml)
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
return result.join('')
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Check if `value` looks like a node.
|
|
100
|
+
*
|
|
101
|
+
* @param {unknown} value
|
|
102
|
+
* Thing.
|
|
103
|
+
* @returns {value is Nodes}
|
|
104
|
+
* Whether `value` is a node.
|
|
105
|
+
*/
|
|
106
|
+
function node(value) {
|
|
107
|
+
return Boolean(value && typeof value === 'object')
|
|
108
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
(The MIT License)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2015 Titus Wormer <tituswormer@gmail.com>
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
6
|
+
a copy of this software and associated documentation files (the
|
|
7
|
+
'Software'), to deal in the Software without restriction, including
|
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
11
|
+
the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be
|
|
14
|
+
included in all copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
19
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
20
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
21
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
22
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|