@shell-shock/preset-cli 0.9.11 → 0.9.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/_rolldown/runtime.cjs +16 -0
- package/dist/_virtual/_rolldown/runtime.mjs +45 -0
- package/dist/components/upgrade-builtin.cjs +1 -1
- package/dist/components/upgrade-builtin.mjs +1 -1
- package/dist/components/upgrade-builtin.mjs.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/node_modules/.pnpm/@mdit_plugin-alert@0.23.2_markdown-it@14.1.1/node_modules/@mdit/plugin-alert/dist/index.cjs +94 -0
- package/dist/node_modules/.pnpm/@mdit_plugin-alert@0.23.2_markdown-it@14.1.1/node_modules/@mdit/plugin-alert/dist/index.mjs +94 -0
- package/dist/node_modules/.pnpm/@mdit_plugin-alert@0.23.2_markdown-it@14.1.1/node_modules/@mdit/plugin-alert/dist/index.mjs.map +1 -0
- package/dist/node_modules/.pnpm/ansi-styles@6.2.3/node_modules/ansi-styles/index.cjs +167 -0
- package/dist/node_modules/.pnpm/ansi-styles@6.2.3/node_modules/ansi-styles/index.mjs +167 -0
- package/dist/node_modules/.pnpm/ansi-styles@6.2.3/node_modules/ansi-styles/index.mjs.map +1 -0
- package/dist/node_modules/.pnpm/chalk-string@4.0.0/node_modules/chalk-string/build/src/args.cjs +36 -0
- package/dist/node_modules/.pnpm/chalk-string@4.0.0/node_modules/chalk-string/build/src/args.mjs +36 -0
- package/dist/node_modules/.pnpm/chalk-string@4.0.0/node_modules/chalk-string/build/src/args.mjs.map +1 -0
- package/dist/node_modules/.pnpm/chalk-string@4.0.0/node_modules/chalk-string/build/src/main.cjs +32 -0
- package/dist/node_modules/.pnpm/chalk-string@4.0.0/node_modules/chalk-string/build/src/main.mjs +33 -0
- package/dist/node_modules/.pnpm/chalk-string@4.0.0/node_modules/chalk-string/build/src/main.mjs.map +1 -0
- package/dist/node_modules/.pnpm/chalk@5.6.2/node_modules/chalk/source/index.cjs +133 -0
- package/dist/node_modules/.pnpm/chalk@5.6.2/node_modules/chalk/source/index.mjs +134 -0
- package/dist/node_modules/.pnpm/chalk@5.6.2/node_modules/chalk/source/index.mjs.map +1 -0
- package/dist/node_modules/.pnpm/chalk@5.6.2/node_modules/chalk/source/utilities.cjs +32 -0
- package/dist/node_modules/.pnpm/chalk@5.6.2/node_modules/chalk/source/utilities.mjs +31 -0
- package/dist/node_modules/.pnpm/chalk@5.6.2/node_modules/chalk/source/utilities.mjs.map +1 -0
- package/dist/node_modules/.pnpm/chalk@5.6.2/node_modules/chalk/source/vendor/ansi-styles/index.cjs +169 -0
- package/dist/node_modules/.pnpm/chalk@5.6.2/node_modules/chalk/source/vendor/ansi-styles/index.mjs +167 -0
- package/dist/node_modules/.pnpm/chalk@5.6.2/node_modules/chalk/source/vendor/ansi-styles/index.mjs.map +1 -0
- package/dist/node_modules/.pnpm/chalk@5.6.2/node_modules/chalk/source/vendor/supports-color/index.cjs +98 -0
- package/dist/node_modules/.pnpm/chalk@5.6.2/node_modules/chalk/source/vendor/supports-color/index.mjs +95 -0
- package/dist/node_modules/.pnpm/chalk@5.6.2/node_modules/chalk/source/vendor/supports-color/index.mjs.map +1 -0
- package/dist/node_modules/.pnpm/colors-option@6.1.2/node_modules/colors-option/build/src/main.cjs +23 -0
- package/dist/node_modules/.pnpm/colors-option@6.1.2/node_modules/colors-option/build/src/main.mjs +23 -0
- package/dist/node_modules/.pnpm/colors-option@6.1.2/node_modules/colors-option/build/src/main.mjs.map +1 -0
- package/dist/node_modules/.pnpm/colors-option@6.1.2/node_modules/colors-option/build/src/options.cjs +36 -0
- package/dist/node_modules/.pnpm/colors-option@6.1.2/node_modules/colors-option/build/src/options.mjs +36 -0
- package/dist/node_modules/.pnpm/colors-option@6.1.2/node_modules/colors-option/build/src/options.mjs.map +1 -0
- package/dist/node_modules/.pnpm/entities@4.5.0/node_modules/entities/lib/esm/decode.cjs +373 -0
- package/dist/node_modules/.pnpm/entities@4.5.0/node_modules/entities/lib/esm/decode.mjs +374 -0
- package/dist/node_modules/.pnpm/entities@4.5.0/node_modules/entities/lib/esm/decode.mjs.map +1 -0
- package/dist/node_modules/.pnpm/entities@4.5.0/node_modules/entities/lib/esm/decode_codepoint.cjs +60 -0
- package/dist/node_modules/.pnpm/entities@4.5.0/node_modules/entities/lib/esm/decode_codepoint.mjs +59 -0
- package/dist/node_modules/.pnpm/entities@4.5.0/node_modules/entities/lib/esm/decode_codepoint.mjs.map +1 -0
- package/dist/node_modules/.pnpm/entities@4.5.0/node_modules/entities/lib/esm/generated/decode-data-html.cjs +6 -0
- package/dist/node_modules/.pnpm/entities@4.5.0/node_modules/entities/lib/esm/generated/decode-data-html.mjs +6 -0
- package/dist/node_modules/.pnpm/entities@4.5.0/node_modules/entities/lib/esm/generated/decode-data-html.mjs.map +1 -0
- package/dist/node_modules/.pnpm/entities@4.5.0/node_modules/entities/lib/esm/generated/decode-data-xml.cjs +6 -0
- package/dist/node_modules/.pnpm/entities@4.5.0/node_modules/entities/lib/esm/generated/decode-data-xml.mjs +6 -0
- package/dist/node_modules/.pnpm/entities@4.5.0/node_modules/entities/lib/esm/generated/decode-data-xml.mjs.map +1 -0
- package/dist/node_modules/.pnpm/entities@6.0.1/node_modules/entities/dist/esm/decode-codepoint.cjs +59 -0
- package/dist/node_modules/.pnpm/entities@6.0.1/node_modules/entities/dist/esm/decode-codepoint.mjs +59 -0
- package/dist/node_modules/.pnpm/entities@6.0.1/node_modules/entities/dist/esm/decode-codepoint.mjs.map +1 -0
- package/dist/node_modules/.pnpm/entities@6.0.1/node_modules/entities/dist/esm/decode.cjs +338 -0
- package/dist/node_modules/.pnpm/entities@6.0.1/node_modules/entities/dist/esm/decode.mjs +333 -0
- package/dist/node_modules/.pnpm/entities@6.0.1/node_modules/entities/dist/esm/decode.mjs.map +1 -0
- package/dist/node_modules/.pnpm/entities@6.0.1/node_modules/entities/dist/esm/generated/decode-data-html.cjs +6 -0
- package/dist/node_modules/.pnpm/entities@6.0.1/node_modules/entities/dist/esm/generated/decode-data-html.mjs +6 -0
- package/dist/node_modules/.pnpm/entities@6.0.1/node_modules/entities/dist/esm/generated/decode-data-html.mjs.map +1 -0
- package/dist/node_modules/.pnpm/he@1.2.0/node_modules/he/he.cjs +4095 -0
- package/dist/node_modules/.pnpm/he@1.2.0/node_modules/he/he.mjs +4093 -0
- package/dist/node_modules/.pnpm/he@1.2.0/node_modules/he/he.mjs.map +1 -0
- package/dist/node_modules/.pnpm/is-plain-obj@4.1.0/node_modules/is-plain-obj/index.cjs +10 -0
- package/dist/node_modules/.pnpm/is-plain-obj@4.1.0/node_modules/is-plain-obj/index.mjs +10 -0
- package/dist/node_modules/.pnpm/is-plain-obj@4.1.0/node_modules/is-plain-obj/index.mjs.map +1 -0
- package/dist/node_modules/.pnpm/linkify-it@5.0.0/node_modules/linkify-it/index.cjs +449 -0
- package/dist/node_modules/.pnpm/linkify-it@5.0.0/node_modules/linkify-it/index.mjs +450 -0
- package/dist/node_modules/.pnpm/linkify-it@5.0.0/node_modules/linkify-it/index.mjs.map +1 -0
- package/dist/node_modules/.pnpm/linkify-it@5.0.0/node_modules/linkify-it/lib/re.cjs +47 -0
- package/dist/node_modules/.pnpm/linkify-it@5.0.0/node_modules/linkify-it/lib/re.mjs +48 -0
- package/dist/node_modules/.pnpm/linkify-it@5.0.0/node_modules/linkify-it/lib/re.mjs.map +1 -0
- package/dist/node_modules/.pnpm/markdown-it-abbr@2.0.0/node_modules/markdown-it-abbr/index.cjs +94 -0
- package/dist/node_modules/.pnpm/markdown-it-abbr@2.0.0/node_modules/markdown-it-abbr/index.mjs +94 -0
- package/dist/node_modules/.pnpm/markdown-it-abbr@2.0.0/node_modules/markdown-it-abbr/index.mjs.map +1 -0
- package/dist/node_modules/.pnpm/markdown-it-container@4.0.0/node_modules/markdown-it-container/index.cjs +78 -0
- package/dist/node_modules/.pnpm/markdown-it-container@4.0.0/node_modules/markdown-it-container/index.mjs +78 -0
- package/dist/node_modules/.pnpm/markdown-it-container@4.0.0/node_modules/markdown-it-container/index.mjs.map +1 -0
- package/dist/node_modules/.pnpm/markdown-it-deflist@3.0.0/node_modules/markdown-it-deflist/index.cjs +123 -0
- package/dist/node_modules/.pnpm/markdown-it-deflist@3.0.0/node_modules/markdown-it-deflist/index.mjs +123 -0
- package/dist/node_modules/.pnpm/markdown-it-deflist@3.0.0/node_modules/markdown-it-deflist/index.mjs.map +1 -0
- package/dist/node_modules/.pnpm/markdown-it-footnote@4.0.0/node_modules/markdown-it-footnote/index.cjs +246 -0
- package/dist/node_modules/.pnpm/markdown-it-footnote@4.0.0/node_modules/markdown-it-footnote/index.mjs +244 -0
- package/dist/node_modules/.pnpm/markdown-it-footnote@4.0.0/node_modules/markdown-it-footnote/index.mjs.map +1 -0
- package/dist/node_modules/.pnpm/markdown-it-ins@4.0.0/node_modules/markdown-it-ins/index.cjs +80 -0
- package/dist/node_modules/.pnpm/markdown-it-ins@4.0.0/node_modules/markdown-it-ins/index.mjs +80 -0
- package/dist/node_modules/.pnpm/markdown-it-ins@4.0.0/node_modules/markdown-it-ins/index.mjs.map +1 -0
- package/dist/node_modules/.pnpm/markdown-it-mark@4.0.0/node_modules/markdown-it-mark/index.cjs +80 -0
- package/dist/node_modules/.pnpm/markdown-it-mark@4.0.0/node_modules/markdown-it-mark/index.mjs +80 -0
- package/dist/node_modules/.pnpm/markdown-it-mark@4.0.0/node_modules/markdown-it-mark/index.mjs.map +1 -0
- package/dist/node_modules/.pnpm/markdown-it-sub@2.0.0/node_modules/markdown-it-sub/index.cjs +45 -0
- package/dist/node_modules/.pnpm/markdown-it-sub@2.0.0/node_modules/markdown-it-sub/index.mjs +45 -0
- package/dist/node_modules/.pnpm/markdown-it-sub@2.0.0/node_modules/markdown-it-sub/index.mjs.map +1 -0
- package/dist/node_modules/.pnpm/markdown-it-sup@2.0.0/node_modules/markdown-it-sup/index.cjs +45 -0
- package/dist/node_modules/.pnpm/markdown-it-sup@2.0.0/node_modules/markdown-it-sup/index.mjs +45 -0
- package/dist/node_modules/.pnpm/markdown-it-sup@2.0.0/node_modules/markdown-it-sup/index.mjs.map +1 -0
- package/dist/node_modules/.pnpm/markdown-it-task-lists@2.1.1/node_modules/markdown-it-task-lists/index.cjs +94 -0
- package/dist/node_modules/.pnpm/markdown-it-task-lists@2.1.1/node_modules/markdown-it-task-lists/index.mjs +92 -0
- package/dist/node_modules/.pnpm/markdown-it-task-lists@2.1.1/node_modules/markdown-it-task-lists/index.mjs.map +1 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/index.cjs +1 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/index.mjs +3 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/common/html_blocks.cjs +69 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/common/html_blocks.mjs +69 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/common/html_blocks.mjs.map +1 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/common/html_re.cjs +9 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/common/html_re.mjs +8 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/common/html_re.mjs.map +1 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/common/utils.cjs +205 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/common/utils.mjs +189 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/common/utils.mjs.map +1 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/helpers/index.cjs +19 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/helpers/index.mjs +15 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/helpers/index.mjs.map +1 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/helpers/parse_link_destination.cjs +61 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/helpers/parse_link_destination.mjs +62 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/helpers/parse_link_destination.mjs.map +1 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/helpers/parse_link_label.cjs +35 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/helpers/parse_link_label.mjs +35 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/helpers/parse_link_label.mjs.map +1 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/helpers/parse_link_title.cjs +43 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/helpers/parse_link_title.mjs +44 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/helpers/parse_link_title.mjs.map +1 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/index.cjs +488 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/index.mjs +489 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/index.mjs.map +1 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/parser_block.cjs +148 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/parser_block.mjs +149 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/parser_block.mjs.map +1 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/parser_core.cjs +51 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/parser_core.mjs +52 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/parser_core.mjs.map +1 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/parser_inline.cjs +126 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/parser_inline.mjs +127 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/parser_inline.mjs.map +1 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/presets/commonmark.cjs +57 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/presets/commonmark.mjs +57 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/presets/commonmark.mjs.map +1 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/presets/default.cjs +23 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/presets/default.mjs +23 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/presets/default.mjs.map +1 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/presets/zero.cjs +31 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/presets/zero.mjs +31 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/presets/zero.mjs.map +1 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/renderer.cjs +217 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/renderer.mjs +218 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/renderer.mjs.map +1 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/ruler.cjs +274 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/ruler.mjs +274 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/ruler.mjs.map +1 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_block/blockquote.cjs +107 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_block/blockquote.mjs +108 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_block/blockquote.mjs.map +1 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_block/code.cjs +27 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_block/code.mjs +27 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_block/code.mjs.map +1 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_block/fence.cjs +48 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_block/fence.mjs +48 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_block/fence.mjs.map +1 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_block/heading.cjs +35 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_block/heading.mjs +36 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_block/heading.mjs.map +1 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_block/hr.cjs +26 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_block/hr.mjs +27 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_block/hr.mjs.map +1 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_block/html_block.cjs +72 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_block/html_block.mjs +73 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_block/html_block.mjs.map +1 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_block/lheading.cjs +53 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_block/lheading.mjs +53 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_block/lheading.mjs.map +1 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_block/list.cjs +157 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_block/list.mjs +158 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_block/list.mjs.map +1 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_block/paragraph.cjs +32 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_block/paragraph.mjs +32 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_block/paragraph.mjs.map +1 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_block/reference.cjs +140 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_block/reference.mjs +141 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_block/reference.mjs.map +1 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_block/state_block.cjs +112 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_block/state_block.mjs +113 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_block/state_block.mjs.map +1 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_block/table.cjs +139 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_block/table.mjs +140 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_block/table.mjs.map +1 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_core/block.cjs +15 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_core/block.mjs +15 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_core/block.mjs.map +1 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_core/inline.cjs +12 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_core/inline.mjs +12 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_core/inline.mjs.map +1 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_core/linkify.cjs +81 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_core/linkify.mjs +82 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_core/linkify.mjs.map +1 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_core/normalize.cjs +13 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_core/normalize.mjs +13 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_core/normalize.mjs.map +1 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_core/replacements.cjs +45 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_core/replacements.mjs +45 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_core/replacements.mjs.map +1 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_core/smartquotes.cjs +112 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_core/smartquotes.mjs +113 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_core/smartquotes.mjs.map +1 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_core/state_core.cjs +14 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_core/state_core.mjs +15 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_core/state_core.mjs.map +1 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_core/text_join.cjs +22 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_core/text_join.mjs +22 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_core/text_join.mjs.map +1 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_inline/autolink.cjs +55 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_inline/autolink.mjs +55 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_inline/autolink.mjs.map +1 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_inline/backticks.cjs +41 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_inline/backticks.mjs +41 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_inline/backticks.mjs.map +1 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_inline/balance_pairs.cjs +62 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_inline/balance_pairs.mjs +62 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_inline/balance_pairs.mjs.map +1 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_inline/emphasis.cjs +64 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_inline/emphasis.mjs +64 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_inline/emphasis.mjs.map +1 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_inline/entity.cjs +45 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_inline/entity.mjs +46 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_inline/entity.mjs.map +1 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_inline/escape.cjs +48 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_inline/escape.mjs +49 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_inline/escape.mjs.map +1 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_inline/fragments_join.cjs +22 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_inline/fragments_join.mjs +22 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_inline/fragments_join.mjs.map +1 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_inline/html_inline.cjs +34 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_inline/html_inline.mjs +35 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_inline/html_inline.mjs.map +1 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_inline/image.cjs +82 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_inline/image.mjs +83 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_inline/image.mjs.map +1 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_inline/link.cjs +84 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_inline/link.mjs +85 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_inline/link.mjs.map +1 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_inline/linkify.cjs +42 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_inline/linkify.mjs +42 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_inline/linkify.mjs.map +1 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_inline/newline.cjs +26 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_inline/newline.mjs +27 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_inline/newline.mjs.map +1 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_inline/state_inline.cjs +74 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_inline/state_inline.mjs +75 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_inline/state_inline.mjs.map +1 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_inline/strikethrough.cjs +80 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_inline/strikethrough.mjs +80 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_inline/strikethrough.mjs.map +1 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_inline/text.cjs +41 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_inline/text.mjs +41 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/rules_inline/text.mjs.map +1 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/token.cjs +157 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/token.mjs +157 -0
- package/dist/node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/token.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mdurl@2.0.0/node_modules/mdurl/index.cjs +21 -0
- package/dist/node_modules/.pnpm/mdurl@2.0.0/node_modules/mdurl/index.mjs +17 -0
- package/dist/node_modules/.pnpm/mdurl@2.0.0/node_modules/mdurl/index.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mdurl@2.0.0/node_modules/mdurl/lib/decode.cjs +74 -0
- package/dist/node_modules/.pnpm/mdurl@2.0.0/node_modules/mdurl/lib/decode.mjs +74 -0
- package/dist/node_modules/.pnpm/mdurl@2.0.0/node_modules/mdurl/lib/decode.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mdurl@2.0.0/node_modules/mdurl/lib/encode.cjs +57 -0
- package/dist/node_modules/.pnpm/mdurl@2.0.0/node_modules/mdurl/lib/encode.mjs +57 -0
- package/dist/node_modules/.pnpm/mdurl@2.0.0/node_modules/mdurl/lib/encode.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mdurl@2.0.0/node_modules/mdurl/lib/format.cjs +18 -0
- package/dist/node_modules/.pnpm/mdurl@2.0.0/node_modules/mdurl/lib/format.mjs +18 -0
- package/dist/node_modules/.pnpm/mdurl@2.0.0/node_modules/mdurl/lib/format.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mdurl@2.0.0/node_modules/mdurl/lib/parse.cjs +175 -0
- package/dist/node_modules/.pnpm/mdurl@2.0.0/node_modules/mdurl/lib/parse.mjs +175 -0
- package/dist/node_modules/.pnpm/mdurl@2.0.0/node_modules/mdurl/lib/parse.mjs.map +1 -0
- package/dist/node_modules/.pnpm/normalize-html-whitespace@1.0.0/node_modules/normalize-html-whitespace/index.cjs +19 -0
- package/dist/node_modules/.pnpm/normalize-html-whitespace@1.0.0/node_modules/normalize-html-whitespace/index.mjs +15 -0
- package/dist/node_modules/.pnpm/normalize-html-whitespace@1.0.0/node_modules/normalize-html-whitespace/index.mjs.map +1 -0
- package/dist/node_modules/.pnpm/parse5@8.0.0/node_modules/parse5/dist/common/doctype.cjs +104 -0
- package/dist/node_modules/.pnpm/parse5@8.0.0/node_modules/parse5/dist/common/doctype.mjs +104 -0
- package/dist/node_modules/.pnpm/parse5@8.0.0/node_modules/parse5/dist/common/doctype.mjs.map +1 -0
- package/dist/node_modules/.pnpm/parse5@8.0.0/node_modules/parse5/dist/common/error-codes.cjs +73 -0
- package/dist/node_modules/.pnpm/parse5@8.0.0/node_modules/parse5/dist/common/error-codes.mjs +68 -0
- package/dist/node_modules/.pnpm/parse5@8.0.0/node_modules/parse5/dist/common/error-codes.mjs.map +1 -0
- package/dist/node_modules/.pnpm/parse5@8.0.0/node_modules/parse5/dist/common/foreign-content.cjs +266 -0
- package/dist/node_modules/.pnpm/parse5@8.0.0/node_modules/parse5/dist/common/foreign-content.mjs +262 -0
- package/dist/node_modules/.pnpm/parse5@8.0.0/node_modules/parse5/dist/common/foreign-content.mjs.map +1 -0
- package/dist/node_modules/.pnpm/parse5@8.0.0/node_modules/parse5/dist/common/html.cjs +575 -0
- package/dist/node_modules/.pnpm/parse5@8.0.0/node_modules/parse5/dist/common/html.mjs +543 -0
- package/dist/node_modules/.pnpm/parse5@8.0.0/node_modules/parse5/dist/common/html.mjs.map +1 -0
- package/dist/node_modules/.pnpm/parse5@8.0.0/node_modules/parse5/dist/common/token.cjs +27 -0
- package/dist/node_modules/.pnpm/parse5@8.0.0/node_modules/parse5/dist/common/token.mjs +21 -0
- package/dist/node_modules/.pnpm/parse5@8.0.0/node_modules/parse5/dist/common/token.mjs.map +1 -0
- package/dist/node_modules/.pnpm/parse5@8.0.0/node_modules/parse5/dist/common/unicode.cjs +105 -0
- package/dist/node_modules/.pnpm/parse5@8.0.0/node_modules/parse5/dist/common/unicode.mjs +94 -0
- package/dist/node_modules/.pnpm/parse5@8.0.0/node_modules/parse5/dist/common/unicode.mjs.map +1 -0
- package/dist/node_modules/.pnpm/parse5@8.0.0/node_modules/parse5/dist/index.cjs +33 -0
- package/dist/node_modules/.pnpm/parse5@8.0.0/node_modules/parse5/dist/index.mjs +34 -0
- package/dist/node_modules/.pnpm/parse5@8.0.0/node_modules/parse5/dist/index.mjs.map +1 -0
- package/dist/node_modules/.pnpm/parse5@8.0.0/node_modules/parse5/dist/parser/formatting-element-list.cjs +99 -0
- package/dist/node_modules/.pnpm/parse5@8.0.0/node_modules/parse5/dist/parser/formatting-element-list.mjs +93 -0
- package/dist/node_modules/.pnpm/parse5@8.0.0/node_modules/parse5/dist/parser/formatting-element-list.mjs.map +1 -0
- package/dist/node_modules/.pnpm/parse5@8.0.0/node_modules/parse5/dist/parser/index.cjs +2544 -0
- package/dist/node_modules/.pnpm/parse5@8.0.0/node_modules/parse5/dist/parser/index.mjs +2545 -0
- package/dist/node_modules/.pnpm/parse5@8.0.0/node_modules/parse5/dist/parser/index.mjs.map +1 -0
- package/dist/node_modules/.pnpm/parse5@8.0.0/node_modules/parse5/dist/parser/open-element-stack.cjs +296 -0
- package/dist/node_modules/.pnpm/parse5@8.0.0/node_modules/parse5/dist/parser/open-element-stack.mjs +297 -0
- package/dist/node_modules/.pnpm/parse5@8.0.0/node_modules/parse5/dist/parser/open-element-stack.mjs.map +1 -0
- package/dist/node_modules/.pnpm/parse5@8.0.0/node_modules/parse5/dist/serializer/index.cjs +26 -0
- package/dist/node_modules/.pnpm/parse5@8.0.0/node_modules/parse5/dist/serializer/index.mjs +28 -0
- package/dist/node_modules/.pnpm/parse5@8.0.0/node_modules/parse5/dist/serializer/index.mjs.map +1 -0
- package/dist/node_modules/.pnpm/parse5@8.0.0/node_modules/parse5/dist/tokenizer/index.cjs +2069 -0
- package/dist/node_modules/.pnpm/parse5@8.0.0/node_modules/parse5/dist/tokenizer/index.mjs +2069 -0
- package/dist/node_modules/.pnpm/parse5@8.0.0/node_modules/parse5/dist/tokenizer/index.mjs.map +1 -0
- package/dist/node_modules/.pnpm/parse5@8.0.0/node_modules/parse5/dist/tokenizer/preprocessor.cjs +156 -0
- package/dist/node_modules/.pnpm/parse5@8.0.0/node_modules/parse5/dist/tokenizer/preprocessor.mjs +157 -0
- package/dist/node_modules/.pnpm/parse5@8.0.0/node_modules/parse5/dist/tokenizer/preprocessor.mjs.map +1 -0
- package/dist/node_modules/.pnpm/parse5@8.0.0/node_modules/parse5/dist/tree-adapters/default.cjs +166 -0
- package/dist/node_modules/.pnpm/parse5@8.0.0/node_modules/parse5/dist/tree-adapters/default.mjs +167 -0
- package/dist/node_modules/.pnpm/parse5@8.0.0/node_modules/parse5/dist/tree-adapters/default.mjs.map +1 -0
- package/dist/node_modules/.pnpm/punycode.js@2.3.1/node_modules/punycode.js/punycode.cjs +299 -0
- package/dist/node_modules/.pnpm/punycode.js@2.3.1/node_modules/punycode.js/punycode.mjs +295 -0
- package/dist/node_modules/.pnpm/punycode.js@2.3.1/node_modules/punycode.js/punycode.mjs.map +1 -0
- package/dist/node_modules/.pnpm/uc.micro@2.1.0/node_modules/uc.micro/categories/Cc/regex.cjs +6 -0
- package/dist/node_modules/.pnpm/uc.micro@2.1.0/node_modules/uc.micro/categories/Cc/regex.mjs +6 -0
- package/dist/node_modules/.pnpm/uc.micro@2.1.0/node_modules/uc.micro/categories/Cc/regex.mjs.map +1 -0
- package/dist/node_modules/.pnpm/uc.micro@2.1.0/node_modules/uc.micro/categories/Cf/regex.cjs +6 -0
- package/dist/node_modules/.pnpm/uc.micro@2.1.0/node_modules/uc.micro/categories/Cf/regex.mjs +6 -0
- package/dist/node_modules/.pnpm/uc.micro@2.1.0/node_modules/uc.micro/categories/Cf/regex.mjs.map +1 -0
- package/dist/node_modules/.pnpm/uc.micro@2.1.0/node_modules/uc.micro/categories/P/regex.cjs +6 -0
- package/dist/node_modules/.pnpm/uc.micro@2.1.0/node_modules/uc.micro/categories/P/regex.mjs +6 -0
- package/dist/node_modules/.pnpm/uc.micro@2.1.0/node_modules/uc.micro/categories/P/regex.mjs.map +1 -0
- package/dist/node_modules/.pnpm/uc.micro@2.1.0/node_modules/uc.micro/categories/S/regex.cjs +6 -0
- package/dist/node_modules/.pnpm/uc.micro@2.1.0/node_modules/uc.micro/categories/S/regex.mjs +6 -0
- package/dist/node_modules/.pnpm/uc.micro@2.1.0/node_modules/uc.micro/categories/S/regex.mjs.map +1 -0
- package/dist/node_modules/.pnpm/uc.micro@2.1.0/node_modules/uc.micro/categories/Z/regex.cjs +6 -0
- package/dist/node_modules/.pnpm/uc.micro@2.1.0/node_modules/uc.micro/categories/Z/regex.mjs +6 -0
- package/dist/node_modules/.pnpm/uc.micro@2.1.0/node_modules/uc.micro/categories/Z/regex.mjs.map +1 -0
- package/dist/node_modules/.pnpm/uc.micro@2.1.0/node_modules/uc.micro/index.cjs +25 -0
- package/dist/node_modules/.pnpm/uc.micro@2.1.0/node_modules/uc.micro/index.mjs +21 -0
- package/dist/node_modules/.pnpm/uc.micro@2.1.0/node_modules/uc.micro/index.mjs.map +1 -0
- package/dist/node_modules/.pnpm/uc.micro@2.1.0/node_modules/uc.micro/properties/Any/regex.cjs +6 -0
- package/dist/node_modules/.pnpm/uc.micro@2.1.0/node_modules/uc.micro/properties/Any/regex.mjs +6 -0
- package/dist/node_modules/.pnpm/uc.micro@2.1.0/node_modules/uc.micro/properties/Any/regex.mjs.map +1 -0
- package/dist/node_modules/.pnpm/wrap-ansi@10.0.0/node_modules/wrap-ansi/index.cjs +15 -0
- package/dist/node_modules/.pnpm/wrap-ansi@10.0.0/node_modules/wrap-ansi/index.mjs +17 -0
- package/dist/node_modules/.pnpm/wrap-ansi@10.0.0/node_modules/wrap-ansi/index.mjs.map +1 -0
- package/dist/{plugin-changelog → packages/plugin-changelog}/dist/components/changelog-command.cjs +5 -4
- package/dist/packages/plugin-changelog/dist/components/changelog-command.mjs +4 -3
- package/dist/packages/plugin-changelog/dist/components/changelog-command.mjs.map +1 -1
- package/dist/{plugin-changelog → packages/plugin-changelog}/dist/index.cjs +1 -1
- package/dist/packages/unified/dist/html-Di3_LwV3.cjs +337 -0
- package/dist/packages/unified/dist/html-Di3_LwV3.mjs +338 -0
- package/dist/packages/unified/dist/html-Di3_LwV3.mjs.map +1 -0
- package/dist/packages/unified/dist/markdown/index.cjs +1 -0
- package/dist/packages/unified/dist/markdown/index.mjs +3 -0
- package/dist/packages/unified/dist/markdown-OuY_JOk0.cjs +82 -0
- package/dist/packages/unified/dist/markdown-OuY_JOk0.mjs +83 -0
- package/dist/packages/unified/dist/markdown-OuY_JOk0.mjs.map +1 -0
- package/package.json +39 -12
- package/dist/packages/unified/dist/markdown-Bs-BRrSC.mjs +0 -10
- package/dist/packages/unified/dist/markdown-Bs-BRrSC.mjs.map +0 -1
- package/dist/unified/dist/markdown-Bs-BRrSC.cjs +0 -10
- /package/dist/{plugin-changelog → packages/plugin-changelog}/dist/components/index.cjs +0 -0
|
@@ -0,0 +1,2069 @@
|
|
|
1
|
+
const require_unicode = require('../common/unicode.cjs');
|
|
2
|
+
const require_error_codes = require('../common/error-codes.cjs');
|
|
3
|
+
const require_preprocessor = require('./preprocessor.cjs');
|
|
4
|
+
const require_token = require('../common/token.cjs');
|
|
5
|
+
const require_decode_data_html = require('../../../../../entities@6.0.1/node_modules/entities/dist/esm/generated/decode-data-html.cjs');
|
|
6
|
+
const require_decode = require('../../../../../entities@6.0.1/node_modules/entities/dist/esm/decode.cjs');
|
|
7
|
+
const require_html = require('../common/html.cjs');
|
|
8
|
+
|
|
9
|
+
//#region ../../node_modules/.pnpm/parse5@8.0.0/node_modules/parse5/dist/tokenizer/index.js
|
|
10
|
+
var State;
|
|
11
|
+
(function(State) {
|
|
12
|
+
State[State["DATA"] = 0] = "DATA";
|
|
13
|
+
State[State["RCDATA"] = 1] = "RCDATA";
|
|
14
|
+
State[State["RAWTEXT"] = 2] = "RAWTEXT";
|
|
15
|
+
State[State["SCRIPT_DATA"] = 3] = "SCRIPT_DATA";
|
|
16
|
+
State[State["PLAINTEXT"] = 4] = "PLAINTEXT";
|
|
17
|
+
State[State["TAG_OPEN"] = 5] = "TAG_OPEN";
|
|
18
|
+
State[State["END_TAG_OPEN"] = 6] = "END_TAG_OPEN";
|
|
19
|
+
State[State["TAG_NAME"] = 7] = "TAG_NAME";
|
|
20
|
+
State[State["RCDATA_LESS_THAN_SIGN"] = 8] = "RCDATA_LESS_THAN_SIGN";
|
|
21
|
+
State[State["RCDATA_END_TAG_OPEN"] = 9] = "RCDATA_END_TAG_OPEN";
|
|
22
|
+
State[State["RCDATA_END_TAG_NAME"] = 10] = "RCDATA_END_TAG_NAME";
|
|
23
|
+
State[State["RAWTEXT_LESS_THAN_SIGN"] = 11] = "RAWTEXT_LESS_THAN_SIGN";
|
|
24
|
+
State[State["RAWTEXT_END_TAG_OPEN"] = 12] = "RAWTEXT_END_TAG_OPEN";
|
|
25
|
+
State[State["RAWTEXT_END_TAG_NAME"] = 13] = "RAWTEXT_END_TAG_NAME";
|
|
26
|
+
State[State["SCRIPT_DATA_LESS_THAN_SIGN"] = 14] = "SCRIPT_DATA_LESS_THAN_SIGN";
|
|
27
|
+
State[State["SCRIPT_DATA_END_TAG_OPEN"] = 15] = "SCRIPT_DATA_END_TAG_OPEN";
|
|
28
|
+
State[State["SCRIPT_DATA_END_TAG_NAME"] = 16] = "SCRIPT_DATA_END_TAG_NAME";
|
|
29
|
+
State[State["SCRIPT_DATA_ESCAPE_START"] = 17] = "SCRIPT_DATA_ESCAPE_START";
|
|
30
|
+
State[State["SCRIPT_DATA_ESCAPE_START_DASH"] = 18] = "SCRIPT_DATA_ESCAPE_START_DASH";
|
|
31
|
+
State[State["SCRIPT_DATA_ESCAPED"] = 19] = "SCRIPT_DATA_ESCAPED";
|
|
32
|
+
State[State["SCRIPT_DATA_ESCAPED_DASH"] = 20] = "SCRIPT_DATA_ESCAPED_DASH";
|
|
33
|
+
State[State["SCRIPT_DATA_ESCAPED_DASH_DASH"] = 21] = "SCRIPT_DATA_ESCAPED_DASH_DASH";
|
|
34
|
+
State[State["SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN"] = 22] = "SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN";
|
|
35
|
+
State[State["SCRIPT_DATA_ESCAPED_END_TAG_OPEN"] = 23] = "SCRIPT_DATA_ESCAPED_END_TAG_OPEN";
|
|
36
|
+
State[State["SCRIPT_DATA_ESCAPED_END_TAG_NAME"] = 24] = "SCRIPT_DATA_ESCAPED_END_TAG_NAME";
|
|
37
|
+
State[State["SCRIPT_DATA_DOUBLE_ESCAPE_START"] = 25] = "SCRIPT_DATA_DOUBLE_ESCAPE_START";
|
|
38
|
+
State[State["SCRIPT_DATA_DOUBLE_ESCAPED"] = 26] = "SCRIPT_DATA_DOUBLE_ESCAPED";
|
|
39
|
+
State[State["SCRIPT_DATA_DOUBLE_ESCAPED_DASH"] = 27] = "SCRIPT_DATA_DOUBLE_ESCAPED_DASH";
|
|
40
|
+
State[State["SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH"] = 28] = "SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH";
|
|
41
|
+
State[State["SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN"] = 29] = "SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN";
|
|
42
|
+
State[State["SCRIPT_DATA_DOUBLE_ESCAPE_END"] = 30] = "SCRIPT_DATA_DOUBLE_ESCAPE_END";
|
|
43
|
+
State[State["BEFORE_ATTRIBUTE_NAME"] = 31] = "BEFORE_ATTRIBUTE_NAME";
|
|
44
|
+
State[State["ATTRIBUTE_NAME"] = 32] = "ATTRIBUTE_NAME";
|
|
45
|
+
State[State["AFTER_ATTRIBUTE_NAME"] = 33] = "AFTER_ATTRIBUTE_NAME";
|
|
46
|
+
State[State["BEFORE_ATTRIBUTE_VALUE"] = 34] = "BEFORE_ATTRIBUTE_VALUE";
|
|
47
|
+
State[State["ATTRIBUTE_VALUE_DOUBLE_QUOTED"] = 35] = "ATTRIBUTE_VALUE_DOUBLE_QUOTED";
|
|
48
|
+
State[State["ATTRIBUTE_VALUE_SINGLE_QUOTED"] = 36] = "ATTRIBUTE_VALUE_SINGLE_QUOTED";
|
|
49
|
+
State[State["ATTRIBUTE_VALUE_UNQUOTED"] = 37] = "ATTRIBUTE_VALUE_UNQUOTED";
|
|
50
|
+
State[State["AFTER_ATTRIBUTE_VALUE_QUOTED"] = 38] = "AFTER_ATTRIBUTE_VALUE_QUOTED";
|
|
51
|
+
State[State["SELF_CLOSING_START_TAG"] = 39] = "SELF_CLOSING_START_TAG";
|
|
52
|
+
State[State["BOGUS_COMMENT"] = 40] = "BOGUS_COMMENT";
|
|
53
|
+
State[State["MARKUP_DECLARATION_OPEN"] = 41] = "MARKUP_DECLARATION_OPEN";
|
|
54
|
+
State[State["COMMENT_START"] = 42] = "COMMENT_START";
|
|
55
|
+
State[State["COMMENT_START_DASH"] = 43] = "COMMENT_START_DASH";
|
|
56
|
+
State[State["COMMENT"] = 44] = "COMMENT";
|
|
57
|
+
State[State["COMMENT_LESS_THAN_SIGN"] = 45] = "COMMENT_LESS_THAN_SIGN";
|
|
58
|
+
State[State["COMMENT_LESS_THAN_SIGN_BANG"] = 46] = "COMMENT_LESS_THAN_SIGN_BANG";
|
|
59
|
+
State[State["COMMENT_LESS_THAN_SIGN_BANG_DASH"] = 47] = "COMMENT_LESS_THAN_SIGN_BANG_DASH";
|
|
60
|
+
State[State["COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH"] = 48] = "COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH";
|
|
61
|
+
State[State["COMMENT_END_DASH"] = 49] = "COMMENT_END_DASH";
|
|
62
|
+
State[State["COMMENT_END"] = 50] = "COMMENT_END";
|
|
63
|
+
State[State["COMMENT_END_BANG"] = 51] = "COMMENT_END_BANG";
|
|
64
|
+
State[State["DOCTYPE"] = 52] = "DOCTYPE";
|
|
65
|
+
State[State["BEFORE_DOCTYPE_NAME"] = 53] = "BEFORE_DOCTYPE_NAME";
|
|
66
|
+
State[State["DOCTYPE_NAME"] = 54] = "DOCTYPE_NAME";
|
|
67
|
+
State[State["AFTER_DOCTYPE_NAME"] = 55] = "AFTER_DOCTYPE_NAME";
|
|
68
|
+
State[State["AFTER_DOCTYPE_PUBLIC_KEYWORD"] = 56] = "AFTER_DOCTYPE_PUBLIC_KEYWORD";
|
|
69
|
+
State[State["BEFORE_DOCTYPE_PUBLIC_IDENTIFIER"] = 57] = "BEFORE_DOCTYPE_PUBLIC_IDENTIFIER";
|
|
70
|
+
State[State["DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED"] = 58] = "DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED";
|
|
71
|
+
State[State["DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED"] = 59] = "DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED";
|
|
72
|
+
State[State["AFTER_DOCTYPE_PUBLIC_IDENTIFIER"] = 60] = "AFTER_DOCTYPE_PUBLIC_IDENTIFIER";
|
|
73
|
+
State[State["BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS"] = 61] = "BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS";
|
|
74
|
+
State[State["AFTER_DOCTYPE_SYSTEM_KEYWORD"] = 62] = "AFTER_DOCTYPE_SYSTEM_KEYWORD";
|
|
75
|
+
State[State["BEFORE_DOCTYPE_SYSTEM_IDENTIFIER"] = 63] = "BEFORE_DOCTYPE_SYSTEM_IDENTIFIER";
|
|
76
|
+
State[State["DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED"] = 64] = "DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED";
|
|
77
|
+
State[State["DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED"] = 65] = "DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED";
|
|
78
|
+
State[State["AFTER_DOCTYPE_SYSTEM_IDENTIFIER"] = 66] = "AFTER_DOCTYPE_SYSTEM_IDENTIFIER";
|
|
79
|
+
State[State["BOGUS_DOCTYPE"] = 67] = "BOGUS_DOCTYPE";
|
|
80
|
+
State[State["CDATA_SECTION"] = 68] = "CDATA_SECTION";
|
|
81
|
+
State[State["CDATA_SECTION_BRACKET"] = 69] = "CDATA_SECTION_BRACKET";
|
|
82
|
+
State[State["CDATA_SECTION_END"] = 70] = "CDATA_SECTION_END";
|
|
83
|
+
State[State["CHARACTER_REFERENCE"] = 71] = "CHARACTER_REFERENCE";
|
|
84
|
+
State[State["AMBIGUOUS_AMPERSAND"] = 72] = "AMBIGUOUS_AMPERSAND";
|
|
85
|
+
})(State || (State = {}));
|
|
86
|
+
const TokenizerMode = {
|
|
87
|
+
DATA: State.DATA,
|
|
88
|
+
RCDATA: State.RCDATA,
|
|
89
|
+
RAWTEXT: State.RAWTEXT,
|
|
90
|
+
SCRIPT_DATA: State.SCRIPT_DATA,
|
|
91
|
+
PLAINTEXT: State.PLAINTEXT,
|
|
92
|
+
CDATA_SECTION: State.CDATA_SECTION
|
|
93
|
+
};
|
|
94
|
+
function isAsciiDigit(cp) {
|
|
95
|
+
return cp >= require_unicode.CODE_POINTS.DIGIT_0 && cp <= require_unicode.CODE_POINTS.DIGIT_9;
|
|
96
|
+
}
|
|
97
|
+
function isAsciiUpper(cp) {
|
|
98
|
+
return cp >= require_unicode.CODE_POINTS.LATIN_CAPITAL_A && cp <= require_unicode.CODE_POINTS.LATIN_CAPITAL_Z;
|
|
99
|
+
}
|
|
100
|
+
function isAsciiLower(cp) {
|
|
101
|
+
return cp >= require_unicode.CODE_POINTS.LATIN_SMALL_A && cp <= require_unicode.CODE_POINTS.LATIN_SMALL_Z;
|
|
102
|
+
}
|
|
103
|
+
function isAsciiLetter(cp) {
|
|
104
|
+
return isAsciiLower(cp) || isAsciiUpper(cp);
|
|
105
|
+
}
|
|
106
|
+
function isAsciiAlphaNumeric(cp) {
|
|
107
|
+
return isAsciiLetter(cp) || isAsciiDigit(cp);
|
|
108
|
+
}
|
|
109
|
+
function toAsciiLower(cp) {
|
|
110
|
+
return cp + 32;
|
|
111
|
+
}
|
|
112
|
+
function isWhitespace(cp) {
|
|
113
|
+
return cp === require_unicode.CODE_POINTS.SPACE || cp === require_unicode.CODE_POINTS.LINE_FEED || cp === require_unicode.CODE_POINTS.TABULATION || cp === require_unicode.CODE_POINTS.FORM_FEED;
|
|
114
|
+
}
|
|
115
|
+
function isScriptDataDoubleEscapeSequenceEnd(cp) {
|
|
116
|
+
return isWhitespace(cp) || cp === require_unicode.CODE_POINTS.SOLIDUS || cp === require_unicode.CODE_POINTS.GREATER_THAN_SIGN;
|
|
117
|
+
}
|
|
118
|
+
function getErrorForNumericCharacterReference(code) {
|
|
119
|
+
if (code === require_unicode.CODE_POINTS.NULL) return require_error_codes.ERR.nullCharacterReference;
|
|
120
|
+
else if (code > 1114111) return require_error_codes.ERR.characterReferenceOutsideUnicodeRange;
|
|
121
|
+
else if (require_unicode.isSurrogate(code)) return require_error_codes.ERR.surrogateCharacterReference;
|
|
122
|
+
else if (require_unicode.isUndefinedCodePoint(code)) return require_error_codes.ERR.noncharacterCharacterReference;
|
|
123
|
+
else if (require_unicode.isControlCodePoint(code) || code === require_unicode.CODE_POINTS.CARRIAGE_RETURN) return require_error_codes.ERR.controlCharacterReference;
|
|
124
|
+
return null;
|
|
125
|
+
}
|
|
126
|
+
var Tokenizer = class {
|
|
127
|
+
constructor(options, handler) {
|
|
128
|
+
this.options = options;
|
|
129
|
+
this.handler = handler;
|
|
130
|
+
this.paused = false;
|
|
131
|
+
/** Ensures that the parsing loop isn't run multiple times at once. */
|
|
132
|
+
this.inLoop = false;
|
|
133
|
+
/**
|
|
134
|
+
* Indicates that the current adjusted node exists, is not an element in the HTML namespace,
|
|
135
|
+
* and that it is not an integration point for either MathML or HTML.
|
|
136
|
+
*
|
|
137
|
+
* @see {@link https://html.spec.whatwg.org/multipage/parsing.html#tree-construction}
|
|
138
|
+
*/
|
|
139
|
+
this.inForeignNode = false;
|
|
140
|
+
this.lastStartTagName = "";
|
|
141
|
+
this.active = false;
|
|
142
|
+
this.state = State.DATA;
|
|
143
|
+
this.returnState = State.DATA;
|
|
144
|
+
this.entityStartPos = 0;
|
|
145
|
+
this.consumedAfterSnapshot = -1;
|
|
146
|
+
this.currentCharacterToken = null;
|
|
147
|
+
this.currentToken = null;
|
|
148
|
+
this.currentAttr = {
|
|
149
|
+
name: "",
|
|
150
|
+
value: ""
|
|
151
|
+
};
|
|
152
|
+
this.preprocessor = new require_preprocessor.Preprocessor(handler);
|
|
153
|
+
this.currentLocation = this.getCurrentLocation(-1);
|
|
154
|
+
this.entityDecoder = new require_decode.EntityDecoder(require_decode_data_html.htmlDecodeTree, (cp, consumed) => {
|
|
155
|
+
this.preprocessor.pos = this.entityStartPos + consumed - 1;
|
|
156
|
+
this._flushCodePointConsumedAsCharacterReference(cp);
|
|
157
|
+
}, handler.onParseError ? {
|
|
158
|
+
missingSemicolonAfterCharacterReference: () => {
|
|
159
|
+
this._err(require_error_codes.ERR.missingSemicolonAfterCharacterReference, 1);
|
|
160
|
+
},
|
|
161
|
+
absenceOfDigitsInNumericCharacterReference: (consumed) => {
|
|
162
|
+
this._err(require_error_codes.ERR.absenceOfDigitsInNumericCharacterReference, this.entityStartPos - this.preprocessor.pos + consumed);
|
|
163
|
+
},
|
|
164
|
+
validateNumericCharacterReference: (code) => {
|
|
165
|
+
const error = getErrorForNumericCharacterReference(code);
|
|
166
|
+
if (error) this._err(error, 1);
|
|
167
|
+
}
|
|
168
|
+
} : void 0);
|
|
169
|
+
}
|
|
170
|
+
_err(code, cpOffset = 0) {
|
|
171
|
+
var _a, _b;
|
|
172
|
+
(_b = (_a = this.handler).onParseError) === null || _b === void 0 || _b.call(_a, this.preprocessor.getError(code, cpOffset));
|
|
173
|
+
}
|
|
174
|
+
getCurrentLocation(offset) {
|
|
175
|
+
if (!this.options.sourceCodeLocationInfo) return null;
|
|
176
|
+
return {
|
|
177
|
+
startLine: this.preprocessor.line,
|
|
178
|
+
startCol: this.preprocessor.col - offset,
|
|
179
|
+
startOffset: this.preprocessor.offset - offset,
|
|
180
|
+
endLine: -1,
|
|
181
|
+
endCol: -1,
|
|
182
|
+
endOffset: -1
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
_runParsingLoop() {
|
|
186
|
+
if (this.inLoop) return;
|
|
187
|
+
this.inLoop = true;
|
|
188
|
+
while (this.active && !this.paused) {
|
|
189
|
+
this.consumedAfterSnapshot = 0;
|
|
190
|
+
const cp = this._consume();
|
|
191
|
+
if (!this._ensureHibernation()) this._callState(cp);
|
|
192
|
+
}
|
|
193
|
+
this.inLoop = false;
|
|
194
|
+
}
|
|
195
|
+
pause() {
|
|
196
|
+
this.paused = true;
|
|
197
|
+
}
|
|
198
|
+
resume(writeCallback) {
|
|
199
|
+
if (!this.paused) throw new Error("Parser was already resumed");
|
|
200
|
+
this.paused = false;
|
|
201
|
+
if (this.inLoop) return;
|
|
202
|
+
this._runParsingLoop();
|
|
203
|
+
if (!this.paused) writeCallback === null || writeCallback === void 0 || writeCallback();
|
|
204
|
+
}
|
|
205
|
+
write(chunk, isLastChunk, writeCallback) {
|
|
206
|
+
this.active = true;
|
|
207
|
+
this.preprocessor.write(chunk, isLastChunk);
|
|
208
|
+
this._runParsingLoop();
|
|
209
|
+
if (!this.paused) writeCallback === null || writeCallback === void 0 || writeCallback();
|
|
210
|
+
}
|
|
211
|
+
insertHtmlAtCurrentPos(chunk) {
|
|
212
|
+
this.active = true;
|
|
213
|
+
this.preprocessor.insertHtmlAtCurrentPos(chunk);
|
|
214
|
+
this._runParsingLoop();
|
|
215
|
+
}
|
|
216
|
+
_ensureHibernation() {
|
|
217
|
+
if (this.preprocessor.endOfChunkHit) {
|
|
218
|
+
this.preprocessor.retreat(this.consumedAfterSnapshot);
|
|
219
|
+
this.consumedAfterSnapshot = 0;
|
|
220
|
+
this.active = false;
|
|
221
|
+
return true;
|
|
222
|
+
}
|
|
223
|
+
return false;
|
|
224
|
+
}
|
|
225
|
+
_consume() {
|
|
226
|
+
this.consumedAfterSnapshot++;
|
|
227
|
+
return this.preprocessor.advance();
|
|
228
|
+
}
|
|
229
|
+
_advanceBy(count) {
|
|
230
|
+
this.consumedAfterSnapshot += count;
|
|
231
|
+
for (let i = 0; i < count; i++) this.preprocessor.advance();
|
|
232
|
+
}
|
|
233
|
+
_consumeSequenceIfMatch(pattern, caseSensitive) {
|
|
234
|
+
if (this.preprocessor.startsWith(pattern, caseSensitive)) {
|
|
235
|
+
this._advanceBy(pattern.length - 1);
|
|
236
|
+
return true;
|
|
237
|
+
}
|
|
238
|
+
return false;
|
|
239
|
+
}
|
|
240
|
+
_createStartTagToken() {
|
|
241
|
+
this.currentToken = {
|
|
242
|
+
type: require_token.TokenType.START_TAG,
|
|
243
|
+
tagName: "",
|
|
244
|
+
tagID: require_html.TAG_ID.UNKNOWN,
|
|
245
|
+
selfClosing: false,
|
|
246
|
+
ackSelfClosing: false,
|
|
247
|
+
attrs: [],
|
|
248
|
+
location: this.getCurrentLocation(1)
|
|
249
|
+
};
|
|
250
|
+
}
|
|
251
|
+
_createEndTagToken() {
|
|
252
|
+
this.currentToken = {
|
|
253
|
+
type: require_token.TokenType.END_TAG,
|
|
254
|
+
tagName: "",
|
|
255
|
+
tagID: require_html.TAG_ID.UNKNOWN,
|
|
256
|
+
selfClosing: false,
|
|
257
|
+
ackSelfClosing: false,
|
|
258
|
+
attrs: [],
|
|
259
|
+
location: this.getCurrentLocation(2)
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
_createCommentToken(offset) {
|
|
263
|
+
this.currentToken = {
|
|
264
|
+
type: require_token.TokenType.COMMENT,
|
|
265
|
+
data: "",
|
|
266
|
+
location: this.getCurrentLocation(offset)
|
|
267
|
+
};
|
|
268
|
+
}
|
|
269
|
+
_createDoctypeToken(initialName) {
|
|
270
|
+
this.currentToken = {
|
|
271
|
+
type: require_token.TokenType.DOCTYPE,
|
|
272
|
+
name: initialName,
|
|
273
|
+
forceQuirks: false,
|
|
274
|
+
publicId: null,
|
|
275
|
+
systemId: null,
|
|
276
|
+
location: this.currentLocation
|
|
277
|
+
};
|
|
278
|
+
}
|
|
279
|
+
_createCharacterToken(type, chars) {
|
|
280
|
+
this.currentCharacterToken = {
|
|
281
|
+
type,
|
|
282
|
+
chars,
|
|
283
|
+
location: this.currentLocation
|
|
284
|
+
};
|
|
285
|
+
}
|
|
286
|
+
_createAttr(attrNameFirstCh) {
|
|
287
|
+
this.currentAttr = {
|
|
288
|
+
name: attrNameFirstCh,
|
|
289
|
+
value: ""
|
|
290
|
+
};
|
|
291
|
+
this.currentLocation = this.getCurrentLocation(0);
|
|
292
|
+
}
|
|
293
|
+
_leaveAttrName() {
|
|
294
|
+
var _a;
|
|
295
|
+
var _b;
|
|
296
|
+
const token = this.currentToken;
|
|
297
|
+
if (require_token.getTokenAttr(token, this.currentAttr.name) === null) {
|
|
298
|
+
token.attrs.push(this.currentAttr);
|
|
299
|
+
if (token.location && this.currentLocation) {
|
|
300
|
+
const attrLocations = (_a = (_b = token.location).attrs) !== null && _a !== void 0 ? _a : _b.attrs = Object.create(null);
|
|
301
|
+
attrLocations[this.currentAttr.name] = this.currentLocation;
|
|
302
|
+
this._leaveAttrValue();
|
|
303
|
+
}
|
|
304
|
+
} else this._err(require_error_codes.ERR.duplicateAttribute);
|
|
305
|
+
}
|
|
306
|
+
_leaveAttrValue() {
|
|
307
|
+
if (this.currentLocation) {
|
|
308
|
+
this.currentLocation.endLine = this.preprocessor.line;
|
|
309
|
+
this.currentLocation.endCol = this.preprocessor.col;
|
|
310
|
+
this.currentLocation.endOffset = this.preprocessor.offset;
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
prepareToken(ct) {
|
|
314
|
+
this._emitCurrentCharacterToken(ct.location);
|
|
315
|
+
this.currentToken = null;
|
|
316
|
+
if (ct.location) {
|
|
317
|
+
ct.location.endLine = this.preprocessor.line;
|
|
318
|
+
ct.location.endCol = this.preprocessor.col + 1;
|
|
319
|
+
ct.location.endOffset = this.preprocessor.offset + 1;
|
|
320
|
+
}
|
|
321
|
+
this.currentLocation = this.getCurrentLocation(-1);
|
|
322
|
+
}
|
|
323
|
+
emitCurrentTagToken() {
|
|
324
|
+
const ct = this.currentToken;
|
|
325
|
+
this.prepareToken(ct);
|
|
326
|
+
ct.tagID = require_html.getTagID(ct.tagName);
|
|
327
|
+
if (ct.type === require_token.TokenType.START_TAG) {
|
|
328
|
+
this.lastStartTagName = ct.tagName;
|
|
329
|
+
this.handler.onStartTag(ct);
|
|
330
|
+
} else {
|
|
331
|
+
if (ct.attrs.length > 0) this._err(require_error_codes.ERR.endTagWithAttributes);
|
|
332
|
+
if (ct.selfClosing) this._err(require_error_codes.ERR.endTagWithTrailingSolidus);
|
|
333
|
+
this.handler.onEndTag(ct);
|
|
334
|
+
}
|
|
335
|
+
this.preprocessor.dropParsedChunk();
|
|
336
|
+
}
|
|
337
|
+
emitCurrentComment(ct) {
|
|
338
|
+
this.prepareToken(ct);
|
|
339
|
+
this.handler.onComment(ct);
|
|
340
|
+
this.preprocessor.dropParsedChunk();
|
|
341
|
+
}
|
|
342
|
+
emitCurrentDoctype(ct) {
|
|
343
|
+
this.prepareToken(ct);
|
|
344
|
+
this.handler.onDoctype(ct);
|
|
345
|
+
this.preprocessor.dropParsedChunk();
|
|
346
|
+
}
|
|
347
|
+
_emitCurrentCharacterToken(nextLocation) {
|
|
348
|
+
if (this.currentCharacterToken) {
|
|
349
|
+
if (nextLocation && this.currentCharacterToken.location) {
|
|
350
|
+
this.currentCharacterToken.location.endLine = nextLocation.startLine;
|
|
351
|
+
this.currentCharacterToken.location.endCol = nextLocation.startCol;
|
|
352
|
+
this.currentCharacterToken.location.endOffset = nextLocation.startOffset;
|
|
353
|
+
}
|
|
354
|
+
switch (this.currentCharacterToken.type) {
|
|
355
|
+
case require_token.TokenType.CHARACTER:
|
|
356
|
+
this.handler.onCharacter(this.currentCharacterToken);
|
|
357
|
+
break;
|
|
358
|
+
case require_token.TokenType.NULL_CHARACTER:
|
|
359
|
+
this.handler.onNullCharacter(this.currentCharacterToken);
|
|
360
|
+
break;
|
|
361
|
+
case require_token.TokenType.WHITESPACE_CHARACTER:
|
|
362
|
+
this.handler.onWhitespaceCharacter(this.currentCharacterToken);
|
|
363
|
+
break;
|
|
364
|
+
}
|
|
365
|
+
this.currentCharacterToken = null;
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
_emitEOFToken() {
|
|
369
|
+
const location = this.getCurrentLocation(0);
|
|
370
|
+
if (location) {
|
|
371
|
+
location.endLine = location.startLine;
|
|
372
|
+
location.endCol = location.startCol;
|
|
373
|
+
location.endOffset = location.startOffset;
|
|
374
|
+
}
|
|
375
|
+
this._emitCurrentCharacterToken(location);
|
|
376
|
+
this.handler.onEof({
|
|
377
|
+
type: require_token.TokenType.EOF,
|
|
378
|
+
location
|
|
379
|
+
});
|
|
380
|
+
this.active = false;
|
|
381
|
+
}
|
|
382
|
+
_appendCharToCurrentCharacterToken(type, ch) {
|
|
383
|
+
if (this.currentCharacterToken) if (this.currentCharacterToken.type === type) {
|
|
384
|
+
this.currentCharacterToken.chars += ch;
|
|
385
|
+
return;
|
|
386
|
+
} else {
|
|
387
|
+
this.currentLocation = this.getCurrentLocation(0);
|
|
388
|
+
this._emitCurrentCharacterToken(this.currentLocation);
|
|
389
|
+
this.preprocessor.dropParsedChunk();
|
|
390
|
+
}
|
|
391
|
+
this._createCharacterToken(type, ch);
|
|
392
|
+
}
|
|
393
|
+
_emitCodePoint(cp) {
|
|
394
|
+
const type = isWhitespace(cp) ? require_token.TokenType.WHITESPACE_CHARACTER : cp === require_unicode.CODE_POINTS.NULL ? require_token.TokenType.NULL_CHARACTER : require_token.TokenType.CHARACTER;
|
|
395
|
+
this._appendCharToCurrentCharacterToken(type, String.fromCodePoint(cp));
|
|
396
|
+
}
|
|
397
|
+
_emitChars(ch) {
|
|
398
|
+
this._appendCharToCurrentCharacterToken(require_token.TokenType.CHARACTER, ch);
|
|
399
|
+
}
|
|
400
|
+
_startCharacterReference() {
|
|
401
|
+
this.returnState = this.state;
|
|
402
|
+
this.state = State.CHARACTER_REFERENCE;
|
|
403
|
+
this.entityStartPos = this.preprocessor.pos;
|
|
404
|
+
this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute() ? require_decode.DecodingMode.Attribute : require_decode.DecodingMode.Legacy);
|
|
405
|
+
}
|
|
406
|
+
_isCharacterReferenceInAttribute() {
|
|
407
|
+
return this.returnState === State.ATTRIBUTE_VALUE_DOUBLE_QUOTED || this.returnState === State.ATTRIBUTE_VALUE_SINGLE_QUOTED || this.returnState === State.ATTRIBUTE_VALUE_UNQUOTED;
|
|
408
|
+
}
|
|
409
|
+
_flushCodePointConsumedAsCharacterReference(cp) {
|
|
410
|
+
if (this._isCharacterReferenceInAttribute()) this.currentAttr.value += String.fromCodePoint(cp);
|
|
411
|
+
else this._emitCodePoint(cp);
|
|
412
|
+
}
|
|
413
|
+
_callState(cp) {
|
|
414
|
+
switch (this.state) {
|
|
415
|
+
case State.DATA:
|
|
416
|
+
this._stateData(cp);
|
|
417
|
+
break;
|
|
418
|
+
case State.RCDATA:
|
|
419
|
+
this._stateRcdata(cp);
|
|
420
|
+
break;
|
|
421
|
+
case State.RAWTEXT:
|
|
422
|
+
this._stateRawtext(cp);
|
|
423
|
+
break;
|
|
424
|
+
case State.SCRIPT_DATA:
|
|
425
|
+
this._stateScriptData(cp);
|
|
426
|
+
break;
|
|
427
|
+
case State.PLAINTEXT:
|
|
428
|
+
this._statePlaintext(cp);
|
|
429
|
+
break;
|
|
430
|
+
case State.TAG_OPEN:
|
|
431
|
+
this._stateTagOpen(cp);
|
|
432
|
+
break;
|
|
433
|
+
case State.END_TAG_OPEN:
|
|
434
|
+
this._stateEndTagOpen(cp);
|
|
435
|
+
break;
|
|
436
|
+
case State.TAG_NAME:
|
|
437
|
+
this._stateTagName(cp);
|
|
438
|
+
break;
|
|
439
|
+
case State.RCDATA_LESS_THAN_SIGN:
|
|
440
|
+
this._stateRcdataLessThanSign(cp);
|
|
441
|
+
break;
|
|
442
|
+
case State.RCDATA_END_TAG_OPEN:
|
|
443
|
+
this._stateRcdataEndTagOpen(cp);
|
|
444
|
+
break;
|
|
445
|
+
case State.RCDATA_END_TAG_NAME:
|
|
446
|
+
this._stateRcdataEndTagName(cp);
|
|
447
|
+
break;
|
|
448
|
+
case State.RAWTEXT_LESS_THAN_SIGN:
|
|
449
|
+
this._stateRawtextLessThanSign(cp);
|
|
450
|
+
break;
|
|
451
|
+
case State.RAWTEXT_END_TAG_OPEN:
|
|
452
|
+
this._stateRawtextEndTagOpen(cp);
|
|
453
|
+
break;
|
|
454
|
+
case State.RAWTEXT_END_TAG_NAME:
|
|
455
|
+
this._stateRawtextEndTagName(cp);
|
|
456
|
+
break;
|
|
457
|
+
case State.SCRIPT_DATA_LESS_THAN_SIGN:
|
|
458
|
+
this._stateScriptDataLessThanSign(cp);
|
|
459
|
+
break;
|
|
460
|
+
case State.SCRIPT_DATA_END_TAG_OPEN:
|
|
461
|
+
this._stateScriptDataEndTagOpen(cp);
|
|
462
|
+
break;
|
|
463
|
+
case State.SCRIPT_DATA_END_TAG_NAME:
|
|
464
|
+
this._stateScriptDataEndTagName(cp);
|
|
465
|
+
break;
|
|
466
|
+
case State.SCRIPT_DATA_ESCAPE_START:
|
|
467
|
+
this._stateScriptDataEscapeStart(cp);
|
|
468
|
+
break;
|
|
469
|
+
case State.SCRIPT_DATA_ESCAPE_START_DASH:
|
|
470
|
+
this._stateScriptDataEscapeStartDash(cp);
|
|
471
|
+
break;
|
|
472
|
+
case State.SCRIPT_DATA_ESCAPED:
|
|
473
|
+
this._stateScriptDataEscaped(cp);
|
|
474
|
+
break;
|
|
475
|
+
case State.SCRIPT_DATA_ESCAPED_DASH:
|
|
476
|
+
this._stateScriptDataEscapedDash(cp);
|
|
477
|
+
break;
|
|
478
|
+
case State.SCRIPT_DATA_ESCAPED_DASH_DASH:
|
|
479
|
+
this._stateScriptDataEscapedDashDash(cp);
|
|
480
|
+
break;
|
|
481
|
+
case State.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:
|
|
482
|
+
this._stateScriptDataEscapedLessThanSign(cp);
|
|
483
|
+
break;
|
|
484
|
+
case State.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:
|
|
485
|
+
this._stateScriptDataEscapedEndTagOpen(cp);
|
|
486
|
+
break;
|
|
487
|
+
case State.SCRIPT_DATA_ESCAPED_END_TAG_NAME:
|
|
488
|
+
this._stateScriptDataEscapedEndTagName(cp);
|
|
489
|
+
break;
|
|
490
|
+
case State.SCRIPT_DATA_DOUBLE_ESCAPE_START:
|
|
491
|
+
this._stateScriptDataDoubleEscapeStart(cp);
|
|
492
|
+
break;
|
|
493
|
+
case State.SCRIPT_DATA_DOUBLE_ESCAPED:
|
|
494
|
+
this._stateScriptDataDoubleEscaped(cp);
|
|
495
|
+
break;
|
|
496
|
+
case State.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:
|
|
497
|
+
this._stateScriptDataDoubleEscapedDash(cp);
|
|
498
|
+
break;
|
|
499
|
+
case State.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:
|
|
500
|
+
this._stateScriptDataDoubleEscapedDashDash(cp);
|
|
501
|
+
break;
|
|
502
|
+
case State.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:
|
|
503
|
+
this._stateScriptDataDoubleEscapedLessThanSign(cp);
|
|
504
|
+
break;
|
|
505
|
+
case State.SCRIPT_DATA_DOUBLE_ESCAPE_END:
|
|
506
|
+
this._stateScriptDataDoubleEscapeEnd(cp);
|
|
507
|
+
break;
|
|
508
|
+
case State.BEFORE_ATTRIBUTE_NAME:
|
|
509
|
+
this._stateBeforeAttributeName(cp);
|
|
510
|
+
break;
|
|
511
|
+
case State.ATTRIBUTE_NAME:
|
|
512
|
+
this._stateAttributeName(cp);
|
|
513
|
+
break;
|
|
514
|
+
case State.AFTER_ATTRIBUTE_NAME:
|
|
515
|
+
this._stateAfterAttributeName(cp);
|
|
516
|
+
break;
|
|
517
|
+
case State.BEFORE_ATTRIBUTE_VALUE:
|
|
518
|
+
this._stateBeforeAttributeValue(cp);
|
|
519
|
+
break;
|
|
520
|
+
case State.ATTRIBUTE_VALUE_DOUBLE_QUOTED:
|
|
521
|
+
this._stateAttributeValueDoubleQuoted(cp);
|
|
522
|
+
break;
|
|
523
|
+
case State.ATTRIBUTE_VALUE_SINGLE_QUOTED:
|
|
524
|
+
this._stateAttributeValueSingleQuoted(cp);
|
|
525
|
+
break;
|
|
526
|
+
case State.ATTRIBUTE_VALUE_UNQUOTED:
|
|
527
|
+
this._stateAttributeValueUnquoted(cp);
|
|
528
|
+
break;
|
|
529
|
+
case State.AFTER_ATTRIBUTE_VALUE_QUOTED:
|
|
530
|
+
this._stateAfterAttributeValueQuoted(cp);
|
|
531
|
+
break;
|
|
532
|
+
case State.SELF_CLOSING_START_TAG:
|
|
533
|
+
this._stateSelfClosingStartTag(cp);
|
|
534
|
+
break;
|
|
535
|
+
case State.BOGUS_COMMENT:
|
|
536
|
+
this._stateBogusComment(cp);
|
|
537
|
+
break;
|
|
538
|
+
case State.MARKUP_DECLARATION_OPEN:
|
|
539
|
+
this._stateMarkupDeclarationOpen(cp);
|
|
540
|
+
break;
|
|
541
|
+
case State.COMMENT_START:
|
|
542
|
+
this._stateCommentStart(cp);
|
|
543
|
+
break;
|
|
544
|
+
case State.COMMENT_START_DASH:
|
|
545
|
+
this._stateCommentStartDash(cp);
|
|
546
|
+
break;
|
|
547
|
+
case State.COMMENT:
|
|
548
|
+
this._stateComment(cp);
|
|
549
|
+
break;
|
|
550
|
+
case State.COMMENT_LESS_THAN_SIGN:
|
|
551
|
+
this._stateCommentLessThanSign(cp);
|
|
552
|
+
break;
|
|
553
|
+
case State.COMMENT_LESS_THAN_SIGN_BANG:
|
|
554
|
+
this._stateCommentLessThanSignBang(cp);
|
|
555
|
+
break;
|
|
556
|
+
case State.COMMENT_LESS_THAN_SIGN_BANG_DASH:
|
|
557
|
+
this._stateCommentLessThanSignBangDash(cp);
|
|
558
|
+
break;
|
|
559
|
+
case State.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:
|
|
560
|
+
this._stateCommentLessThanSignBangDashDash(cp);
|
|
561
|
+
break;
|
|
562
|
+
case State.COMMENT_END_DASH:
|
|
563
|
+
this._stateCommentEndDash(cp);
|
|
564
|
+
break;
|
|
565
|
+
case State.COMMENT_END:
|
|
566
|
+
this._stateCommentEnd(cp);
|
|
567
|
+
break;
|
|
568
|
+
case State.COMMENT_END_BANG:
|
|
569
|
+
this._stateCommentEndBang(cp);
|
|
570
|
+
break;
|
|
571
|
+
case State.DOCTYPE:
|
|
572
|
+
this._stateDoctype(cp);
|
|
573
|
+
break;
|
|
574
|
+
case State.BEFORE_DOCTYPE_NAME:
|
|
575
|
+
this._stateBeforeDoctypeName(cp);
|
|
576
|
+
break;
|
|
577
|
+
case State.DOCTYPE_NAME:
|
|
578
|
+
this._stateDoctypeName(cp);
|
|
579
|
+
break;
|
|
580
|
+
case State.AFTER_DOCTYPE_NAME:
|
|
581
|
+
this._stateAfterDoctypeName(cp);
|
|
582
|
+
break;
|
|
583
|
+
case State.AFTER_DOCTYPE_PUBLIC_KEYWORD:
|
|
584
|
+
this._stateAfterDoctypePublicKeyword(cp);
|
|
585
|
+
break;
|
|
586
|
+
case State.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:
|
|
587
|
+
this._stateBeforeDoctypePublicIdentifier(cp);
|
|
588
|
+
break;
|
|
589
|
+
case State.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:
|
|
590
|
+
this._stateDoctypePublicIdentifierDoubleQuoted(cp);
|
|
591
|
+
break;
|
|
592
|
+
case State.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:
|
|
593
|
+
this._stateDoctypePublicIdentifierSingleQuoted(cp);
|
|
594
|
+
break;
|
|
595
|
+
case State.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:
|
|
596
|
+
this._stateAfterDoctypePublicIdentifier(cp);
|
|
597
|
+
break;
|
|
598
|
+
case State.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:
|
|
599
|
+
this._stateBetweenDoctypePublicAndSystemIdentifiers(cp);
|
|
600
|
+
break;
|
|
601
|
+
case State.AFTER_DOCTYPE_SYSTEM_KEYWORD:
|
|
602
|
+
this._stateAfterDoctypeSystemKeyword(cp);
|
|
603
|
+
break;
|
|
604
|
+
case State.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:
|
|
605
|
+
this._stateBeforeDoctypeSystemIdentifier(cp);
|
|
606
|
+
break;
|
|
607
|
+
case State.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:
|
|
608
|
+
this._stateDoctypeSystemIdentifierDoubleQuoted(cp);
|
|
609
|
+
break;
|
|
610
|
+
case State.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:
|
|
611
|
+
this._stateDoctypeSystemIdentifierSingleQuoted(cp);
|
|
612
|
+
break;
|
|
613
|
+
case State.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:
|
|
614
|
+
this._stateAfterDoctypeSystemIdentifier(cp);
|
|
615
|
+
break;
|
|
616
|
+
case State.BOGUS_DOCTYPE:
|
|
617
|
+
this._stateBogusDoctype(cp);
|
|
618
|
+
break;
|
|
619
|
+
case State.CDATA_SECTION:
|
|
620
|
+
this._stateCdataSection(cp);
|
|
621
|
+
break;
|
|
622
|
+
case State.CDATA_SECTION_BRACKET:
|
|
623
|
+
this._stateCdataSectionBracket(cp);
|
|
624
|
+
break;
|
|
625
|
+
case State.CDATA_SECTION_END:
|
|
626
|
+
this._stateCdataSectionEnd(cp);
|
|
627
|
+
break;
|
|
628
|
+
case State.CHARACTER_REFERENCE:
|
|
629
|
+
this._stateCharacterReference();
|
|
630
|
+
break;
|
|
631
|
+
case State.AMBIGUOUS_AMPERSAND:
|
|
632
|
+
this._stateAmbiguousAmpersand(cp);
|
|
633
|
+
break;
|
|
634
|
+
default: throw new Error("Unknown state");
|
|
635
|
+
}
|
|
636
|
+
}
|
|
637
|
+
_stateData(cp) {
|
|
638
|
+
switch (cp) {
|
|
639
|
+
case require_unicode.CODE_POINTS.LESS_THAN_SIGN:
|
|
640
|
+
this.state = State.TAG_OPEN;
|
|
641
|
+
break;
|
|
642
|
+
case require_unicode.CODE_POINTS.AMPERSAND:
|
|
643
|
+
this._startCharacterReference();
|
|
644
|
+
break;
|
|
645
|
+
case require_unicode.CODE_POINTS.NULL:
|
|
646
|
+
this._err(require_error_codes.ERR.unexpectedNullCharacter);
|
|
647
|
+
this._emitCodePoint(cp);
|
|
648
|
+
break;
|
|
649
|
+
case require_unicode.CODE_POINTS.EOF:
|
|
650
|
+
this._emitEOFToken();
|
|
651
|
+
break;
|
|
652
|
+
default: this._emitCodePoint(cp);
|
|
653
|
+
}
|
|
654
|
+
}
|
|
655
|
+
_stateRcdata(cp) {
|
|
656
|
+
switch (cp) {
|
|
657
|
+
case require_unicode.CODE_POINTS.AMPERSAND:
|
|
658
|
+
this._startCharacterReference();
|
|
659
|
+
break;
|
|
660
|
+
case require_unicode.CODE_POINTS.LESS_THAN_SIGN:
|
|
661
|
+
this.state = State.RCDATA_LESS_THAN_SIGN;
|
|
662
|
+
break;
|
|
663
|
+
case require_unicode.CODE_POINTS.NULL:
|
|
664
|
+
this._err(require_error_codes.ERR.unexpectedNullCharacter);
|
|
665
|
+
this._emitChars("�");
|
|
666
|
+
break;
|
|
667
|
+
case require_unicode.CODE_POINTS.EOF:
|
|
668
|
+
this._emitEOFToken();
|
|
669
|
+
break;
|
|
670
|
+
default: this._emitCodePoint(cp);
|
|
671
|
+
}
|
|
672
|
+
}
|
|
673
|
+
_stateRawtext(cp) {
|
|
674
|
+
switch (cp) {
|
|
675
|
+
case require_unicode.CODE_POINTS.LESS_THAN_SIGN:
|
|
676
|
+
this.state = State.RAWTEXT_LESS_THAN_SIGN;
|
|
677
|
+
break;
|
|
678
|
+
case require_unicode.CODE_POINTS.NULL:
|
|
679
|
+
this._err(require_error_codes.ERR.unexpectedNullCharacter);
|
|
680
|
+
this._emitChars("�");
|
|
681
|
+
break;
|
|
682
|
+
case require_unicode.CODE_POINTS.EOF:
|
|
683
|
+
this._emitEOFToken();
|
|
684
|
+
break;
|
|
685
|
+
default: this._emitCodePoint(cp);
|
|
686
|
+
}
|
|
687
|
+
}
|
|
688
|
+
_stateScriptData(cp) {
|
|
689
|
+
switch (cp) {
|
|
690
|
+
case require_unicode.CODE_POINTS.LESS_THAN_SIGN:
|
|
691
|
+
this.state = State.SCRIPT_DATA_LESS_THAN_SIGN;
|
|
692
|
+
break;
|
|
693
|
+
case require_unicode.CODE_POINTS.NULL:
|
|
694
|
+
this._err(require_error_codes.ERR.unexpectedNullCharacter);
|
|
695
|
+
this._emitChars("�");
|
|
696
|
+
break;
|
|
697
|
+
case require_unicode.CODE_POINTS.EOF:
|
|
698
|
+
this._emitEOFToken();
|
|
699
|
+
break;
|
|
700
|
+
default: this._emitCodePoint(cp);
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
_statePlaintext(cp) {
|
|
704
|
+
switch (cp) {
|
|
705
|
+
case require_unicode.CODE_POINTS.NULL:
|
|
706
|
+
this._err(require_error_codes.ERR.unexpectedNullCharacter);
|
|
707
|
+
this._emitChars("�");
|
|
708
|
+
break;
|
|
709
|
+
case require_unicode.CODE_POINTS.EOF:
|
|
710
|
+
this._emitEOFToken();
|
|
711
|
+
break;
|
|
712
|
+
default: this._emitCodePoint(cp);
|
|
713
|
+
}
|
|
714
|
+
}
|
|
715
|
+
_stateTagOpen(cp) {
|
|
716
|
+
if (isAsciiLetter(cp)) {
|
|
717
|
+
this._createStartTagToken();
|
|
718
|
+
this.state = State.TAG_NAME;
|
|
719
|
+
this._stateTagName(cp);
|
|
720
|
+
} else switch (cp) {
|
|
721
|
+
case require_unicode.CODE_POINTS.EXCLAMATION_MARK:
|
|
722
|
+
this.state = State.MARKUP_DECLARATION_OPEN;
|
|
723
|
+
break;
|
|
724
|
+
case require_unicode.CODE_POINTS.SOLIDUS:
|
|
725
|
+
this.state = State.END_TAG_OPEN;
|
|
726
|
+
break;
|
|
727
|
+
case require_unicode.CODE_POINTS.QUESTION_MARK:
|
|
728
|
+
this._err(require_error_codes.ERR.unexpectedQuestionMarkInsteadOfTagName);
|
|
729
|
+
this._createCommentToken(1);
|
|
730
|
+
this.state = State.BOGUS_COMMENT;
|
|
731
|
+
this._stateBogusComment(cp);
|
|
732
|
+
break;
|
|
733
|
+
case require_unicode.CODE_POINTS.EOF:
|
|
734
|
+
this._err(require_error_codes.ERR.eofBeforeTagName);
|
|
735
|
+
this._emitChars("<");
|
|
736
|
+
this._emitEOFToken();
|
|
737
|
+
break;
|
|
738
|
+
default:
|
|
739
|
+
this._err(require_error_codes.ERR.invalidFirstCharacterOfTagName);
|
|
740
|
+
this._emitChars("<");
|
|
741
|
+
this.state = State.DATA;
|
|
742
|
+
this._stateData(cp);
|
|
743
|
+
}
|
|
744
|
+
}
|
|
745
|
+
_stateEndTagOpen(cp) {
|
|
746
|
+
if (isAsciiLetter(cp)) {
|
|
747
|
+
this._createEndTagToken();
|
|
748
|
+
this.state = State.TAG_NAME;
|
|
749
|
+
this._stateTagName(cp);
|
|
750
|
+
} else switch (cp) {
|
|
751
|
+
case require_unicode.CODE_POINTS.GREATER_THAN_SIGN:
|
|
752
|
+
this._err(require_error_codes.ERR.missingEndTagName);
|
|
753
|
+
this.state = State.DATA;
|
|
754
|
+
break;
|
|
755
|
+
case require_unicode.CODE_POINTS.EOF:
|
|
756
|
+
this._err(require_error_codes.ERR.eofBeforeTagName);
|
|
757
|
+
this._emitChars("</");
|
|
758
|
+
this._emitEOFToken();
|
|
759
|
+
break;
|
|
760
|
+
default:
|
|
761
|
+
this._err(require_error_codes.ERR.invalidFirstCharacterOfTagName);
|
|
762
|
+
this._createCommentToken(2);
|
|
763
|
+
this.state = State.BOGUS_COMMENT;
|
|
764
|
+
this._stateBogusComment(cp);
|
|
765
|
+
}
|
|
766
|
+
}
|
|
767
|
+
_stateTagName(cp) {
|
|
768
|
+
const token = this.currentToken;
|
|
769
|
+
switch (cp) {
|
|
770
|
+
case require_unicode.CODE_POINTS.SPACE:
|
|
771
|
+
case require_unicode.CODE_POINTS.LINE_FEED:
|
|
772
|
+
case require_unicode.CODE_POINTS.TABULATION:
|
|
773
|
+
case require_unicode.CODE_POINTS.FORM_FEED:
|
|
774
|
+
this.state = State.BEFORE_ATTRIBUTE_NAME;
|
|
775
|
+
break;
|
|
776
|
+
case require_unicode.CODE_POINTS.SOLIDUS:
|
|
777
|
+
this.state = State.SELF_CLOSING_START_TAG;
|
|
778
|
+
break;
|
|
779
|
+
case require_unicode.CODE_POINTS.GREATER_THAN_SIGN:
|
|
780
|
+
this.state = State.DATA;
|
|
781
|
+
this.emitCurrentTagToken();
|
|
782
|
+
break;
|
|
783
|
+
case require_unicode.CODE_POINTS.NULL:
|
|
784
|
+
this._err(require_error_codes.ERR.unexpectedNullCharacter);
|
|
785
|
+
token.tagName += "�";
|
|
786
|
+
break;
|
|
787
|
+
case require_unicode.CODE_POINTS.EOF:
|
|
788
|
+
this._err(require_error_codes.ERR.eofInTag);
|
|
789
|
+
this._emitEOFToken();
|
|
790
|
+
break;
|
|
791
|
+
default: token.tagName += String.fromCodePoint(isAsciiUpper(cp) ? toAsciiLower(cp) : cp);
|
|
792
|
+
}
|
|
793
|
+
}
|
|
794
|
+
_stateRcdataLessThanSign(cp) {
|
|
795
|
+
if (cp === require_unicode.CODE_POINTS.SOLIDUS) this.state = State.RCDATA_END_TAG_OPEN;
|
|
796
|
+
else {
|
|
797
|
+
this._emitChars("<");
|
|
798
|
+
this.state = State.RCDATA;
|
|
799
|
+
this._stateRcdata(cp);
|
|
800
|
+
}
|
|
801
|
+
}
|
|
802
|
+
_stateRcdataEndTagOpen(cp) {
|
|
803
|
+
if (isAsciiLetter(cp)) {
|
|
804
|
+
this.state = State.RCDATA_END_TAG_NAME;
|
|
805
|
+
this._stateRcdataEndTagName(cp);
|
|
806
|
+
} else {
|
|
807
|
+
this._emitChars("</");
|
|
808
|
+
this.state = State.RCDATA;
|
|
809
|
+
this._stateRcdata(cp);
|
|
810
|
+
}
|
|
811
|
+
}
|
|
812
|
+
handleSpecialEndTag(_cp) {
|
|
813
|
+
if (!this.preprocessor.startsWith(this.lastStartTagName, false)) return !this._ensureHibernation();
|
|
814
|
+
this._createEndTagToken();
|
|
815
|
+
const token = this.currentToken;
|
|
816
|
+
token.tagName = this.lastStartTagName;
|
|
817
|
+
switch (this.preprocessor.peek(this.lastStartTagName.length)) {
|
|
818
|
+
case require_unicode.CODE_POINTS.SPACE:
|
|
819
|
+
case require_unicode.CODE_POINTS.LINE_FEED:
|
|
820
|
+
case require_unicode.CODE_POINTS.TABULATION:
|
|
821
|
+
case require_unicode.CODE_POINTS.FORM_FEED:
|
|
822
|
+
this._advanceBy(this.lastStartTagName.length);
|
|
823
|
+
this.state = State.BEFORE_ATTRIBUTE_NAME;
|
|
824
|
+
return false;
|
|
825
|
+
case require_unicode.CODE_POINTS.SOLIDUS:
|
|
826
|
+
this._advanceBy(this.lastStartTagName.length);
|
|
827
|
+
this.state = State.SELF_CLOSING_START_TAG;
|
|
828
|
+
return false;
|
|
829
|
+
case require_unicode.CODE_POINTS.GREATER_THAN_SIGN:
|
|
830
|
+
this._advanceBy(this.lastStartTagName.length);
|
|
831
|
+
this.emitCurrentTagToken();
|
|
832
|
+
this.state = State.DATA;
|
|
833
|
+
return false;
|
|
834
|
+
default: return !this._ensureHibernation();
|
|
835
|
+
}
|
|
836
|
+
}
|
|
837
|
+
_stateRcdataEndTagName(cp) {
|
|
838
|
+
if (this.handleSpecialEndTag(cp)) {
|
|
839
|
+
this._emitChars("</");
|
|
840
|
+
this.state = State.RCDATA;
|
|
841
|
+
this._stateRcdata(cp);
|
|
842
|
+
}
|
|
843
|
+
}
|
|
844
|
+
_stateRawtextLessThanSign(cp) {
|
|
845
|
+
if (cp === require_unicode.CODE_POINTS.SOLIDUS) this.state = State.RAWTEXT_END_TAG_OPEN;
|
|
846
|
+
else {
|
|
847
|
+
this._emitChars("<");
|
|
848
|
+
this.state = State.RAWTEXT;
|
|
849
|
+
this._stateRawtext(cp);
|
|
850
|
+
}
|
|
851
|
+
}
|
|
852
|
+
_stateRawtextEndTagOpen(cp) {
|
|
853
|
+
if (isAsciiLetter(cp)) {
|
|
854
|
+
this.state = State.RAWTEXT_END_TAG_NAME;
|
|
855
|
+
this._stateRawtextEndTagName(cp);
|
|
856
|
+
} else {
|
|
857
|
+
this._emitChars("</");
|
|
858
|
+
this.state = State.RAWTEXT;
|
|
859
|
+
this._stateRawtext(cp);
|
|
860
|
+
}
|
|
861
|
+
}
|
|
862
|
+
_stateRawtextEndTagName(cp) {
|
|
863
|
+
if (this.handleSpecialEndTag(cp)) {
|
|
864
|
+
this._emitChars("</");
|
|
865
|
+
this.state = State.RAWTEXT;
|
|
866
|
+
this._stateRawtext(cp);
|
|
867
|
+
}
|
|
868
|
+
}
|
|
869
|
+
_stateScriptDataLessThanSign(cp) {
|
|
870
|
+
switch (cp) {
|
|
871
|
+
case require_unicode.CODE_POINTS.SOLIDUS:
|
|
872
|
+
this.state = State.SCRIPT_DATA_END_TAG_OPEN;
|
|
873
|
+
break;
|
|
874
|
+
case require_unicode.CODE_POINTS.EXCLAMATION_MARK:
|
|
875
|
+
this.state = State.SCRIPT_DATA_ESCAPE_START;
|
|
876
|
+
this._emitChars("<!");
|
|
877
|
+
break;
|
|
878
|
+
default:
|
|
879
|
+
this._emitChars("<");
|
|
880
|
+
this.state = State.SCRIPT_DATA;
|
|
881
|
+
this._stateScriptData(cp);
|
|
882
|
+
}
|
|
883
|
+
}
|
|
884
|
+
_stateScriptDataEndTagOpen(cp) {
|
|
885
|
+
if (isAsciiLetter(cp)) {
|
|
886
|
+
this.state = State.SCRIPT_DATA_END_TAG_NAME;
|
|
887
|
+
this._stateScriptDataEndTagName(cp);
|
|
888
|
+
} else {
|
|
889
|
+
this._emitChars("</");
|
|
890
|
+
this.state = State.SCRIPT_DATA;
|
|
891
|
+
this._stateScriptData(cp);
|
|
892
|
+
}
|
|
893
|
+
}
|
|
894
|
+
_stateScriptDataEndTagName(cp) {
|
|
895
|
+
if (this.handleSpecialEndTag(cp)) {
|
|
896
|
+
this._emitChars("</");
|
|
897
|
+
this.state = State.SCRIPT_DATA;
|
|
898
|
+
this._stateScriptData(cp);
|
|
899
|
+
}
|
|
900
|
+
}
|
|
901
|
+
_stateScriptDataEscapeStart(cp) {
|
|
902
|
+
if (cp === require_unicode.CODE_POINTS.HYPHEN_MINUS) {
|
|
903
|
+
this.state = State.SCRIPT_DATA_ESCAPE_START_DASH;
|
|
904
|
+
this._emitChars("-");
|
|
905
|
+
} else {
|
|
906
|
+
this.state = State.SCRIPT_DATA;
|
|
907
|
+
this._stateScriptData(cp);
|
|
908
|
+
}
|
|
909
|
+
}
|
|
910
|
+
_stateScriptDataEscapeStartDash(cp) {
|
|
911
|
+
if (cp === require_unicode.CODE_POINTS.HYPHEN_MINUS) {
|
|
912
|
+
this.state = State.SCRIPT_DATA_ESCAPED_DASH_DASH;
|
|
913
|
+
this._emitChars("-");
|
|
914
|
+
} else {
|
|
915
|
+
this.state = State.SCRIPT_DATA;
|
|
916
|
+
this._stateScriptData(cp);
|
|
917
|
+
}
|
|
918
|
+
}
|
|
919
|
+
_stateScriptDataEscaped(cp) {
|
|
920
|
+
switch (cp) {
|
|
921
|
+
case require_unicode.CODE_POINTS.HYPHEN_MINUS:
|
|
922
|
+
this.state = State.SCRIPT_DATA_ESCAPED_DASH;
|
|
923
|
+
this._emitChars("-");
|
|
924
|
+
break;
|
|
925
|
+
case require_unicode.CODE_POINTS.LESS_THAN_SIGN:
|
|
926
|
+
this.state = State.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;
|
|
927
|
+
break;
|
|
928
|
+
case require_unicode.CODE_POINTS.NULL:
|
|
929
|
+
this._err(require_error_codes.ERR.unexpectedNullCharacter);
|
|
930
|
+
this._emitChars("�");
|
|
931
|
+
break;
|
|
932
|
+
case require_unicode.CODE_POINTS.EOF:
|
|
933
|
+
this._err(require_error_codes.ERR.eofInScriptHtmlCommentLikeText);
|
|
934
|
+
this._emitEOFToken();
|
|
935
|
+
break;
|
|
936
|
+
default: this._emitCodePoint(cp);
|
|
937
|
+
}
|
|
938
|
+
}
|
|
939
|
+
_stateScriptDataEscapedDash(cp) {
|
|
940
|
+
switch (cp) {
|
|
941
|
+
case require_unicode.CODE_POINTS.HYPHEN_MINUS:
|
|
942
|
+
this.state = State.SCRIPT_DATA_ESCAPED_DASH_DASH;
|
|
943
|
+
this._emitChars("-");
|
|
944
|
+
break;
|
|
945
|
+
case require_unicode.CODE_POINTS.LESS_THAN_SIGN:
|
|
946
|
+
this.state = State.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;
|
|
947
|
+
break;
|
|
948
|
+
case require_unicode.CODE_POINTS.NULL:
|
|
949
|
+
this._err(require_error_codes.ERR.unexpectedNullCharacter);
|
|
950
|
+
this.state = State.SCRIPT_DATA_ESCAPED;
|
|
951
|
+
this._emitChars("�");
|
|
952
|
+
break;
|
|
953
|
+
case require_unicode.CODE_POINTS.EOF:
|
|
954
|
+
this._err(require_error_codes.ERR.eofInScriptHtmlCommentLikeText);
|
|
955
|
+
this._emitEOFToken();
|
|
956
|
+
break;
|
|
957
|
+
default:
|
|
958
|
+
this.state = State.SCRIPT_DATA_ESCAPED;
|
|
959
|
+
this._emitCodePoint(cp);
|
|
960
|
+
}
|
|
961
|
+
}
|
|
962
|
+
_stateScriptDataEscapedDashDash(cp) {
|
|
963
|
+
switch (cp) {
|
|
964
|
+
case require_unicode.CODE_POINTS.HYPHEN_MINUS:
|
|
965
|
+
this._emitChars("-");
|
|
966
|
+
break;
|
|
967
|
+
case require_unicode.CODE_POINTS.LESS_THAN_SIGN:
|
|
968
|
+
this.state = State.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;
|
|
969
|
+
break;
|
|
970
|
+
case require_unicode.CODE_POINTS.GREATER_THAN_SIGN:
|
|
971
|
+
this.state = State.SCRIPT_DATA;
|
|
972
|
+
this._emitChars(">");
|
|
973
|
+
break;
|
|
974
|
+
case require_unicode.CODE_POINTS.NULL:
|
|
975
|
+
this._err(require_error_codes.ERR.unexpectedNullCharacter);
|
|
976
|
+
this.state = State.SCRIPT_DATA_ESCAPED;
|
|
977
|
+
this._emitChars("�");
|
|
978
|
+
break;
|
|
979
|
+
case require_unicode.CODE_POINTS.EOF:
|
|
980
|
+
this._err(require_error_codes.ERR.eofInScriptHtmlCommentLikeText);
|
|
981
|
+
this._emitEOFToken();
|
|
982
|
+
break;
|
|
983
|
+
default:
|
|
984
|
+
this.state = State.SCRIPT_DATA_ESCAPED;
|
|
985
|
+
this._emitCodePoint(cp);
|
|
986
|
+
}
|
|
987
|
+
}
|
|
988
|
+
_stateScriptDataEscapedLessThanSign(cp) {
|
|
989
|
+
if (cp === require_unicode.CODE_POINTS.SOLIDUS) this.state = State.SCRIPT_DATA_ESCAPED_END_TAG_OPEN;
|
|
990
|
+
else if (isAsciiLetter(cp)) {
|
|
991
|
+
this._emitChars("<");
|
|
992
|
+
this.state = State.SCRIPT_DATA_DOUBLE_ESCAPE_START;
|
|
993
|
+
this._stateScriptDataDoubleEscapeStart(cp);
|
|
994
|
+
} else {
|
|
995
|
+
this._emitChars("<");
|
|
996
|
+
this.state = State.SCRIPT_DATA_ESCAPED;
|
|
997
|
+
this._stateScriptDataEscaped(cp);
|
|
998
|
+
}
|
|
999
|
+
}
|
|
1000
|
+
_stateScriptDataEscapedEndTagOpen(cp) {
|
|
1001
|
+
if (isAsciiLetter(cp)) {
|
|
1002
|
+
this.state = State.SCRIPT_DATA_ESCAPED_END_TAG_NAME;
|
|
1003
|
+
this._stateScriptDataEscapedEndTagName(cp);
|
|
1004
|
+
} else {
|
|
1005
|
+
this._emitChars("</");
|
|
1006
|
+
this.state = State.SCRIPT_DATA_ESCAPED;
|
|
1007
|
+
this._stateScriptDataEscaped(cp);
|
|
1008
|
+
}
|
|
1009
|
+
}
|
|
1010
|
+
_stateScriptDataEscapedEndTagName(cp) {
|
|
1011
|
+
if (this.handleSpecialEndTag(cp)) {
|
|
1012
|
+
this._emitChars("</");
|
|
1013
|
+
this.state = State.SCRIPT_DATA_ESCAPED;
|
|
1014
|
+
this._stateScriptDataEscaped(cp);
|
|
1015
|
+
}
|
|
1016
|
+
}
|
|
1017
|
+
_stateScriptDataDoubleEscapeStart(cp) {
|
|
1018
|
+
if (this.preprocessor.startsWith(require_unicode.SEQUENCES.SCRIPT, false) && isScriptDataDoubleEscapeSequenceEnd(this.preprocessor.peek(require_unicode.SEQUENCES.SCRIPT.length))) {
|
|
1019
|
+
this._emitCodePoint(cp);
|
|
1020
|
+
for (let i = 0; i < require_unicode.SEQUENCES.SCRIPT.length; i++) this._emitCodePoint(this._consume());
|
|
1021
|
+
this.state = State.SCRIPT_DATA_DOUBLE_ESCAPED;
|
|
1022
|
+
} else if (!this._ensureHibernation()) {
|
|
1023
|
+
this.state = State.SCRIPT_DATA_ESCAPED;
|
|
1024
|
+
this._stateScriptDataEscaped(cp);
|
|
1025
|
+
}
|
|
1026
|
+
}
|
|
1027
|
+
_stateScriptDataDoubleEscaped(cp) {
|
|
1028
|
+
switch (cp) {
|
|
1029
|
+
case require_unicode.CODE_POINTS.HYPHEN_MINUS:
|
|
1030
|
+
this.state = State.SCRIPT_DATA_DOUBLE_ESCAPED_DASH;
|
|
1031
|
+
this._emitChars("-");
|
|
1032
|
+
break;
|
|
1033
|
+
case require_unicode.CODE_POINTS.LESS_THAN_SIGN:
|
|
1034
|
+
this.state = State.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN;
|
|
1035
|
+
this._emitChars("<");
|
|
1036
|
+
break;
|
|
1037
|
+
case require_unicode.CODE_POINTS.NULL:
|
|
1038
|
+
this._err(require_error_codes.ERR.unexpectedNullCharacter);
|
|
1039
|
+
this._emitChars("�");
|
|
1040
|
+
break;
|
|
1041
|
+
case require_unicode.CODE_POINTS.EOF:
|
|
1042
|
+
this._err(require_error_codes.ERR.eofInScriptHtmlCommentLikeText);
|
|
1043
|
+
this._emitEOFToken();
|
|
1044
|
+
break;
|
|
1045
|
+
default: this._emitCodePoint(cp);
|
|
1046
|
+
}
|
|
1047
|
+
}
|
|
1048
|
+
_stateScriptDataDoubleEscapedDash(cp) {
|
|
1049
|
+
switch (cp) {
|
|
1050
|
+
case require_unicode.CODE_POINTS.HYPHEN_MINUS:
|
|
1051
|
+
this.state = State.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH;
|
|
1052
|
+
this._emitChars("-");
|
|
1053
|
+
break;
|
|
1054
|
+
case require_unicode.CODE_POINTS.LESS_THAN_SIGN:
|
|
1055
|
+
this.state = State.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN;
|
|
1056
|
+
this._emitChars("<");
|
|
1057
|
+
break;
|
|
1058
|
+
case require_unicode.CODE_POINTS.NULL:
|
|
1059
|
+
this._err(require_error_codes.ERR.unexpectedNullCharacter);
|
|
1060
|
+
this.state = State.SCRIPT_DATA_DOUBLE_ESCAPED;
|
|
1061
|
+
this._emitChars("�");
|
|
1062
|
+
break;
|
|
1063
|
+
case require_unicode.CODE_POINTS.EOF:
|
|
1064
|
+
this._err(require_error_codes.ERR.eofInScriptHtmlCommentLikeText);
|
|
1065
|
+
this._emitEOFToken();
|
|
1066
|
+
break;
|
|
1067
|
+
default:
|
|
1068
|
+
this.state = State.SCRIPT_DATA_DOUBLE_ESCAPED;
|
|
1069
|
+
this._emitCodePoint(cp);
|
|
1070
|
+
}
|
|
1071
|
+
}
|
|
1072
|
+
_stateScriptDataDoubleEscapedDashDash(cp) {
|
|
1073
|
+
switch (cp) {
|
|
1074
|
+
case require_unicode.CODE_POINTS.HYPHEN_MINUS:
|
|
1075
|
+
this._emitChars("-");
|
|
1076
|
+
break;
|
|
1077
|
+
case require_unicode.CODE_POINTS.LESS_THAN_SIGN:
|
|
1078
|
+
this.state = State.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN;
|
|
1079
|
+
this._emitChars("<");
|
|
1080
|
+
break;
|
|
1081
|
+
case require_unicode.CODE_POINTS.GREATER_THAN_SIGN:
|
|
1082
|
+
this.state = State.SCRIPT_DATA;
|
|
1083
|
+
this._emitChars(">");
|
|
1084
|
+
break;
|
|
1085
|
+
case require_unicode.CODE_POINTS.NULL:
|
|
1086
|
+
this._err(require_error_codes.ERR.unexpectedNullCharacter);
|
|
1087
|
+
this.state = State.SCRIPT_DATA_DOUBLE_ESCAPED;
|
|
1088
|
+
this._emitChars("�");
|
|
1089
|
+
break;
|
|
1090
|
+
case require_unicode.CODE_POINTS.EOF:
|
|
1091
|
+
this._err(require_error_codes.ERR.eofInScriptHtmlCommentLikeText);
|
|
1092
|
+
this._emitEOFToken();
|
|
1093
|
+
break;
|
|
1094
|
+
default:
|
|
1095
|
+
this.state = State.SCRIPT_DATA_DOUBLE_ESCAPED;
|
|
1096
|
+
this._emitCodePoint(cp);
|
|
1097
|
+
}
|
|
1098
|
+
}
|
|
1099
|
+
_stateScriptDataDoubleEscapedLessThanSign(cp) {
|
|
1100
|
+
if (cp === require_unicode.CODE_POINTS.SOLIDUS) {
|
|
1101
|
+
this.state = State.SCRIPT_DATA_DOUBLE_ESCAPE_END;
|
|
1102
|
+
this._emitChars("/");
|
|
1103
|
+
} else {
|
|
1104
|
+
this.state = State.SCRIPT_DATA_DOUBLE_ESCAPED;
|
|
1105
|
+
this._stateScriptDataDoubleEscaped(cp);
|
|
1106
|
+
}
|
|
1107
|
+
}
|
|
1108
|
+
_stateScriptDataDoubleEscapeEnd(cp) {
|
|
1109
|
+
if (this.preprocessor.startsWith(require_unicode.SEQUENCES.SCRIPT, false) && isScriptDataDoubleEscapeSequenceEnd(this.preprocessor.peek(require_unicode.SEQUENCES.SCRIPT.length))) {
|
|
1110
|
+
this._emitCodePoint(cp);
|
|
1111
|
+
for (let i = 0; i < require_unicode.SEQUENCES.SCRIPT.length; i++) this._emitCodePoint(this._consume());
|
|
1112
|
+
this.state = State.SCRIPT_DATA_ESCAPED;
|
|
1113
|
+
} else if (!this._ensureHibernation()) {
|
|
1114
|
+
this.state = State.SCRIPT_DATA_DOUBLE_ESCAPED;
|
|
1115
|
+
this._stateScriptDataDoubleEscaped(cp);
|
|
1116
|
+
}
|
|
1117
|
+
}
|
|
1118
|
+
_stateBeforeAttributeName(cp) {
|
|
1119
|
+
switch (cp) {
|
|
1120
|
+
case require_unicode.CODE_POINTS.SPACE:
|
|
1121
|
+
case require_unicode.CODE_POINTS.LINE_FEED:
|
|
1122
|
+
case require_unicode.CODE_POINTS.TABULATION:
|
|
1123
|
+
case require_unicode.CODE_POINTS.FORM_FEED: break;
|
|
1124
|
+
case require_unicode.CODE_POINTS.SOLIDUS:
|
|
1125
|
+
case require_unicode.CODE_POINTS.GREATER_THAN_SIGN:
|
|
1126
|
+
case require_unicode.CODE_POINTS.EOF:
|
|
1127
|
+
this.state = State.AFTER_ATTRIBUTE_NAME;
|
|
1128
|
+
this._stateAfterAttributeName(cp);
|
|
1129
|
+
break;
|
|
1130
|
+
case require_unicode.CODE_POINTS.EQUALS_SIGN:
|
|
1131
|
+
this._err(require_error_codes.ERR.unexpectedEqualsSignBeforeAttributeName);
|
|
1132
|
+
this._createAttr("=");
|
|
1133
|
+
this.state = State.ATTRIBUTE_NAME;
|
|
1134
|
+
break;
|
|
1135
|
+
default:
|
|
1136
|
+
this._createAttr("");
|
|
1137
|
+
this.state = State.ATTRIBUTE_NAME;
|
|
1138
|
+
this._stateAttributeName(cp);
|
|
1139
|
+
}
|
|
1140
|
+
}
|
|
1141
|
+
_stateAttributeName(cp) {
|
|
1142
|
+
switch (cp) {
|
|
1143
|
+
case require_unicode.CODE_POINTS.SPACE:
|
|
1144
|
+
case require_unicode.CODE_POINTS.LINE_FEED:
|
|
1145
|
+
case require_unicode.CODE_POINTS.TABULATION:
|
|
1146
|
+
case require_unicode.CODE_POINTS.FORM_FEED:
|
|
1147
|
+
case require_unicode.CODE_POINTS.SOLIDUS:
|
|
1148
|
+
case require_unicode.CODE_POINTS.GREATER_THAN_SIGN:
|
|
1149
|
+
case require_unicode.CODE_POINTS.EOF:
|
|
1150
|
+
this._leaveAttrName();
|
|
1151
|
+
this.state = State.AFTER_ATTRIBUTE_NAME;
|
|
1152
|
+
this._stateAfterAttributeName(cp);
|
|
1153
|
+
break;
|
|
1154
|
+
case require_unicode.CODE_POINTS.EQUALS_SIGN:
|
|
1155
|
+
this._leaveAttrName();
|
|
1156
|
+
this.state = State.BEFORE_ATTRIBUTE_VALUE;
|
|
1157
|
+
break;
|
|
1158
|
+
case require_unicode.CODE_POINTS.QUOTATION_MARK:
|
|
1159
|
+
case require_unicode.CODE_POINTS.APOSTROPHE:
|
|
1160
|
+
case require_unicode.CODE_POINTS.LESS_THAN_SIGN:
|
|
1161
|
+
this._err(require_error_codes.ERR.unexpectedCharacterInAttributeName);
|
|
1162
|
+
this.currentAttr.name += String.fromCodePoint(cp);
|
|
1163
|
+
break;
|
|
1164
|
+
case require_unicode.CODE_POINTS.NULL:
|
|
1165
|
+
this._err(require_error_codes.ERR.unexpectedNullCharacter);
|
|
1166
|
+
this.currentAttr.name += "�";
|
|
1167
|
+
break;
|
|
1168
|
+
default: this.currentAttr.name += String.fromCodePoint(isAsciiUpper(cp) ? toAsciiLower(cp) : cp);
|
|
1169
|
+
}
|
|
1170
|
+
}
|
|
1171
|
+
_stateAfterAttributeName(cp) {
|
|
1172
|
+
switch (cp) {
|
|
1173
|
+
case require_unicode.CODE_POINTS.SPACE:
|
|
1174
|
+
case require_unicode.CODE_POINTS.LINE_FEED:
|
|
1175
|
+
case require_unicode.CODE_POINTS.TABULATION:
|
|
1176
|
+
case require_unicode.CODE_POINTS.FORM_FEED: break;
|
|
1177
|
+
case require_unicode.CODE_POINTS.SOLIDUS:
|
|
1178
|
+
this.state = State.SELF_CLOSING_START_TAG;
|
|
1179
|
+
break;
|
|
1180
|
+
case require_unicode.CODE_POINTS.EQUALS_SIGN:
|
|
1181
|
+
this.state = State.BEFORE_ATTRIBUTE_VALUE;
|
|
1182
|
+
break;
|
|
1183
|
+
case require_unicode.CODE_POINTS.GREATER_THAN_SIGN:
|
|
1184
|
+
this.state = State.DATA;
|
|
1185
|
+
this.emitCurrentTagToken();
|
|
1186
|
+
break;
|
|
1187
|
+
case require_unicode.CODE_POINTS.EOF:
|
|
1188
|
+
this._err(require_error_codes.ERR.eofInTag);
|
|
1189
|
+
this._emitEOFToken();
|
|
1190
|
+
break;
|
|
1191
|
+
default:
|
|
1192
|
+
this._createAttr("");
|
|
1193
|
+
this.state = State.ATTRIBUTE_NAME;
|
|
1194
|
+
this._stateAttributeName(cp);
|
|
1195
|
+
}
|
|
1196
|
+
}
|
|
1197
|
+
_stateBeforeAttributeValue(cp) {
|
|
1198
|
+
switch (cp) {
|
|
1199
|
+
case require_unicode.CODE_POINTS.SPACE:
|
|
1200
|
+
case require_unicode.CODE_POINTS.LINE_FEED:
|
|
1201
|
+
case require_unicode.CODE_POINTS.TABULATION:
|
|
1202
|
+
case require_unicode.CODE_POINTS.FORM_FEED: break;
|
|
1203
|
+
case require_unicode.CODE_POINTS.QUOTATION_MARK:
|
|
1204
|
+
this.state = State.ATTRIBUTE_VALUE_DOUBLE_QUOTED;
|
|
1205
|
+
break;
|
|
1206
|
+
case require_unicode.CODE_POINTS.APOSTROPHE:
|
|
1207
|
+
this.state = State.ATTRIBUTE_VALUE_SINGLE_QUOTED;
|
|
1208
|
+
break;
|
|
1209
|
+
case require_unicode.CODE_POINTS.GREATER_THAN_SIGN:
|
|
1210
|
+
this._err(require_error_codes.ERR.missingAttributeValue);
|
|
1211
|
+
this.state = State.DATA;
|
|
1212
|
+
this.emitCurrentTagToken();
|
|
1213
|
+
break;
|
|
1214
|
+
default:
|
|
1215
|
+
this.state = State.ATTRIBUTE_VALUE_UNQUOTED;
|
|
1216
|
+
this._stateAttributeValueUnquoted(cp);
|
|
1217
|
+
}
|
|
1218
|
+
}
|
|
1219
|
+
_stateAttributeValueDoubleQuoted(cp) {
|
|
1220
|
+
switch (cp) {
|
|
1221
|
+
case require_unicode.CODE_POINTS.QUOTATION_MARK:
|
|
1222
|
+
this.state = State.AFTER_ATTRIBUTE_VALUE_QUOTED;
|
|
1223
|
+
break;
|
|
1224
|
+
case require_unicode.CODE_POINTS.AMPERSAND:
|
|
1225
|
+
this._startCharacterReference();
|
|
1226
|
+
break;
|
|
1227
|
+
case require_unicode.CODE_POINTS.NULL:
|
|
1228
|
+
this._err(require_error_codes.ERR.unexpectedNullCharacter);
|
|
1229
|
+
this.currentAttr.value += "�";
|
|
1230
|
+
break;
|
|
1231
|
+
case require_unicode.CODE_POINTS.EOF:
|
|
1232
|
+
this._err(require_error_codes.ERR.eofInTag);
|
|
1233
|
+
this._emitEOFToken();
|
|
1234
|
+
break;
|
|
1235
|
+
default: this.currentAttr.value += String.fromCodePoint(cp);
|
|
1236
|
+
}
|
|
1237
|
+
}
|
|
1238
|
+
_stateAttributeValueSingleQuoted(cp) {
|
|
1239
|
+
switch (cp) {
|
|
1240
|
+
case require_unicode.CODE_POINTS.APOSTROPHE:
|
|
1241
|
+
this.state = State.AFTER_ATTRIBUTE_VALUE_QUOTED;
|
|
1242
|
+
break;
|
|
1243
|
+
case require_unicode.CODE_POINTS.AMPERSAND:
|
|
1244
|
+
this._startCharacterReference();
|
|
1245
|
+
break;
|
|
1246
|
+
case require_unicode.CODE_POINTS.NULL:
|
|
1247
|
+
this._err(require_error_codes.ERR.unexpectedNullCharacter);
|
|
1248
|
+
this.currentAttr.value += "�";
|
|
1249
|
+
break;
|
|
1250
|
+
case require_unicode.CODE_POINTS.EOF:
|
|
1251
|
+
this._err(require_error_codes.ERR.eofInTag);
|
|
1252
|
+
this._emitEOFToken();
|
|
1253
|
+
break;
|
|
1254
|
+
default: this.currentAttr.value += String.fromCodePoint(cp);
|
|
1255
|
+
}
|
|
1256
|
+
}
|
|
1257
|
+
_stateAttributeValueUnquoted(cp) {
|
|
1258
|
+
switch (cp) {
|
|
1259
|
+
case require_unicode.CODE_POINTS.SPACE:
|
|
1260
|
+
case require_unicode.CODE_POINTS.LINE_FEED:
|
|
1261
|
+
case require_unicode.CODE_POINTS.TABULATION:
|
|
1262
|
+
case require_unicode.CODE_POINTS.FORM_FEED:
|
|
1263
|
+
this._leaveAttrValue();
|
|
1264
|
+
this.state = State.BEFORE_ATTRIBUTE_NAME;
|
|
1265
|
+
break;
|
|
1266
|
+
case require_unicode.CODE_POINTS.AMPERSAND:
|
|
1267
|
+
this._startCharacterReference();
|
|
1268
|
+
break;
|
|
1269
|
+
case require_unicode.CODE_POINTS.GREATER_THAN_SIGN:
|
|
1270
|
+
this._leaveAttrValue();
|
|
1271
|
+
this.state = State.DATA;
|
|
1272
|
+
this.emitCurrentTagToken();
|
|
1273
|
+
break;
|
|
1274
|
+
case require_unicode.CODE_POINTS.NULL:
|
|
1275
|
+
this._err(require_error_codes.ERR.unexpectedNullCharacter);
|
|
1276
|
+
this.currentAttr.value += "�";
|
|
1277
|
+
break;
|
|
1278
|
+
case require_unicode.CODE_POINTS.QUOTATION_MARK:
|
|
1279
|
+
case require_unicode.CODE_POINTS.APOSTROPHE:
|
|
1280
|
+
case require_unicode.CODE_POINTS.LESS_THAN_SIGN:
|
|
1281
|
+
case require_unicode.CODE_POINTS.EQUALS_SIGN:
|
|
1282
|
+
case require_unicode.CODE_POINTS.GRAVE_ACCENT:
|
|
1283
|
+
this._err(require_error_codes.ERR.unexpectedCharacterInUnquotedAttributeValue);
|
|
1284
|
+
this.currentAttr.value += String.fromCodePoint(cp);
|
|
1285
|
+
break;
|
|
1286
|
+
case require_unicode.CODE_POINTS.EOF:
|
|
1287
|
+
this._err(require_error_codes.ERR.eofInTag);
|
|
1288
|
+
this._emitEOFToken();
|
|
1289
|
+
break;
|
|
1290
|
+
default: this.currentAttr.value += String.fromCodePoint(cp);
|
|
1291
|
+
}
|
|
1292
|
+
}
|
|
1293
|
+
_stateAfterAttributeValueQuoted(cp) {
|
|
1294
|
+
switch (cp) {
|
|
1295
|
+
case require_unicode.CODE_POINTS.SPACE:
|
|
1296
|
+
case require_unicode.CODE_POINTS.LINE_FEED:
|
|
1297
|
+
case require_unicode.CODE_POINTS.TABULATION:
|
|
1298
|
+
case require_unicode.CODE_POINTS.FORM_FEED:
|
|
1299
|
+
this._leaveAttrValue();
|
|
1300
|
+
this.state = State.BEFORE_ATTRIBUTE_NAME;
|
|
1301
|
+
break;
|
|
1302
|
+
case require_unicode.CODE_POINTS.SOLIDUS:
|
|
1303
|
+
this._leaveAttrValue();
|
|
1304
|
+
this.state = State.SELF_CLOSING_START_TAG;
|
|
1305
|
+
break;
|
|
1306
|
+
case require_unicode.CODE_POINTS.GREATER_THAN_SIGN:
|
|
1307
|
+
this._leaveAttrValue();
|
|
1308
|
+
this.state = State.DATA;
|
|
1309
|
+
this.emitCurrentTagToken();
|
|
1310
|
+
break;
|
|
1311
|
+
case require_unicode.CODE_POINTS.EOF:
|
|
1312
|
+
this._err(require_error_codes.ERR.eofInTag);
|
|
1313
|
+
this._emitEOFToken();
|
|
1314
|
+
break;
|
|
1315
|
+
default:
|
|
1316
|
+
this._err(require_error_codes.ERR.missingWhitespaceBetweenAttributes);
|
|
1317
|
+
this.state = State.BEFORE_ATTRIBUTE_NAME;
|
|
1318
|
+
this._stateBeforeAttributeName(cp);
|
|
1319
|
+
}
|
|
1320
|
+
}
|
|
1321
|
+
_stateSelfClosingStartTag(cp) {
|
|
1322
|
+
switch (cp) {
|
|
1323
|
+
case require_unicode.CODE_POINTS.GREATER_THAN_SIGN: {
|
|
1324
|
+
const token = this.currentToken;
|
|
1325
|
+
token.selfClosing = true;
|
|
1326
|
+
this.state = State.DATA;
|
|
1327
|
+
this.emitCurrentTagToken();
|
|
1328
|
+
break;
|
|
1329
|
+
}
|
|
1330
|
+
case require_unicode.CODE_POINTS.EOF:
|
|
1331
|
+
this._err(require_error_codes.ERR.eofInTag);
|
|
1332
|
+
this._emitEOFToken();
|
|
1333
|
+
break;
|
|
1334
|
+
default:
|
|
1335
|
+
this._err(require_error_codes.ERR.unexpectedSolidusInTag);
|
|
1336
|
+
this.state = State.BEFORE_ATTRIBUTE_NAME;
|
|
1337
|
+
this._stateBeforeAttributeName(cp);
|
|
1338
|
+
}
|
|
1339
|
+
}
|
|
1340
|
+
_stateBogusComment(cp) {
|
|
1341
|
+
const token = this.currentToken;
|
|
1342
|
+
switch (cp) {
|
|
1343
|
+
case require_unicode.CODE_POINTS.GREATER_THAN_SIGN:
|
|
1344
|
+
this.state = State.DATA;
|
|
1345
|
+
this.emitCurrentComment(token);
|
|
1346
|
+
break;
|
|
1347
|
+
case require_unicode.CODE_POINTS.EOF:
|
|
1348
|
+
this.emitCurrentComment(token);
|
|
1349
|
+
this._emitEOFToken();
|
|
1350
|
+
break;
|
|
1351
|
+
case require_unicode.CODE_POINTS.NULL:
|
|
1352
|
+
this._err(require_error_codes.ERR.unexpectedNullCharacter);
|
|
1353
|
+
token.data += "�";
|
|
1354
|
+
break;
|
|
1355
|
+
default: token.data += String.fromCodePoint(cp);
|
|
1356
|
+
}
|
|
1357
|
+
}
|
|
1358
|
+
_stateMarkupDeclarationOpen(cp) {
|
|
1359
|
+
if (this._consumeSequenceIfMatch(require_unicode.SEQUENCES.DASH_DASH, true)) {
|
|
1360
|
+
this._createCommentToken(require_unicode.SEQUENCES.DASH_DASH.length + 1);
|
|
1361
|
+
this.state = State.COMMENT_START;
|
|
1362
|
+
} else if (this._consumeSequenceIfMatch(require_unicode.SEQUENCES.DOCTYPE, false)) {
|
|
1363
|
+
this.currentLocation = this.getCurrentLocation(require_unicode.SEQUENCES.DOCTYPE.length + 1);
|
|
1364
|
+
this.state = State.DOCTYPE;
|
|
1365
|
+
} else if (this._consumeSequenceIfMatch(require_unicode.SEQUENCES.CDATA_START, true)) if (this.inForeignNode) this.state = State.CDATA_SECTION;
|
|
1366
|
+
else {
|
|
1367
|
+
this._err(require_error_codes.ERR.cdataInHtmlContent);
|
|
1368
|
+
this._createCommentToken(require_unicode.SEQUENCES.CDATA_START.length + 1);
|
|
1369
|
+
this.currentToken.data = "[CDATA[";
|
|
1370
|
+
this.state = State.BOGUS_COMMENT;
|
|
1371
|
+
}
|
|
1372
|
+
else if (!this._ensureHibernation()) {
|
|
1373
|
+
this._err(require_error_codes.ERR.incorrectlyOpenedComment);
|
|
1374
|
+
this._createCommentToken(2);
|
|
1375
|
+
this.state = State.BOGUS_COMMENT;
|
|
1376
|
+
this._stateBogusComment(cp);
|
|
1377
|
+
}
|
|
1378
|
+
}
|
|
1379
|
+
_stateCommentStart(cp) {
|
|
1380
|
+
switch (cp) {
|
|
1381
|
+
case require_unicode.CODE_POINTS.HYPHEN_MINUS:
|
|
1382
|
+
this.state = State.COMMENT_START_DASH;
|
|
1383
|
+
break;
|
|
1384
|
+
case require_unicode.CODE_POINTS.GREATER_THAN_SIGN: {
|
|
1385
|
+
this._err(require_error_codes.ERR.abruptClosingOfEmptyComment);
|
|
1386
|
+
this.state = State.DATA;
|
|
1387
|
+
const token = this.currentToken;
|
|
1388
|
+
this.emitCurrentComment(token);
|
|
1389
|
+
break;
|
|
1390
|
+
}
|
|
1391
|
+
default:
|
|
1392
|
+
this.state = State.COMMENT;
|
|
1393
|
+
this._stateComment(cp);
|
|
1394
|
+
}
|
|
1395
|
+
}
|
|
1396
|
+
_stateCommentStartDash(cp) {
|
|
1397
|
+
const token = this.currentToken;
|
|
1398
|
+
switch (cp) {
|
|
1399
|
+
case require_unicode.CODE_POINTS.HYPHEN_MINUS:
|
|
1400
|
+
this.state = State.COMMENT_END;
|
|
1401
|
+
break;
|
|
1402
|
+
case require_unicode.CODE_POINTS.GREATER_THAN_SIGN:
|
|
1403
|
+
this._err(require_error_codes.ERR.abruptClosingOfEmptyComment);
|
|
1404
|
+
this.state = State.DATA;
|
|
1405
|
+
this.emitCurrentComment(token);
|
|
1406
|
+
break;
|
|
1407
|
+
case require_unicode.CODE_POINTS.EOF:
|
|
1408
|
+
this._err(require_error_codes.ERR.eofInComment);
|
|
1409
|
+
this.emitCurrentComment(token);
|
|
1410
|
+
this._emitEOFToken();
|
|
1411
|
+
break;
|
|
1412
|
+
default:
|
|
1413
|
+
token.data += "-";
|
|
1414
|
+
this.state = State.COMMENT;
|
|
1415
|
+
this._stateComment(cp);
|
|
1416
|
+
}
|
|
1417
|
+
}
|
|
1418
|
+
_stateComment(cp) {
|
|
1419
|
+
const token = this.currentToken;
|
|
1420
|
+
switch (cp) {
|
|
1421
|
+
case require_unicode.CODE_POINTS.HYPHEN_MINUS:
|
|
1422
|
+
this.state = State.COMMENT_END_DASH;
|
|
1423
|
+
break;
|
|
1424
|
+
case require_unicode.CODE_POINTS.LESS_THAN_SIGN:
|
|
1425
|
+
token.data += "<";
|
|
1426
|
+
this.state = State.COMMENT_LESS_THAN_SIGN;
|
|
1427
|
+
break;
|
|
1428
|
+
case require_unicode.CODE_POINTS.NULL:
|
|
1429
|
+
this._err(require_error_codes.ERR.unexpectedNullCharacter);
|
|
1430
|
+
token.data += "�";
|
|
1431
|
+
break;
|
|
1432
|
+
case require_unicode.CODE_POINTS.EOF:
|
|
1433
|
+
this._err(require_error_codes.ERR.eofInComment);
|
|
1434
|
+
this.emitCurrentComment(token);
|
|
1435
|
+
this._emitEOFToken();
|
|
1436
|
+
break;
|
|
1437
|
+
default: token.data += String.fromCodePoint(cp);
|
|
1438
|
+
}
|
|
1439
|
+
}
|
|
1440
|
+
_stateCommentLessThanSign(cp) {
|
|
1441
|
+
const token = this.currentToken;
|
|
1442
|
+
switch (cp) {
|
|
1443
|
+
case require_unicode.CODE_POINTS.EXCLAMATION_MARK:
|
|
1444
|
+
token.data += "!";
|
|
1445
|
+
this.state = State.COMMENT_LESS_THAN_SIGN_BANG;
|
|
1446
|
+
break;
|
|
1447
|
+
case require_unicode.CODE_POINTS.LESS_THAN_SIGN:
|
|
1448
|
+
token.data += "<";
|
|
1449
|
+
break;
|
|
1450
|
+
default:
|
|
1451
|
+
this.state = State.COMMENT;
|
|
1452
|
+
this._stateComment(cp);
|
|
1453
|
+
}
|
|
1454
|
+
}
|
|
1455
|
+
_stateCommentLessThanSignBang(cp) {
|
|
1456
|
+
if (cp === require_unicode.CODE_POINTS.HYPHEN_MINUS) this.state = State.COMMENT_LESS_THAN_SIGN_BANG_DASH;
|
|
1457
|
+
else {
|
|
1458
|
+
this.state = State.COMMENT;
|
|
1459
|
+
this._stateComment(cp);
|
|
1460
|
+
}
|
|
1461
|
+
}
|
|
1462
|
+
_stateCommentLessThanSignBangDash(cp) {
|
|
1463
|
+
if (cp === require_unicode.CODE_POINTS.HYPHEN_MINUS) this.state = State.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH;
|
|
1464
|
+
else {
|
|
1465
|
+
this.state = State.COMMENT_END_DASH;
|
|
1466
|
+
this._stateCommentEndDash(cp);
|
|
1467
|
+
}
|
|
1468
|
+
}
|
|
1469
|
+
_stateCommentLessThanSignBangDashDash(cp) {
|
|
1470
|
+
if (cp !== require_unicode.CODE_POINTS.GREATER_THAN_SIGN && cp !== require_unicode.CODE_POINTS.EOF) this._err(require_error_codes.ERR.nestedComment);
|
|
1471
|
+
this.state = State.COMMENT_END;
|
|
1472
|
+
this._stateCommentEnd(cp);
|
|
1473
|
+
}
|
|
1474
|
+
_stateCommentEndDash(cp) {
|
|
1475
|
+
const token = this.currentToken;
|
|
1476
|
+
switch (cp) {
|
|
1477
|
+
case require_unicode.CODE_POINTS.HYPHEN_MINUS:
|
|
1478
|
+
this.state = State.COMMENT_END;
|
|
1479
|
+
break;
|
|
1480
|
+
case require_unicode.CODE_POINTS.EOF:
|
|
1481
|
+
this._err(require_error_codes.ERR.eofInComment);
|
|
1482
|
+
this.emitCurrentComment(token);
|
|
1483
|
+
this._emitEOFToken();
|
|
1484
|
+
break;
|
|
1485
|
+
default:
|
|
1486
|
+
token.data += "-";
|
|
1487
|
+
this.state = State.COMMENT;
|
|
1488
|
+
this._stateComment(cp);
|
|
1489
|
+
}
|
|
1490
|
+
}
|
|
1491
|
+
_stateCommentEnd(cp) {
|
|
1492
|
+
const token = this.currentToken;
|
|
1493
|
+
switch (cp) {
|
|
1494
|
+
case require_unicode.CODE_POINTS.GREATER_THAN_SIGN:
|
|
1495
|
+
this.state = State.DATA;
|
|
1496
|
+
this.emitCurrentComment(token);
|
|
1497
|
+
break;
|
|
1498
|
+
case require_unicode.CODE_POINTS.EXCLAMATION_MARK:
|
|
1499
|
+
this.state = State.COMMENT_END_BANG;
|
|
1500
|
+
break;
|
|
1501
|
+
case require_unicode.CODE_POINTS.HYPHEN_MINUS:
|
|
1502
|
+
token.data += "-";
|
|
1503
|
+
break;
|
|
1504
|
+
case require_unicode.CODE_POINTS.EOF:
|
|
1505
|
+
this._err(require_error_codes.ERR.eofInComment);
|
|
1506
|
+
this.emitCurrentComment(token);
|
|
1507
|
+
this._emitEOFToken();
|
|
1508
|
+
break;
|
|
1509
|
+
default:
|
|
1510
|
+
token.data += "--";
|
|
1511
|
+
this.state = State.COMMENT;
|
|
1512
|
+
this._stateComment(cp);
|
|
1513
|
+
}
|
|
1514
|
+
}
|
|
1515
|
+
_stateCommentEndBang(cp) {
|
|
1516
|
+
const token = this.currentToken;
|
|
1517
|
+
switch (cp) {
|
|
1518
|
+
case require_unicode.CODE_POINTS.HYPHEN_MINUS:
|
|
1519
|
+
token.data += "--!";
|
|
1520
|
+
this.state = State.COMMENT_END_DASH;
|
|
1521
|
+
break;
|
|
1522
|
+
case require_unicode.CODE_POINTS.GREATER_THAN_SIGN:
|
|
1523
|
+
this._err(require_error_codes.ERR.incorrectlyClosedComment);
|
|
1524
|
+
this.state = State.DATA;
|
|
1525
|
+
this.emitCurrentComment(token);
|
|
1526
|
+
break;
|
|
1527
|
+
case require_unicode.CODE_POINTS.EOF:
|
|
1528
|
+
this._err(require_error_codes.ERR.eofInComment);
|
|
1529
|
+
this.emitCurrentComment(token);
|
|
1530
|
+
this._emitEOFToken();
|
|
1531
|
+
break;
|
|
1532
|
+
default:
|
|
1533
|
+
token.data += "--!";
|
|
1534
|
+
this.state = State.COMMENT;
|
|
1535
|
+
this._stateComment(cp);
|
|
1536
|
+
}
|
|
1537
|
+
}
|
|
1538
|
+
_stateDoctype(cp) {
|
|
1539
|
+
switch (cp) {
|
|
1540
|
+
case require_unicode.CODE_POINTS.SPACE:
|
|
1541
|
+
case require_unicode.CODE_POINTS.LINE_FEED:
|
|
1542
|
+
case require_unicode.CODE_POINTS.TABULATION:
|
|
1543
|
+
case require_unicode.CODE_POINTS.FORM_FEED:
|
|
1544
|
+
this.state = State.BEFORE_DOCTYPE_NAME;
|
|
1545
|
+
break;
|
|
1546
|
+
case require_unicode.CODE_POINTS.GREATER_THAN_SIGN:
|
|
1547
|
+
this.state = State.BEFORE_DOCTYPE_NAME;
|
|
1548
|
+
this._stateBeforeDoctypeName(cp);
|
|
1549
|
+
break;
|
|
1550
|
+
case require_unicode.CODE_POINTS.EOF: {
|
|
1551
|
+
this._err(require_error_codes.ERR.eofInDoctype);
|
|
1552
|
+
this._createDoctypeToken(null);
|
|
1553
|
+
const token = this.currentToken;
|
|
1554
|
+
token.forceQuirks = true;
|
|
1555
|
+
this.emitCurrentDoctype(token);
|
|
1556
|
+
this._emitEOFToken();
|
|
1557
|
+
break;
|
|
1558
|
+
}
|
|
1559
|
+
default:
|
|
1560
|
+
this._err(require_error_codes.ERR.missingWhitespaceBeforeDoctypeName);
|
|
1561
|
+
this.state = State.BEFORE_DOCTYPE_NAME;
|
|
1562
|
+
this._stateBeforeDoctypeName(cp);
|
|
1563
|
+
}
|
|
1564
|
+
}
|
|
1565
|
+
_stateBeforeDoctypeName(cp) {
|
|
1566
|
+
if (isAsciiUpper(cp)) {
|
|
1567
|
+
this._createDoctypeToken(String.fromCharCode(toAsciiLower(cp)));
|
|
1568
|
+
this.state = State.DOCTYPE_NAME;
|
|
1569
|
+
} else switch (cp) {
|
|
1570
|
+
case require_unicode.CODE_POINTS.SPACE:
|
|
1571
|
+
case require_unicode.CODE_POINTS.LINE_FEED:
|
|
1572
|
+
case require_unicode.CODE_POINTS.TABULATION:
|
|
1573
|
+
case require_unicode.CODE_POINTS.FORM_FEED: break;
|
|
1574
|
+
case require_unicode.CODE_POINTS.NULL:
|
|
1575
|
+
this._err(require_error_codes.ERR.unexpectedNullCharacter);
|
|
1576
|
+
this._createDoctypeToken("�");
|
|
1577
|
+
this.state = State.DOCTYPE_NAME;
|
|
1578
|
+
break;
|
|
1579
|
+
case require_unicode.CODE_POINTS.GREATER_THAN_SIGN: {
|
|
1580
|
+
this._err(require_error_codes.ERR.missingDoctypeName);
|
|
1581
|
+
this._createDoctypeToken(null);
|
|
1582
|
+
const token = this.currentToken;
|
|
1583
|
+
token.forceQuirks = true;
|
|
1584
|
+
this.emitCurrentDoctype(token);
|
|
1585
|
+
this.state = State.DATA;
|
|
1586
|
+
break;
|
|
1587
|
+
}
|
|
1588
|
+
case require_unicode.CODE_POINTS.EOF: {
|
|
1589
|
+
this._err(require_error_codes.ERR.eofInDoctype);
|
|
1590
|
+
this._createDoctypeToken(null);
|
|
1591
|
+
const token = this.currentToken;
|
|
1592
|
+
token.forceQuirks = true;
|
|
1593
|
+
this.emitCurrentDoctype(token);
|
|
1594
|
+
this._emitEOFToken();
|
|
1595
|
+
break;
|
|
1596
|
+
}
|
|
1597
|
+
default:
|
|
1598
|
+
this._createDoctypeToken(String.fromCodePoint(cp));
|
|
1599
|
+
this.state = State.DOCTYPE_NAME;
|
|
1600
|
+
}
|
|
1601
|
+
}
|
|
1602
|
+
_stateDoctypeName(cp) {
|
|
1603
|
+
const token = this.currentToken;
|
|
1604
|
+
switch (cp) {
|
|
1605
|
+
case require_unicode.CODE_POINTS.SPACE:
|
|
1606
|
+
case require_unicode.CODE_POINTS.LINE_FEED:
|
|
1607
|
+
case require_unicode.CODE_POINTS.TABULATION:
|
|
1608
|
+
case require_unicode.CODE_POINTS.FORM_FEED:
|
|
1609
|
+
this.state = State.AFTER_DOCTYPE_NAME;
|
|
1610
|
+
break;
|
|
1611
|
+
case require_unicode.CODE_POINTS.GREATER_THAN_SIGN:
|
|
1612
|
+
this.state = State.DATA;
|
|
1613
|
+
this.emitCurrentDoctype(token);
|
|
1614
|
+
break;
|
|
1615
|
+
case require_unicode.CODE_POINTS.NULL:
|
|
1616
|
+
this._err(require_error_codes.ERR.unexpectedNullCharacter);
|
|
1617
|
+
token.name += "�";
|
|
1618
|
+
break;
|
|
1619
|
+
case require_unicode.CODE_POINTS.EOF:
|
|
1620
|
+
this._err(require_error_codes.ERR.eofInDoctype);
|
|
1621
|
+
token.forceQuirks = true;
|
|
1622
|
+
this.emitCurrentDoctype(token);
|
|
1623
|
+
this._emitEOFToken();
|
|
1624
|
+
break;
|
|
1625
|
+
default: token.name += String.fromCodePoint(isAsciiUpper(cp) ? toAsciiLower(cp) : cp);
|
|
1626
|
+
}
|
|
1627
|
+
}
|
|
1628
|
+
_stateAfterDoctypeName(cp) {
|
|
1629
|
+
const token = this.currentToken;
|
|
1630
|
+
switch (cp) {
|
|
1631
|
+
case require_unicode.CODE_POINTS.SPACE:
|
|
1632
|
+
case require_unicode.CODE_POINTS.LINE_FEED:
|
|
1633
|
+
case require_unicode.CODE_POINTS.TABULATION:
|
|
1634
|
+
case require_unicode.CODE_POINTS.FORM_FEED: break;
|
|
1635
|
+
case require_unicode.CODE_POINTS.GREATER_THAN_SIGN:
|
|
1636
|
+
this.state = State.DATA;
|
|
1637
|
+
this.emitCurrentDoctype(token);
|
|
1638
|
+
break;
|
|
1639
|
+
case require_unicode.CODE_POINTS.EOF:
|
|
1640
|
+
this._err(require_error_codes.ERR.eofInDoctype);
|
|
1641
|
+
token.forceQuirks = true;
|
|
1642
|
+
this.emitCurrentDoctype(token);
|
|
1643
|
+
this._emitEOFToken();
|
|
1644
|
+
break;
|
|
1645
|
+
default: if (this._consumeSequenceIfMatch(require_unicode.SEQUENCES.PUBLIC, false)) this.state = State.AFTER_DOCTYPE_PUBLIC_KEYWORD;
|
|
1646
|
+
else if (this._consumeSequenceIfMatch(require_unicode.SEQUENCES.SYSTEM, false)) this.state = State.AFTER_DOCTYPE_SYSTEM_KEYWORD;
|
|
1647
|
+
else if (!this._ensureHibernation()) {
|
|
1648
|
+
this._err(require_error_codes.ERR.invalidCharacterSequenceAfterDoctypeName);
|
|
1649
|
+
token.forceQuirks = true;
|
|
1650
|
+
this.state = State.BOGUS_DOCTYPE;
|
|
1651
|
+
this._stateBogusDoctype(cp);
|
|
1652
|
+
}
|
|
1653
|
+
}
|
|
1654
|
+
}
|
|
1655
|
+
_stateAfterDoctypePublicKeyword(cp) {
|
|
1656
|
+
const token = this.currentToken;
|
|
1657
|
+
switch (cp) {
|
|
1658
|
+
case require_unicode.CODE_POINTS.SPACE:
|
|
1659
|
+
case require_unicode.CODE_POINTS.LINE_FEED:
|
|
1660
|
+
case require_unicode.CODE_POINTS.TABULATION:
|
|
1661
|
+
case require_unicode.CODE_POINTS.FORM_FEED:
|
|
1662
|
+
this.state = State.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;
|
|
1663
|
+
break;
|
|
1664
|
+
case require_unicode.CODE_POINTS.QUOTATION_MARK:
|
|
1665
|
+
this._err(require_error_codes.ERR.missingWhitespaceAfterDoctypePublicKeyword);
|
|
1666
|
+
token.publicId = "";
|
|
1667
|
+
this.state = State.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;
|
|
1668
|
+
break;
|
|
1669
|
+
case require_unicode.CODE_POINTS.APOSTROPHE:
|
|
1670
|
+
this._err(require_error_codes.ERR.missingWhitespaceAfterDoctypePublicKeyword);
|
|
1671
|
+
token.publicId = "";
|
|
1672
|
+
this.state = State.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;
|
|
1673
|
+
break;
|
|
1674
|
+
case require_unicode.CODE_POINTS.GREATER_THAN_SIGN:
|
|
1675
|
+
this._err(require_error_codes.ERR.missingDoctypePublicIdentifier);
|
|
1676
|
+
token.forceQuirks = true;
|
|
1677
|
+
this.state = State.DATA;
|
|
1678
|
+
this.emitCurrentDoctype(token);
|
|
1679
|
+
break;
|
|
1680
|
+
case require_unicode.CODE_POINTS.EOF:
|
|
1681
|
+
this._err(require_error_codes.ERR.eofInDoctype);
|
|
1682
|
+
token.forceQuirks = true;
|
|
1683
|
+
this.emitCurrentDoctype(token);
|
|
1684
|
+
this._emitEOFToken();
|
|
1685
|
+
break;
|
|
1686
|
+
default:
|
|
1687
|
+
this._err(require_error_codes.ERR.missingQuoteBeforeDoctypePublicIdentifier);
|
|
1688
|
+
token.forceQuirks = true;
|
|
1689
|
+
this.state = State.BOGUS_DOCTYPE;
|
|
1690
|
+
this._stateBogusDoctype(cp);
|
|
1691
|
+
}
|
|
1692
|
+
}
|
|
1693
|
+
_stateBeforeDoctypePublicIdentifier(cp) {
|
|
1694
|
+
const token = this.currentToken;
|
|
1695
|
+
switch (cp) {
|
|
1696
|
+
case require_unicode.CODE_POINTS.SPACE:
|
|
1697
|
+
case require_unicode.CODE_POINTS.LINE_FEED:
|
|
1698
|
+
case require_unicode.CODE_POINTS.TABULATION:
|
|
1699
|
+
case require_unicode.CODE_POINTS.FORM_FEED: break;
|
|
1700
|
+
case require_unicode.CODE_POINTS.QUOTATION_MARK:
|
|
1701
|
+
token.publicId = "";
|
|
1702
|
+
this.state = State.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;
|
|
1703
|
+
break;
|
|
1704
|
+
case require_unicode.CODE_POINTS.APOSTROPHE:
|
|
1705
|
+
token.publicId = "";
|
|
1706
|
+
this.state = State.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;
|
|
1707
|
+
break;
|
|
1708
|
+
case require_unicode.CODE_POINTS.GREATER_THAN_SIGN:
|
|
1709
|
+
this._err(require_error_codes.ERR.missingDoctypePublicIdentifier);
|
|
1710
|
+
token.forceQuirks = true;
|
|
1711
|
+
this.state = State.DATA;
|
|
1712
|
+
this.emitCurrentDoctype(token);
|
|
1713
|
+
break;
|
|
1714
|
+
case require_unicode.CODE_POINTS.EOF:
|
|
1715
|
+
this._err(require_error_codes.ERR.eofInDoctype);
|
|
1716
|
+
token.forceQuirks = true;
|
|
1717
|
+
this.emitCurrentDoctype(token);
|
|
1718
|
+
this._emitEOFToken();
|
|
1719
|
+
break;
|
|
1720
|
+
default:
|
|
1721
|
+
this._err(require_error_codes.ERR.missingQuoteBeforeDoctypePublicIdentifier);
|
|
1722
|
+
token.forceQuirks = true;
|
|
1723
|
+
this.state = State.BOGUS_DOCTYPE;
|
|
1724
|
+
this._stateBogusDoctype(cp);
|
|
1725
|
+
}
|
|
1726
|
+
}
|
|
1727
|
+
_stateDoctypePublicIdentifierDoubleQuoted(cp) {
|
|
1728
|
+
const token = this.currentToken;
|
|
1729
|
+
switch (cp) {
|
|
1730
|
+
case require_unicode.CODE_POINTS.QUOTATION_MARK:
|
|
1731
|
+
this.state = State.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;
|
|
1732
|
+
break;
|
|
1733
|
+
case require_unicode.CODE_POINTS.NULL:
|
|
1734
|
+
this._err(require_error_codes.ERR.unexpectedNullCharacter);
|
|
1735
|
+
token.publicId += "�";
|
|
1736
|
+
break;
|
|
1737
|
+
case require_unicode.CODE_POINTS.GREATER_THAN_SIGN:
|
|
1738
|
+
this._err(require_error_codes.ERR.abruptDoctypePublicIdentifier);
|
|
1739
|
+
token.forceQuirks = true;
|
|
1740
|
+
this.emitCurrentDoctype(token);
|
|
1741
|
+
this.state = State.DATA;
|
|
1742
|
+
break;
|
|
1743
|
+
case require_unicode.CODE_POINTS.EOF:
|
|
1744
|
+
this._err(require_error_codes.ERR.eofInDoctype);
|
|
1745
|
+
token.forceQuirks = true;
|
|
1746
|
+
this.emitCurrentDoctype(token);
|
|
1747
|
+
this._emitEOFToken();
|
|
1748
|
+
break;
|
|
1749
|
+
default: token.publicId += String.fromCodePoint(cp);
|
|
1750
|
+
}
|
|
1751
|
+
}
|
|
1752
|
+
_stateDoctypePublicIdentifierSingleQuoted(cp) {
|
|
1753
|
+
const token = this.currentToken;
|
|
1754
|
+
switch (cp) {
|
|
1755
|
+
case require_unicode.CODE_POINTS.APOSTROPHE:
|
|
1756
|
+
this.state = State.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;
|
|
1757
|
+
break;
|
|
1758
|
+
case require_unicode.CODE_POINTS.NULL:
|
|
1759
|
+
this._err(require_error_codes.ERR.unexpectedNullCharacter);
|
|
1760
|
+
token.publicId += "�";
|
|
1761
|
+
break;
|
|
1762
|
+
case require_unicode.CODE_POINTS.GREATER_THAN_SIGN:
|
|
1763
|
+
this._err(require_error_codes.ERR.abruptDoctypePublicIdentifier);
|
|
1764
|
+
token.forceQuirks = true;
|
|
1765
|
+
this.emitCurrentDoctype(token);
|
|
1766
|
+
this.state = State.DATA;
|
|
1767
|
+
break;
|
|
1768
|
+
case require_unicode.CODE_POINTS.EOF:
|
|
1769
|
+
this._err(require_error_codes.ERR.eofInDoctype);
|
|
1770
|
+
token.forceQuirks = true;
|
|
1771
|
+
this.emitCurrentDoctype(token);
|
|
1772
|
+
this._emitEOFToken();
|
|
1773
|
+
break;
|
|
1774
|
+
default: token.publicId += String.fromCodePoint(cp);
|
|
1775
|
+
}
|
|
1776
|
+
}
|
|
1777
|
+
_stateAfterDoctypePublicIdentifier(cp) {
|
|
1778
|
+
const token = this.currentToken;
|
|
1779
|
+
switch (cp) {
|
|
1780
|
+
case require_unicode.CODE_POINTS.SPACE:
|
|
1781
|
+
case require_unicode.CODE_POINTS.LINE_FEED:
|
|
1782
|
+
case require_unicode.CODE_POINTS.TABULATION:
|
|
1783
|
+
case require_unicode.CODE_POINTS.FORM_FEED:
|
|
1784
|
+
this.state = State.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;
|
|
1785
|
+
break;
|
|
1786
|
+
case require_unicode.CODE_POINTS.GREATER_THAN_SIGN:
|
|
1787
|
+
this.state = State.DATA;
|
|
1788
|
+
this.emitCurrentDoctype(token);
|
|
1789
|
+
break;
|
|
1790
|
+
case require_unicode.CODE_POINTS.QUOTATION_MARK:
|
|
1791
|
+
this._err(require_error_codes.ERR.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers);
|
|
1792
|
+
token.systemId = "";
|
|
1793
|
+
this.state = State.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;
|
|
1794
|
+
break;
|
|
1795
|
+
case require_unicode.CODE_POINTS.APOSTROPHE:
|
|
1796
|
+
this._err(require_error_codes.ERR.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers);
|
|
1797
|
+
token.systemId = "";
|
|
1798
|
+
this.state = State.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;
|
|
1799
|
+
break;
|
|
1800
|
+
case require_unicode.CODE_POINTS.EOF:
|
|
1801
|
+
this._err(require_error_codes.ERR.eofInDoctype);
|
|
1802
|
+
token.forceQuirks = true;
|
|
1803
|
+
this.emitCurrentDoctype(token);
|
|
1804
|
+
this._emitEOFToken();
|
|
1805
|
+
break;
|
|
1806
|
+
default:
|
|
1807
|
+
this._err(require_error_codes.ERR.missingQuoteBeforeDoctypeSystemIdentifier);
|
|
1808
|
+
token.forceQuirks = true;
|
|
1809
|
+
this.state = State.BOGUS_DOCTYPE;
|
|
1810
|
+
this._stateBogusDoctype(cp);
|
|
1811
|
+
}
|
|
1812
|
+
}
|
|
1813
|
+
_stateBetweenDoctypePublicAndSystemIdentifiers(cp) {
|
|
1814
|
+
const token = this.currentToken;
|
|
1815
|
+
switch (cp) {
|
|
1816
|
+
case require_unicode.CODE_POINTS.SPACE:
|
|
1817
|
+
case require_unicode.CODE_POINTS.LINE_FEED:
|
|
1818
|
+
case require_unicode.CODE_POINTS.TABULATION:
|
|
1819
|
+
case require_unicode.CODE_POINTS.FORM_FEED: break;
|
|
1820
|
+
case require_unicode.CODE_POINTS.GREATER_THAN_SIGN:
|
|
1821
|
+
this.emitCurrentDoctype(token);
|
|
1822
|
+
this.state = State.DATA;
|
|
1823
|
+
break;
|
|
1824
|
+
case require_unicode.CODE_POINTS.QUOTATION_MARK:
|
|
1825
|
+
token.systemId = "";
|
|
1826
|
+
this.state = State.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;
|
|
1827
|
+
break;
|
|
1828
|
+
case require_unicode.CODE_POINTS.APOSTROPHE:
|
|
1829
|
+
token.systemId = "";
|
|
1830
|
+
this.state = State.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;
|
|
1831
|
+
break;
|
|
1832
|
+
case require_unicode.CODE_POINTS.EOF:
|
|
1833
|
+
this._err(require_error_codes.ERR.eofInDoctype);
|
|
1834
|
+
token.forceQuirks = true;
|
|
1835
|
+
this.emitCurrentDoctype(token);
|
|
1836
|
+
this._emitEOFToken();
|
|
1837
|
+
break;
|
|
1838
|
+
default:
|
|
1839
|
+
this._err(require_error_codes.ERR.missingQuoteBeforeDoctypeSystemIdentifier);
|
|
1840
|
+
token.forceQuirks = true;
|
|
1841
|
+
this.state = State.BOGUS_DOCTYPE;
|
|
1842
|
+
this._stateBogusDoctype(cp);
|
|
1843
|
+
}
|
|
1844
|
+
}
|
|
1845
|
+
_stateAfterDoctypeSystemKeyword(cp) {
|
|
1846
|
+
const token = this.currentToken;
|
|
1847
|
+
switch (cp) {
|
|
1848
|
+
case require_unicode.CODE_POINTS.SPACE:
|
|
1849
|
+
case require_unicode.CODE_POINTS.LINE_FEED:
|
|
1850
|
+
case require_unicode.CODE_POINTS.TABULATION:
|
|
1851
|
+
case require_unicode.CODE_POINTS.FORM_FEED:
|
|
1852
|
+
this.state = State.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;
|
|
1853
|
+
break;
|
|
1854
|
+
case require_unicode.CODE_POINTS.QUOTATION_MARK:
|
|
1855
|
+
this._err(require_error_codes.ERR.missingWhitespaceAfterDoctypeSystemKeyword);
|
|
1856
|
+
token.systemId = "";
|
|
1857
|
+
this.state = State.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;
|
|
1858
|
+
break;
|
|
1859
|
+
case require_unicode.CODE_POINTS.APOSTROPHE:
|
|
1860
|
+
this._err(require_error_codes.ERR.missingWhitespaceAfterDoctypeSystemKeyword);
|
|
1861
|
+
token.systemId = "";
|
|
1862
|
+
this.state = State.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;
|
|
1863
|
+
break;
|
|
1864
|
+
case require_unicode.CODE_POINTS.GREATER_THAN_SIGN:
|
|
1865
|
+
this._err(require_error_codes.ERR.missingDoctypeSystemIdentifier);
|
|
1866
|
+
token.forceQuirks = true;
|
|
1867
|
+
this.state = State.DATA;
|
|
1868
|
+
this.emitCurrentDoctype(token);
|
|
1869
|
+
break;
|
|
1870
|
+
case require_unicode.CODE_POINTS.EOF:
|
|
1871
|
+
this._err(require_error_codes.ERR.eofInDoctype);
|
|
1872
|
+
token.forceQuirks = true;
|
|
1873
|
+
this.emitCurrentDoctype(token);
|
|
1874
|
+
this._emitEOFToken();
|
|
1875
|
+
break;
|
|
1876
|
+
default:
|
|
1877
|
+
this._err(require_error_codes.ERR.missingQuoteBeforeDoctypeSystemIdentifier);
|
|
1878
|
+
token.forceQuirks = true;
|
|
1879
|
+
this.state = State.BOGUS_DOCTYPE;
|
|
1880
|
+
this._stateBogusDoctype(cp);
|
|
1881
|
+
}
|
|
1882
|
+
}
|
|
1883
|
+
_stateBeforeDoctypeSystemIdentifier(cp) {
|
|
1884
|
+
const token = this.currentToken;
|
|
1885
|
+
switch (cp) {
|
|
1886
|
+
case require_unicode.CODE_POINTS.SPACE:
|
|
1887
|
+
case require_unicode.CODE_POINTS.LINE_FEED:
|
|
1888
|
+
case require_unicode.CODE_POINTS.TABULATION:
|
|
1889
|
+
case require_unicode.CODE_POINTS.FORM_FEED: break;
|
|
1890
|
+
case require_unicode.CODE_POINTS.QUOTATION_MARK:
|
|
1891
|
+
token.systemId = "";
|
|
1892
|
+
this.state = State.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;
|
|
1893
|
+
break;
|
|
1894
|
+
case require_unicode.CODE_POINTS.APOSTROPHE:
|
|
1895
|
+
token.systemId = "";
|
|
1896
|
+
this.state = State.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;
|
|
1897
|
+
break;
|
|
1898
|
+
case require_unicode.CODE_POINTS.GREATER_THAN_SIGN:
|
|
1899
|
+
this._err(require_error_codes.ERR.missingDoctypeSystemIdentifier);
|
|
1900
|
+
token.forceQuirks = true;
|
|
1901
|
+
this.state = State.DATA;
|
|
1902
|
+
this.emitCurrentDoctype(token);
|
|
1903
|
+
break;
|
|
1904
|
+
case require_unicode.CODE_POINTS.EOF:
|
|
1905
|
+
this._err(require_error_codes.ERR.eofInDoctype);
|
|
1906
|
+
token.forceQuirks = true;
|
|
1907
|
+
this.emitCurrentDoctype(token);
|
|
1908
|
+
this._emitEOFToken();
|
|
1909
|
+
break;
|
|
1910
|
+
default:
|
|
1911
|
+
this._err(require_error_codes.ERR.missingQuoteBeforeDoctypeSystemIdentifier);
|
|
1912
|
+
token.forceQuirks = true;
|
|
1913
|
+
this.state = State.BOGUS_DOCTYPE;
|
|
1914
|
+
this._stateBogusDoctype(cp);
|
|
1915
|
+
}
|
|
1916
|
+
}
|
|
1917
|
+
_stateDoctypeSystemIdentifierDoubleQuoted(cp) {
|
|
1918
|
+
const token = this.currentToken;
|
|
1919
|
+
switch (cp) {
|
|
1920
|
+
case require_unicode.CODE_POINTS.QUOTATION_MARK:
|
|
1921
|
+
this.state = State.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;
|
|
1922
|
+
break;
|
|
1923
|
+
case require_unicode.CODE_POINTS.NULL:
|
|
1924
|
+
this._err(require_error_codes.ERR.unexpectedNullCharacter);
|
|
1925
|
+
token.systemId += "�";
|
|
1926
|
+
break;
|
|
1927
|
+
case require_unicode.CODE_POINTS.GREATER_THAN_SIGN:
|
|
1928
|
+
this._err(require_error_codes.ERR.abruptDoctypeSystemIdentifier);
|
|
1929
|
+
token.forceQuirks = true;
|
|
1930
|
+
this.emitCurrentDoctype(token);
|
|
1931
|
+
this.state = State.DATA;
|
|
1932
|
+
break;
|
|
1933
|
+
case require_unicode.CODE_POINTS.EOF:
|
|
1934
|
+
this._err(require_error_codes.ERR.eofInDoctype);
|
|
1935
|
+
token.forceQuirks = true;
|
|
1936
|
+
this.emitCurrentDoctype(token);
|
|
1937
|
+
this._emitEOFToken();
|
|
1938
|
+
break;
|
|
1939
|
+
default: token.systemId += String.fromCodePoint(cp);
|
|
1940
|
+
}
|
|
1941
|
+
}
|
|
1942
|
+
_stateDoctypeSystemIdentifierSingleQuoted(cp) {
|
|
1943
|
+
const token = this.currentToken;
|
|
1944
|
+
switch (cp) {
|
|
1945
|
+
case require_unicode.CODE_POINTS.APOSTROPHE:
|
|
1946
|
+
this.state = State.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;
|
|
1947
|
+
break;
|
|
1948
|
+
case require_unicode.CODE_POINTS.NULL:
|
|
1949
|
+
this._err(require_error_codes.ERR.unexpectedNullCharacter);
|
|
1950
|
+
token.systemId += "�";
|
|
1951
|
+
break;
|
|
1952
|
+
case require_unicode.CODE_POINTS.GREATER_THAN_SIGN:
|
|
1953
|
+
this._err(require_error_codes.ERR.abruptDoctypeSystemIdentifier);
|
|
1954
|
+
token.forceQuirks = true;
|
|
1955
|
+
this.emitCurrentDoctype(token);
|
|
1956
|
+
this.state = State.DATA;
|
|
1957
|
+
break;
|
|
1958
|
+
case require_unicode.CODE_POINTS.EOF:
|
|
1959
|
+
this._err(require_error_codes.ERR.eofInDoctype);
|
|
1960
|
+
token.forceQuirks = true;
|
|
1961
|
+
this.emitCurrentDoctype(token);
|
|
1962
|
+
this._emitEOFToken();
|
|
1963
|
+
break;
|
|
1964
|
+
default: token.systemId += String.fromCodePoint(cp);
|
|
1965
|
+
}
|
|
1966
|
+
}
|
|
1967
|
+
_stateAfterDoctypeSystemIdentifier(cp) {
|
|
1968
|
+
const token = this.currentToken;
|
|
1969
|
+
switch (cp) {
|
|
1970
|
+
case require_unicode.CODE_POINTS.SPACE:
|
|
1971
|
+
case require_unicode.CODE_POINTS.LINE_FEED:
|
|
1972
|
+
case require_unicode.CODE_POINTS.TABULATION:
|
|
1973
|
+
case require_unicode.CODE_POINTS.FORM_FEED: break;
|
|
1974
|
+
case require_unicode.CODE_POINTS.GREATER_THAN_SIGN:
|
|
1975
|
+
this.emitCurrentDoctype(token);
|
|
1976
|
+
this.state = State.DATA;
|
|
1977
|
+
break;
|
|
1978
|
+
case require_unicode.CODE_POINTS.EOF:
|
|
1979
|
+
this._err(require_error_codes.ERR.eofInDoctype);
|
|
1980
|
+
token.forceQuirks = true;
|
|
1981
|
+
this.emitCurrentDoctype(token);
|
|
1982
|
+
this._emitEOFToken();
|
|
1983
|
+
break;
|
|
1984
|
+
default:
|
|
1985
|
+
this._err(require_error_codes.ERR.unexpectedCharacterAfterDoctypeSystemIdentifier);
|
|
1986
|
+
this.state = State.BOGUS_DOCTYPE;
|
|
1987
|
+
this._stateBogusDoctype(cp);
|
|
1988
|
+
}
|
|
1989
|
+
}
|
|
1990
|
+
_stateBogusDoctype(cp) {
|
|
1991
|
+
const token = this.currentToken;
|
|
1992
|
+
switch (cp) {
|
|
1993
|
+
case require_unicode.CODE_POINTS.GREATER_THAN_SIGN:
|
|
1994
|
+
this.emitCurrentDoctype(token);
|
|
1995
|
+
this.state = State.DATA;
|
|
1996
|
+
break;
|
|
1997
|
+
case require_unicode.CODE_POINTS.NULL:
|
|
1998
|
+
this._err(require_error_codes.ERR.unexpectedNullCharacter);
|
|
1999
|
+
break;
|
|
2000
|
+
case require_unicode.CODE_POINTS.EOF:
|
|
2001
|
+
this.emitCurrentDoctype(token);
|
|
2002
|
+
this._emitEOFToken();
|
|
2003
|
+
break;
|
|
2004
|
+
default:
|
|
2005
|
+
}
|
|
2006
|
+
}
|
|
2007
|
+
_stateCdataSection(cp) {
|
|
2008
|
+
switch (cp) {
|
|
2009
|
+
case require_unicode.CODE_POINTS.RIGHT_SQUARE_BRACKET:
|
|
2010
|
+
this.state = State.CDATA_SECTION_BRACKET;
|
|
2011
|
+
break;
|
|
2012
|
+
case require_unicode.CODE_POINTS.EOF:
|
|
2013
|
+
this._err(require_error_codes.ERR.eofInCdata);
|
|
2014
|
+
this._emitEOFToken();
|
|
2015
|
+
break;
|
|
2016
|
+
default: this._emitCodePoint(cp);
|
|
2017
|
+
}
|
|
2018
|
+
}
|
|
2019
|
+
_stateCdataSectionBracket(cp) {
|
|
2020
|
+
if (cp === require_unicode.CODE_POINTS.RIGHT_SQUARE_BRACKET) this.state = State.CDATA_SECTION_END;
|
|
2021
|
+
else {
|
|
2022
|
+
this._emitChars("]");
|
|
2023
|
+
this.state = State.CDATA_SECTION;
|
|
2024
|
+
this._stateCdataSection(cp);
|
|
2025
|
+
}
|
|
2026
|
+
}
|
|
2027
|
+
_stateCdataSectionEnd(cp) {
|
|
2028
|
+
switch (cp) {
|
|
2029
|
+
case require_unicode.CODE_POINTS.GREATER_THAN_SIGN:
|
|
2030
|
+
this.state = State.DATA;
|
|
2031
|
+
break;
|
|
2032
|
+
case require_unicode.CODE_POINTS.RIGHT_SQUARE_BRACKET:
|
|
2033
|
+
this._emitChars("]");
|
|
2034
|
+
break;
|
|
2035
|
+
default:
|
|
2036
|
+
this._emitChars("]]");
|
|
2037
|
+
this.state = State.CDATA_SECTION;
|
|
2038
|
+
this._stateCdataSection(cp);
|
|
2039
|
+
}
|
|
2040
|
+
}
|
|
2041
|
+
_stateCharacterReference() {
|
|
2042
|
+
let length = this.entityDecoder.write(this.preprocessor.html, this.preprocessor.pos);
|
|
2043
|
+
if (length < 0) if (this.preprocessor.lastChunkWritten) length = this.entityDecoder.end();
|
|
2044
|
+
else {
|
|
2045
|
+
this.active = false;
|
|
2046
|
+
this.preprocessor.pos = this.preprocessor.html.length - 1;
|
|
2047
|
+
this.consumedAfterSnapshot = 0;
|
|
2048
|
+
this.preprocessor.endOfChunkHit = true;
|
|
2049
|
+
return;
|
|
2050
|
+
}
|
|
2051
|
+
if (length === 0) {
|
|
2052
|
+
this.preprocessor.pos = this.entityStartPos;
|
|
2053
|
+
this._flushCodePointConsumedAsCharacterReference(require_unicode.CODE_POINTS.AMPERSAND);
|
|
2054
|
+
this.state = !this._isCharacterReferenceInAttribute() && isAsciiAlphaNumeric(this.preprocessor.peek(1)) ? State.AMBIGUOUS_AMPERSAND : this.returnState;
|
|
2055
|
+
} else this.state = this.returnState;
|
|
2056
|
+
}
|
|
2057
|
+
_stateAmbiguousAmpersand(cp) {
|
|
2058
|
+
if (isAsciiAlphaNumeric(cp)) this._flushCodePointConsumedAsCharacterReference(cp);
|
|
2059
|
+
else {
|
|
2060
|
+
if (cp === require_unicode.CODE_POINTS.SEMICOLON) this._err(require_error_codes.ERR.unknownNamedCharacterReference);
|
|
2061
|
+
this.state = this.returnState;
|
|
2062
|
+
this._callState(cp);
|
|
2063
|
+
}
|
|
2064
|
+
}
|
|
2065
|
+
};
|
|
2066
|
+
|
|
2067
|
+
//#endregion
|
|
2068
|
+
exports.Tokenizer = Tokenizer;
|
|
2069
|
+
exports.TokenizerMode = TokenizerMode;
|