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