@alexlit/lint-kit 112.3.4 → 113.0.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/package.json +1 -1
- package/packages/config-eslint/package.json +7 -7
- package/packages/config-markdownlint/node_modules/entities/LICENSE +11 -0
- package/packages/config-markdownlint/node_modules/entities/lib/decode.d.ts +211 -0
- package/packages/config-markdownlint/node_modules/entities/lib/decode.d.ts.map +1 -0
- package/packages/config-markdownlint/node_modules/entities/lib/decode.js +536 -0
- package/packages/config-markdownlint/node_modules/entities/lib/decode.js.map +1 -0
- package/packages/config-markdownlint/node_modules/entities/lib/decode_codepoint.d.ts +19 -0
- package/packages/config-markdownlint/node_modules/entities/lib/decode_codepoint.d.ts.map +1 -0
- package/packages/config-markdownlint/node_modules/entities/lib/decode_codepoint.js +76 -0
- package/packages/config-markdownlint/node_modules/entities/lib/decode_codepoint.js.map +1 -0
- package/packages/config-markdownlint/node_modules/entities/lib/encode.d.ts +22 -0
- package/packages/config-markdownlint/node_modules/entities/lib/encode.d.ts.map +1 -0
- package/packages/config-markdownlint/node_modules/entities/lib/encode.js +77 -0
- package/packages/config-markdownlint/node_modules/entities/lib/encode.js.map +1 -0
- package/packages/config-markdownlint/node_modules/entities/lib/escape.d.ts +43 -0
- package/packages/config-markdownlint/node_modules/entities/lib/escape.d.ts.map +1 -0
- package/packages/config-markdownlint/node_modules/entities/lib/escape.js +122 -0
- package/packages/config-markdownlint/node_modules/entities/lib/escape.js.map +1 -0
- package/packages/config-markdownlint/node_modules/entities/lib/esm/decode.d.ts +211 -0
- package/packages/config-markdownlint/node_modules/entities/lib/esm/decode.d.ts.map +1 -0
- package/packages/config-markdownlint/node_modules/entities/lib/esm/decode.js +496 -0
- package/packages/config-markdownlint/node_modules/entities/lib/esm/decode.js.map +1 -0
- package/packages/config-markdownlint/node_modules/entities/lib/esm/decode_codepoint.d.ts +19 -0
- package/packages/config-markdownlint/node_modules/entities/lib/esm/decode_codepoint.d.ts.map +1 -0
- package/packages/config-markdownlint/node_modules/entities/lib/esm/decode_codepoint.js +71 -0
- package/packages/config-markdownlint/node_modules/entities/lib/esm/decode_codepoint.js.map +1 -0
- package/packages/config-markdownlint/node_modules/entities/lib/esm/encode.d.ts +22 -0
- package/packages/config-markdownlint/node_modules/entities/lib/esm/encode.d.ts.map +1 -0
- package/packages/config-markdownlint/node_modules/entities/lib/esm/encode.js +69 -0
- package/packages/config-markdownlint/node_modules/entities/lib/esm/encode.js.map +1 -0
- package/packages/config-markdownlint/node_modules/entities/lib/esm/escape.d.ts +43 -0
- package/packages/config-markdownlint/node_modules/entities/lib/esm/escape.d.ts.map +1 -0
- package/packages/config-markdownlint/node_modules/entities/lib/esm/escape.js +116 -0
- package/packages/config-markdownlint/node_modules/entities/lib/esm/escape.js.map +1 -0
- package/packages/config-markdownlint/node_modules/entities/lib/esm/generated/decode-data-html.d.ts +3 -0
- package/packages/config-markdownlint/node_modules/entities/lib/esm/generated/decode-data-html.d.ts.map +1 -0
- package/packages/config-markdownlint/node_modules/entities/lib/esm/generated/decode-data-html.js +7 -0
- package/packages/config-markdownlint/node_modules/entities/lib/esm/generated/decode-data-html.js.map +1 -0
- package/packages/config-markdownlint/node_modules/entities/lib/esm/generated/decode-data-xml.d.ts +3 -0
- package/packages/config-markdownlint/node_modules/entities/lib/esm/generated/decode-data-xml.d.ts.map +1 -0
- package/packages/config-markdownlint/node_modules/entities/lib/esm/generated/decode-data-xml.js +7 -0
- package/packages/config-markdownlint/node_modules/entities/lib/esm/generated/decode-data-xml.js.map +1 -0
- package/packages/config-markdownlint/node_modules/entities/lib/esm/generated/encode-html.d.ts +8 -0
- package/packages/config-markdownlint/node_modules/entities/lib/esm/generated/encode-html.d.ts.map +1 -0
- package/packages/config-markdownlint/node_modules/entities/lib/esm/generated/encode-html.js +10 -0
- package/packages/config-markdownlint/node_modules/entities/lib/esm/generated/encode-html.js.map +1 -0
- package/packages/config-markdownlint/node_modules/entities/lib/esm/index.d.ts +96 -0
- package/packages/config-markdownlint/node_modules/entities/lib/esm/index.d.ts.map +1 -0
- package/packages/config-markdownlint/node_modules/entities/lib/esm/index.js +99 -0
- package/packages/config-markdownlint/node_modules/entities/lib/esm/index.js.map +1 -0
- package/packages/config-markdownlint/node_modules/entities/lib/esm/package.json +1 -0
- package/packages/config-markdownlint/node_modules/entities/lib/generated/decode-data-html.d.ts +3 -0
- package/packages/config-markdownlint/node_modules/entities/lib/generated/decode-data-html.d.ts.map +1 -0
- package/packages/config-markdownlint/node_modules/entities/lib/generated/decode-data-html.js +9 -0
- package/packages/config-markdownlint/node_modules/entities/lib/generated/decode-data-html.js.map +1 -0
- package/packages/config-markdownlint/node_modules/entities/lib/generated/decode-data-xml.d.ts +3 -0
- package/packages/config-markdownlint/node_modules/entities/lib/generated/decode-data-xml.d.ts.map +1 -0
- package/packages/config-markdownlint/node_modules/entities/lib/generated/decode-data-xml.js +9 -0
- package/packages/config-markdownlint/node_modules/entities/lib/generated/decode-data-xml.js.map +1 -0
- package/packages/config-markdownlint/node_modules/entities/lib/generated/encode-html.d.ts +8 -0
- package/packages/config-markdownlint/node_modules/entities/lib/generated/encode-html.d.ts.map +1 -0
- package/packages/config-markdownlint/node_modules/entities/lib/generated/encode-html.js +12 -0
- package/packages/config-markdownlint/node_modules/entities/lib/generated/encode-html.js.map +1 -0
- package/packages/config-markdownlint/node_modules/entities/lib/index.d.ts +96 -0
- package/packages/config-markdownlint/node_modules/entities/lib/index.d.ts.map +1 -0
- package/packages/config-markdownlint/node_modules/entities/lib/index.js +126 -0
- package/packages/config-markdownlint/node_modules/entities/lib/index.js.map +1 -0
- package/packages/config-markdownlint/node_modules/entities/package.json +90 -0
- package/packages/config-markdownlint/node_modules/entities/readme.md +122 -0
- package/packages/config-markdownlint/node_modules/markdown-it/LICENSE +22 -0
- package/packages/config-markdownlint/node_modules/markdown-it/README.md +324 -0
- package/packages/config-markdownlint/node_modules/markdown-it/bin/markdown-it.mjs +107 -0
- package/packages/config-markdownlint/node_modules/markdown-it/dist/index.cjs.js +5540 -0
- package/packages/config-markdownlint/node_modules/markdown-it/dist/markdown-it.js +6963 -0
- package/packages/config-markdownlint/node_modules/markdown-it/dist/markdown-it.min.js +2 -0
- package/packages/config-markdownlint/node_modules/markdown-it/index.mjs +1 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/common/html_blocks.mjs +67 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/common/html_re.mjs +25 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/common/utils.mjs +304 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/helpers/index.mjs +11 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/helpers/parse_link_destination.mjs +77 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/helpers/parse_link_label.mjs +49 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/helpers/parse_link_title.mjs +66 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/index.mjs +565 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/parser_block.mjs +134 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/parser_core.mjs +62 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/parser_inline.mjs +197 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/presets/commonmark.mjs +88 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/presets/default.mjs +47 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/presets/zero.mjs +70 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/renderer.mjs +322 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/ruler.mjs +340 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_block/blockquote.mjs +209 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_block/code.mjs +30 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_block/fence.mjs +94 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_block/heading.mjs +51 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_block/hr.mjs +40 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_block/html_block.mjs +69 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_block/lheading.mjs +82 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_block/list.mjs +331 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_block/paragraph.mjs +46 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_block/reference.mjs +212 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_block/state_block.mjs +220 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_block/table.mjs +228 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_core/block.mjs +13 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_core/inline.mjs +11 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_core/linkify.mjs +134 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_core/normalize.mjs +17 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_core/replacements.mjs +101 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_core/smartquotes.mjs +193 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_core/state_core.mjs +17 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_core/text_join.mjs +43 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_inline/autolink.mjs +72 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_inline/backticks.mjs +60 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_inline/balance_pairs.mjs +124 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_inline/emphasis.mjs +123 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_inline/entity.mjs +51 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_inline/escape.mjs +69 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_inline/fragments_join.mjs +38 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_inline/html_inline.mjs +50 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_inline/image.mjs +138 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_inline/link.mjs +139 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_inline/linkify.mjs +56 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_inline/newline.mjs +42 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_inline/state_inline.mjs +123 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_inline/strikethrough.mjs +127 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_inline/text.mjs +86 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/token.mjs +191 -0
- package/packages/config-markdownlint/node_modules/markdown-it/package.json +92 -0
- package/packages/config-markdownlint/node_modules/markdownlint/CHANGELOG.md +446 -0
- package/packages/config-markdownlint/node_modules/markdownlint/CONTRIBUTING.md +93 -0
- package/packages/config-markdownlint/node_modules/markdownlint/LICENSE +21 -0
- package/packages/config-markdownlint/node_modules/markdownlint/README.md +1032 -0
- package/packages/config-markdownlint/node_modules/markdownlint/demo/markdownlint-browser.js +7116 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/CustomRules.md +383 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/Prettier.md +27 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/ReleaseProcess.md +20 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/Rules.md +2462 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md001.md +37 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md003.md +59 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md004.md +49 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md005.md +53 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md007.md +52 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md009.md +51 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md010.md +56 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md011.md +30 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md012.md +38 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md013.md +58 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md014.md +54 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md018.md +27 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md019.md +28 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md020.md +29 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md021.md +31 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md022.md +52 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md023.md +33 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md024.md +44 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md025.md +49 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md026.md +40 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md027.md +24 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md028.md +40 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md029.md +98 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md030.md +82 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md031.md +50 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md032.md +55 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md033.md +27 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md034.md +50 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md035.md +42 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md036.md +45 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md037.md +37 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md038.md +40 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md039.md +21 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md040.md +52 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md041.md +49 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md042.md +32 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md043.md +69 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md044.md +35 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md045.md +40 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md046.md +40 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md047.md +34 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md048.md +41 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md049.md +35 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md050.md +35 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md051.md +87 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md052.md +40 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md053.md +38 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md054.md +100 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md055.md +54 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md056.md +37 -0
- package/packages/config-markdownlint/node_modules/markdownlint/helpers/LICENSE +21 -0
- package/packages/config-markdownlint/node_modules/markdownlint/helpers/README.md +72 -0
- package/packages/config-markdownlint/node_modules/markdownlint/helpers/helpers.js +1025 -0
- package/packages/config-markdownlint/node_modules/markdownlint/helpers/micromark.cjs +445 -0
- package/packages/config-markdownlint/node_modules/markdownlint/helpers/package.json +26 -0
- package/packages/config-markdownlint/node_modules/markdownlint/helpers/shared.js +10 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/cache.js +21 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/configuration.d.ts +1178 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/constants.js +14 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/markdownlint.d.ts +479 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/markdownlint.js +1550 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md001.js +25 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md003.js +45 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md004.js +79 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md005.js +81 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md007.js +92 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md009.js +89 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md010.js +63 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md011.js +49 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md012.js +35 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md013.js +99 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md014.js +57 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md018.js +38 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md019.js +42 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md020.js +65 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md021.js +65 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md022.js +116 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md023.js +41 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md024.js +45 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md025.js +35 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md026.js +54 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md027.js +42 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md028.js +47 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md029.js +70 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md030.js +66 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md031.js +43 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md032.js +76 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md033.js +46 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md034.js +105 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md035.js +31 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md036.js +50 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md037.js +99 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md038.js +106 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md039.js +71 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md040.js +42 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md041.js +37 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md042.js +53 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md043.js +67 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md044.js +115 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md045.js +67 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md046.js +40 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md047.js +31 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md048.js +43 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md049-md050.js +108 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md051.js +176 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md052.js +42 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md053.js +62 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md054.js +130 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md055.js +80 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md056.js +52 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/rules.js +67 -0
- package/packages/config-markdownlint/node_modules/markdownlint/package.json +103 -0
- package/packages/config-markdownlint/node_modules/markdownlint/schema/.markdownlint.jsonc +304 -0
- package/packages/config-markdownlint/node_modules/markdownlint/schema/.markdownlint.yaml +272 -0
- package/packages/config-markdownlint/node_modules/markdownlint/schema/ValidatingConfiguration.md +28 -0
- package/packages/config-markdownlint/node_modules/markdownlint/schema/markdownlint-config-schema.json +1814 -0
- package/packages/config-markdownlint/node_modules/markdownlint/style/all.json +5 -0
- package/packages/config-markdownlint/node_modules/markdownlint/style/cirosantilli.json +22 -0
- package/packages/config-markdownlint/node_modules/markdownlint/style/prettier.json +26 -0
- package/packages/config-markdownlint/node_modules/markdownlint/style/relaxed.json +12 -0
- package/packages/config-markdownlint/node_modules/markdownlint-micromark/LICENSE +21 -0
- package/packages/config-markdownlint/node_modules/markdownlint-micromark/README.md +10 -0
- package/packages/config-markdownlint/node_modules/markdownlint-micromark/micromark-browser.js +2 -0
- package/packages/config-markdownlint/node_modules/markdownlint-micromark/micromark-html-browser.js +2 -0
- package/packages/config-markdownlint/node_modules/markdownlint-micromark/micromark.cjs +1 -0
- package/packages/config-markdownlint/node_modules/markdownlint-micromark/micromark.d.ts +1751 -0
- package/packages/config-markdownlint/node_modules/markdownlint-micromark/package.json +46 -0
- package/packages/config-markdownlint/package.json +2 -2
- package/packages/config-stylelint/package.json +3 -3
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
// Utilities
|
|
2
|
+
//
|
|
3
|
+
|
|
4
|
+
import * as mdurl from 'mdurl'
|
|
5
|
+
import * as ucmicro from 'uc.micro'
|
|
6
|
+
import { decodeHTML } from 'entities'
|
|
7
|
+
|
|
8
|
+
function _class (obj) { return Object.prototype.toString.call(obj) }
|
|
9
|
+
|
|
10
|
+
function isString (obj) { return _class(obj) === '[object String]' }
|
|
11
|
+
|
|
12
|
+
const _hasOwnProperty = Object.prototype.hasOwnProperty
|
|
13
|
+
|
|
14
|
+
function has (object, key) {
|
|
15
|
+
return _hasOwnProperty.call(object, key)
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
// Merge objects
|
|
19
|
+
//
|
|
20
|
+
function assign (obj /* from1, from2, from3, ... */) {
|
|
21
|
+
const sources = Array.prototype.slice.call(arguments, 1)
|
|
22
|
+
|
|
23
|
+
sources.forEach(function (source) {
|
|
24
|
+
if (!source) { return }
|
|
25
|
+
|
|
26
|
+
if (typeof source !== 'object') {
|
|
27
|
+
throw new TypeError(source + 'must be object')
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
Object.keys(source).forEach(function (key) {
|
|
31
|
+
obj[key] = source[key]
|
|
32
|
+
})
|
|
33
|
+
})
|
|
34
|
+
|
|
35
|
+
return obj
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// Remove element from array and put another array at those position.
|
|
39
|
+
// Useful for some operations with tokens
|
|
40
|
+
function arrayReplaceAt (src, pos, newElements) {
|
|
41
|
+
return [].concat(src.slice(0, pos), newElements, src.slice(pos + 1))
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function isValidEntityCode (c) {
|
|
45
|
+
/* eslint no-bitwise:0 */
|
|
46
|
+
// broken sequence
|
|
47
|
+
if (c >= 0xD800 && c <= 0xDFFF) { return false }
|
|
48
|
+
// never used
|
|
49
|
+
if (c >= 0xFDD0 && c <= 0xFDEF) { return false }
|
|
50
|
+
if ((c & 0xFFFF) === 0xFFFF || (c & 0xFFFF) === 0xFFFE) { return false }
|
|
51
|
+
// control codes
|
|
52
|
+
if (c >= 0x00 && c <= 0x08) { return false }
|
|
53
|
+
if (c === 0x0B) { return false }
|
|
54
|
+
if (c >= 0x0E && c <= 0x1F) { return false }
|
|
55
|
+
if (c >= 0x7F && c <= 0x9F) { return false }
|
|
56
|
+
// out of range
|
|
57
|
+
if (c > 0x10FFFF) { return false }
|
|
58
|
+
return true
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function fromCodePoint (c) {
|
|
62
|
+
/* eslint no-bitwise:0 */
|
|
63
|
+
if (c > 0xffff) {
|
|
64
|
+
c -= 0x10000
|
|
65
|
+
const surrogate1 = 0xd800 + (c >> 10)
|
|
66
|
+
const surrogate2 = 0xdc00 + (c & 0x3ff)
|
|
67
|
+
|
|
68
|
+
return String.fromCharCode(surrogate1, surrogate2)
|
|
69
|
+
}
|
|
70
|
+
return String.fromCharCode(c)
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
const UNESCAPE_MD_RE = /\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g
|
|
74
|
+
const ENTITY_RE = /&([a-z#][a-z0-9]{1,31});/gi
|
|
75
|
+
const UNESCAPE_ALL_RE = new RegExp(UNESCAPE_MD_RE.source + '|' + ENTITY_RE.source, 'gi')
|
|
76
|
+
|
|
77
|
+
const DIGITAL_ENTITY_TEST_RE = /^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i
|
|
78
|
+
|
|
79
|
+
function replaceEntityPattern (match, name) {
|
|
80
|
+
if (name.charCodeAt(0) === 0x23/* # */ && DIGITAL_ENTITY_TEST_RE.test(name)) {
|
|
81
|
+
const code = name[1].toLowerCase() === 'x'
|
|
82
|
+
? parseInt(name.slice(2), 16)
|
|
83
|
+
: parseInt(name.slice(1), 10)
|
|
84
|
+
|
|
85
|
+
if (isValidEntityCode(code)) {
|
|
86
|
+
return fromCodePoint(code)
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
return match
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
const decoded = decodeHTML(match)
|
|
93
|
+
if (decoded !== match) {
|
|
94
|
+
return decoded
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
return match
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/* function replaceEntities(str) {
|
|
101
|
+
if (str.indexOf('&') < 0) { return str; }
|
|
102
|
+
|
|
103
|
+
return str.replace(ENTITY_RE, replaceEntityPattern);
|
|
104
|
+
} */
|
|
105
|
+
|
|
106
|
+
function unescapeMd (str) {
|
|
107
|
+
if (str.indexOf('\\') < 0) { return str }
|
|
108
|
+
return str.replace(UNESCAPE_MD_RE, '$1')
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
function unescapeAll (str) {
|
|
112
|
+
if (str.indexOf('\\') < 0 && str.indexOf('&') < 0) { return str }
|
|
113
|
+
|
|
114
|
+
return str.replace(UNESCAPE_ALL_RE, function (match, escaped, entity) {
|
|
115
|
+
if (escaped) { return escaped }
|
|
116
|
+
return replaceEntityPattern(match, entity)
|
|
117
|
+
})
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
const HTML_ESCAPE_TEST_RE = /[&<>"]/
|
|
121
|
+
const HTML_ESCAPE_REPLACE_RE = /[&<>"]/g
|
|
122
|
+
const HTML_REPLACEMENTS = {
|
|
123
|
+
'&': '&',
|
|
124
|
+
'<': '<',
|
|
125
|
+
'>': '>',
|
|
126
|
+
'"': '"'
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
function replaceUnsafeChar (ch) {
|
|
130
|
+
return HTML_REPLACEMENTS[ch]
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
function escapeHtml (str) {
|
|
134
|
+
if (HTML_ESCAPE_TEST_RE.test(str)) {
|
|
135
|
+
return str.replace(HTML_ESCAPE_REPLACE_RE, replaceUnsafeChar)
|
|
136
|
+
}
|
|
137
|
+
return str
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
const REGEXP_ESCAPE_RE = /[.?*+^$[\]\\(){}|-]/g
|
|
141
|
+
|
|
142
|
+
function escapeRE (str) {
|
|
143
|
+
return str.replace(REGEXP_ESCAPE_RE, '\\$&')
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
function isSpace (code) {
|
|
147
|
+
switch (code) {
|
|
148
|
+
case 0x09:
|
|
149
|
+
case 0x20:
|
|
150
|
+
return true
|
|
151
|
+
}
|
|
152
|
+
return false
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
// Zs (unicode class) || [\t\f\v\r\n]
|
|
156
|
+
function isWhiteSpace (code) {
|
|
157
|
+
if (code >= 0x2000 && code <= 0x200A) { return true }
|
|
158
|
+
switch (code) {
|
|
159
|
+
case 0x09: // \t
|
|
160
|
+
case 0x0A: // \n
|
|
161
|
+
case 0x0B: // \v
|
|
162
|
+
case 0x0C: // \f
|
|
163
|
+
case 0x0D: // \r
|
|
164
|
+
case 0x20:
|
|
165
|
+
case 0xA0:
|
|
166
|
+
case 0x1680:
|
|
167
|
+
case 0x202F:
|
|
168
|
+
case 0x205F:
|
|
169
|
+
case 0x3000:
|
|
170
|
+
return true
|
|
171
|
+
}
|
|
172
|
+
return false
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
/* eslint-disable max-len */
|
|
176
|
+
|
|
177
|
+
// Currently without astral characters support.
|
|
178
|
+
function isPunctChar (ch) {
|
|
179
|
+
return ucmicro.P.test(ch) || ucmicro.S.test(ch)
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
// Markdown ASCII punctuation characters.
|
|
183
|
+
//
|
|
184
|
+
// !, ", #, $, %, &, ', (, ), *, +, ,, -, ., /, :, ;, <, =, >, ?, @, [, \, ], ^, _, `, {, |, }, or ~
|
|
185
|
+
// http://spec.commonmark.org/0.15/#ascii-punctuation-character
|
|
186
|
+
//
|
|
187
|
+
// Don't confuse with unicode punctuation !!! It lacks some chars in ascii range.
|
|
188
|
+
//
|
|
189
|
+
function isMdAsciiPunct (ch) {
|
|
190
|
+
switch (ch) {
|
|
191
|
+
case 0x21/* ! */:
|
|
192
|
+
case 0x22/* " */:
|
|
193
|
+
case 0x23/* # */:
|
|
194
|
+
case 0x24/* $ */:
|
|
195
|
+
case 0x25/* % */:
|
|
196
|
+
case 0x26/* & */:
|
|
197
|
+
case 0x27/* ' */:
|
|
198
|
+
case 0x28/* ( */:
|
|
199
|
+
case 0x29/* ) */:
|
|
200
|
+
case 0x2A/* * */:
|
|
201
|
+
case 0x2B/* + */:
|
|
202
|
+
case 0x2C/* , */:
|
|
203
|
+
case 0x2D/* - */:
|
|
204
|
+
case 0x2E/* . */:
|
|
205
|
+
case 0x2F/* / */:
|
|
206
|
+
case 0x3A/* : */:
|
|
207
|
+
case 0x3B/* ; */:
|
|
208
|
+
case 0x3C/* < */:
|
|
209
|
+
case 0x3D/* = */:
|
|
210
|
+
case 0x3E/* > */:
|
|
211
|
+
case 0x3F/* ? */:
|
|
212
|
+
case 0x40/* @ */:
|
|
213
|
+
case 0x5B/* [ */:
|
|
214
|
+
case 0x5C/* \ */:
|
|
215
|
+
case 0x5D/* ] */:
|
|
216
|
+
case 0x5E/* ^ */:
|
|
217
|
+
case 0x5F/* _ */:
|
|
218
|
+
case 0x60/* ` */:
|
|
219
|
+
case 0x7B/* { */:
|
|
220
|
+
case 0x7C/* | */:
|
|
221
|
+
case 0x7D/* } */:
|
|
222
|
+
case 0x7E/* ~ */:
|
|
223
|
+
return true
|
|
224
|
+
default:
|
|
225
|
+
return false
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
// Hepler to unify [reference labels].
|
|
230
|
+
//
|
|
231
|
+
function normalizeReference (str) {
|
|
232
|
+
// Trim and collapse whitespace
|
|
233
|
+
//
|
|
234
|
+
str = str.trim().replace(/\s+/g, ' ')
|
|
235
|
+
|
|
236
|
+
// In node v10 'ẞ'.toLowerCase() === 'Ṿ', which is presumed to be a bug
|
|
237
|
+
// fixed in v12 (couldn't find any details).
|
|
238
|
+
//
|
|
239
|
+
// So treat this one as a special case
|
|
240
|
+
// (remove this when node v10 is no longer supported).
|
|
241
|
+
//
|
|
242
|
+
if ('ẞ'.toLowerCase() === 'Ṿ') {
|
|
243
|
+
str = str.replace(/ẞ/g, 'ß')
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
// .toLowerCase().toUpperCase() should get rid of all differences
|
|
247
|
+
// between letter variants.
|
|
248
|
+
//
|
|
249
|
+
// Simple .toLowerCase() doesn't normalize 125 code points correctly,
|
|
250
|
+
// and .toUpperCase doesn't normalize 6 of them (list of exceptions:
|
|
251
|
+
// İ, ϴ, ẞ, Ω, K, Å - those are already uppercased, but have differently
|
|
252
|
+
// uppercased versions).
|
|
253
|
+
//
|
|
254
|
+
// Here's an example showing how it happens. Lets take greek letter omega:
|
|
255
|
+
// uppercase U+0398 (Θ), U+03f4 (ϴ) and lowercase U+03b8 (θ), U+03d1 (ϑ)
|
|
256
|
+
//
|
|
257
|
+
// Unicode entries:
|
|
258
|
+
// 0398;GREEK CAPITAL LETTER THETA;Lu;0;L;;;;;N;;;;03B8;
|
|
259
|
+
// 03B8;GREEK SMALL LETTER THETA;Ll;0;L;;;;;N;;;0398;;0398
|
|
260
|
+
// 03D1;GREEK THETA SYMBOL;Ll;0;L;<compat> 03B8;;;;N;GREEK SMALL LETTER SCRIPT THETA;;0398;;0398
|
|
261
|
+
// 03F4;GREEK CAPITAL THETA SYMBOL;Lu;0;L;<compat> 0398;;;;N;;;;03B8;
|
|
262
|
+
//
|
|
263
|
+
// Case-insensitive comparison should treat all of them as equivalent.
|
|
264
|
+
//
|
|
265
|
+
// But .toLowerCase() doesn't change ϑ (it's already lowercase),
|
|
266
|
+
// and .toUpperCase() doesn't change ϴ (already uppercase).
|
|
267
|
+
//
|
|
268
|
+
// Applying first lower then upper case normalizes any character:
|
|
269
|
+
// '\u0398\u03f4\u03b8\u03d1'.toLowerCase().toUpperCase() === '\u0398\u0398\u0398\u0398'
|
|
270
|
+
//
|
|
271
|
+
// Note: this is equivalent to unicode case folding; unicode normalization
|
|
272
|
+
// is a different step that is not required here.
|
|
273
|
+
//
|
|
274
|
+
// Final result should be uppercased, because it's later stored in an object
|
|
275
|
+
// (this avoid a conflict with Object.prototype members,
|
|
276
|
+
// most notably, `__proto__`)
|
|
277
|
+
//
|
|
278
|
+
return str.toLowerCase().toUpperCase()
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
// Re-export libraries commonly used in both markdown-it and its plugins,
|
|
282
|
+
// so plugins won't have to depend on them explicitly, which reduces their
|
|
283
|
+
// bundled size (e.g. a browser build).
|
|
284
|
+
//
|
|
285
|
+
const lib = { mdurl, ucmicro }
|
|
286
|
+
|
|
287
|
+
export {
|
|
288
|
+
lib,
|
|
289
|
+
assign,
|
|
290
|
+
isString,
|
|
291
|
+
has,
|
|
292
|
+
unescapeMd,
|
|
293
|
+
unescapeAll,
|
|
294
|
+
isValidEntityCode,
|
|
295
|
+
fromCodePoint,
|
|
296
|
+
escapeHtml,
|
|
297
|
+
arrayReplaceAt,
|
|
298
|
+
isSpace,
|
|
299
|
+
isWhiteSpace,
|
|
300
|
+
isMdAsciiPunct,
|
|
301
|
+
isPunctChar,
|
|
302
|
+
escapeRE,
|
|
303
|
+
normalizeReference
|
|
304
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// Just a shortcut for bulk export
|
|
2
|
+
|
|
3
|
+
import parseLinkLabel from './parse_link_label.mjs'
|
|
4
|
+
import parseLinkDestination from './parse_link_destination.mjs'
|
|
5
|
+
import parseLinkTitle from './parse_link_title.mjs'
|
|
6
|
+
|
|
7
|
+
export {
|
|
8
|
+
parseLinkLabel,
|
|
9
|
+
parseLinkDestination,
|
|
10
|
+
parseLinkTitle
|
|
11
|
+
}
|
package/packages/config-markdownlint/node_modules/markdown-it/lib/helpers/parse_link_destination.mjs
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
// Parse link destination
|
|
2
|
+
//
|
|
3
|
+
|
|
4
|
+
import { unescapeAll } from '../common/utils.mjs'
|
|
5
|
+
|
|
6
|
+
export default function parseLinkDestination (str, start, max) {
|
|
7
|
+
let code
|
|
8
|
+
let pos = start
|
|
9
|
+
|
|
10
|
+
const result = {
|
|
11
|
+
ok: false,
|
|
12
|
+
pos: 0,
|
|
13
|
+
str: ''
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
if (str.charCodeAt(pos) === 0x3C /* < */) {
|
|
17
|
+
pos++
|
|
18
|
+
while (pos < max) {
|
|
19
|
+
code = str.charCodeAt(pos)
|
|
20
|
+
if (code === 0x0A /* \n */) { return result }
|
|
21
|
+
if (code === 0x3C /* < */) { return result }
|
|
22
|
+
if (code === 0x3E /* > */) {
|
|
23
|
+
result.pos = pos + 1
|
|
24
|
+
result.str = unescapeAll(str.slice(start + 1, pos))
|
|
25
|
+
result.ok = true
|
|
26
|
+
return result
|
|
27
|
+
}
|
|
28
|
+
if (code === 0x5C /* \ */ && pos + 1 < max) {
|
|
29
|
+
pos += 2
|
|
30
|
+
continue
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
pos++
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// no closing '>'
|
|
37
|
+
return result
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// this should be ... } else { ... branch
|
|
41
|
+
|
|
42
|
+
let level = 0
|
|
43
|
+
while (pos < max) {
|
|
44
|
+
code = str.charCodeAt(pos)
|
|
45
|
+
|
|
46
|
+
if (code === 0x20) { break }
|
|
47
|
+
|
|
48
|
+
// ascii control characters
|
|
49
|
+
if (code < 0x20 || code === 0x7F) { break }
|
|
50
|
+
|
|
51
|
+
if (code === 0x5C /* \ */ && pos + 1 < max) {
|
|
52
|
+
if (str.charCodeAt(pos + 1) === 0x20) { break }
|
|
53
|
+
pos += 2
|
|
54
|
+
continue
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
if (code === 0x28 /* ( */) {
|
|
58
|
+
level++
|
|
59
|
+
if (level > 32) { return result }
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
if (code === 0x29 /* ) */) {
|
|
63
|
+
if (level === 0) { break }
|
|
64
|
+
level--
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
pos++
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
if (start === pos) { return result }
|
|
71
|
+
if (level !== 0) { return result }
|
|
72
|
+
|
|
73
|
+
result.str = unescapeAll(str.slice(start, pos))
|
|
74
|
+
result.pos = pos
|
|
75
|
+
result.ok = true
|
|
76
|
+
return result
|
|
77
|
+
}
|
package/packages/config-markdownlint/node_modules/markdown-it/lib/helpers/parse_link_label.mjs
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// Parse link label
|
|
2
|
+
//
|
|
3
|
+
// this function assumes that first character ("[") already matches;
|
|
4
|
+
// returns the end of the label
|
|
5
|
+
//
|
|
6
|
+
|
|
7
|
+
export default function parseLinkLabel (state, start, disableNested) {
|
|
8
|
+
let level, found, marker, prevPos
|
|
9
|
+
|
|
10
|
+
const max = state.posMax
|
|
11
|
+
const oldPos = state.pos
|
|
12
|
+
|
|
13
|
+
state.pos = start + 1
|
|
14
|
+
level = 1
|
|
15
|
+
|
|
16
|
+
while (state.pos < max) {
|
|
17
|
+
marker = state.src.charCodeAt(state.pos)
|
|
18
|
+
if (marker === 0x5D /* ] */) {
|
|
19
|
+
level--
|
|
20
|
+
if (level === 0) {
|
|
21
|
+
found = true
|
|
22
|
+
break
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
prevPos = state.pos
|
|
27
|
+
state.md.inline.skipToken(state)
|
|
28
|
+
if (marker === 0x5B /* [ */) {
|
|
29
|
+
if (prevPos === state.pos - 1) {
|
|
30
|
+
// increase level if we find text `[`, which is not a part of any token
|
|
31
|
+
level++
|
|
32
|
+
} else if (disableNested) {
|
|
33
|
+
state.pos = oldPos
|
|
34
|
+
return -1
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
let labelEnd = -1
|
|
40
|
+
|
|
41
|
+
if (found) {
|
|
42
|
+
labelEnd = state.pos
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// restore old state
|
|
46
|
+
state.pos = oldPos
|
|
47
|
+
|
|
48
|
+
return labelEnd
|
|
49
|
+
}
|
package/packages/config-markdownlint/node_modules/markdown-it/lib/helpers/parse_link_title.mjs
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
// Parse link title
|
|
2
|
+
//
|
|
3
|
+
|
|
4
|
+
import { unescapeAll } from '../common/utils.mjs'
|
|
5
|
+
|
|
6
|
+
// Parse link title within `str` in [start, max] range,
|
|
7
|
+
// or continue previous parsing if `prev_state` is defined (equal to result of last execution).
|
|
8
|
+
//
|
|
9
|
+
export default function parseLinkTitle (str, start, max, prev_state) {
|
|
10
|
+
let code
|
|
11
|
+
let pos = start
|
|
12
|
+
|
|
13
|
+
const state = {
|
|
14
|
+
// if `true`, this is a valid link title
|
|
15
|
+
ok: false,
|
|
16
|
+
// if `true`, this link can be continued on the next line
|
|
17
|
+
can_continue: false,
|
|
18
|
+
// if `ok`, it's the position of the first character after the closing marker
|
|
19
|
+
pos: 0,
|
|
20
|
+
// if `ok`, it's the unescaped title
|
|
21
|
+
str: '',
|
|
22
|
+
// expected closing marker character code
|
|
23
|
+
marker: 0
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
if (prev_state) {
|
|
27
|
+
// this is a continuation of a previous parseLinkTitle call on the next line,
|
|
28
|
+
// used in reference links only
|
|
29
|
+
state.str = prev_state.str
|
|
30
|
+
state.marker = prev_state.marker
|
|
31
|
+
} else {
|
|
32
|
+
if (pos >= max) { return state }
|
|
33
|
+
|
|
34
|
+
let marker = str.charCodeAt(pos)
|
|
35
|
+
if (marker !== 0x22 /* " */ && marker !== 0x27 /* ' */ && marker !== 0x28 /* ( */) { return state }
|
|
36
|
+
|
|
37
|
+
start++
|
|
38
|
+
pos++
|
|
39
|
+
|
|
40
|
+
// if opening marker is "(", switch it to closing marker ")"
|
|
41
|
+
if (marker === 0x28) { marker = 0x29 }
|
|
42
|
+
|
|
43
|
+
state.marker = marker
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
while (pos < max) {
|
|
47
|
+
code = str.charCodeAt(pos)
|
|
48
|
+
if (code === state.marker) {
|
|
49
|
+
state.pos = pos + 1
|
|
50
|
+
state.str += unescapeAll(str.slice(start, pos))
|
|
51
|
+
state.ok = true
|
|
52
|
+
return state
|
|
53
|
+
} else if (code === 0x28 /* ( */ && state.marker === 0x29 /* ) */) {
|
|
54
|
+
return state
|
|
55
|
+
} else if (code === 0x5C /* \ */ && pos + 1 < max) {
|
|
56
|
+
pos++
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
pos++
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// no closing marker found, but this link title may continue on the next line (for references)
|
|
63
|
+
state.can_continue = true
|
|
64
|
+
state.str += unescapeAll(str.slice(start, pos))
|
|
65
|
+
return state
|
|
66
|
+
}
|