groove-dev 0.15.1 → 0.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/FILE-EDITOR-PLAN.md +253 -0
- package/node_modules/@codemirror/autocomplete/.github/workflows/dispatch.yml +16 -0
- package/node_modules/@codemirror/autocomplete/CHANGELOG.md +639 -0
- package/node_modules/@codemirror/autocomplete/LICENSE +21 -0
- package/node_modules/@codemirror/autocomplete/README.md +43 -0
- package/node_modules/@codemirror/autocomplete/dist/index.cjs +2151 -0
- package/node_modules/@codemirror/autocomplete/dist/index.d.cts +648 -0
- package/node_modules/@codemirror/autocomplete/dist/index.d.ts +648 -0
- package/node_modules/@codemirror/autocomplete/dist/index.js +2120 -0
- package/node_modules/@codemirror/autocomplete/package.json +41 -0
- package/node_modules/@codemirror/commands/.github/workflows/dispatch.yml +16 -0
- package/node_modules/@codemirror/commands/CHANGELOG.md +386 -0
- package/node_modules/@codemirror/commands/LICENSE +21 -0
- package/node_modules/@codemirror/commands/README.md +35 -0
- package/node_modules/@codemirror/commands/dist/index.cjs +1909 -0
- package/node_modules/@codemirror/commands/dist/index.d.cts +650 -0
- package/node_modules/@codemirror/commands/dist/index.d.ts +650 -0
- package/node_modules/@codemirror/commands/dist/index.js +1795 -0
- package/node_modules/@codemirror/commands/package.json +42 -0
- package/node_modules/@codemirror/lang-css/.github/workflows/dispatch.yml +16 -0
- package/node_modules/@codemirror/lang-css/CHANGELOG.md +106 -0
- package/node_modules/@codemirror/lang-css/LICENSE +21 -0
- package/node_modules/@codemirror/lang-css/README.md +50 -0
- package/node_modules/@codemirror/lang-css/dist/index.cjs +269 -0
- package/node_modules/@codemirror/lang-css/dist/index.d.cts +28 -0
- package/node_modules/@codemirror/lang-css/dist/index.d.ts +28 -0
- package/node_modules/@codemirror/lang-css/dist/index.js +264 -0
- package/node_modules/@codemirror/lang-css/package.json +42 -0
- package/node_modules/@codemirror/lang-html/.github/workflows/dispatch.yml +16 -0
- package/node_modules/@codemirror/lang-html/CHANGELOG.md +210 -0
- package/node_modules/@codemirror/lang-html/LICENSE +21 -0
- package/node_modules/@codemirror/lang-html/README.md +147 -0
- package/node_modules/@codemirror/lang-html/dist/index.cjs +667 -0
- package/node_modules/@codemirror/lang-html/dist/index.d.cts +115 -0
- package/node_modules/@codemirror/lang-html/dist/index.d.ts +115 -0
- package/node_modules/@codemirror/lang-html/dist/index.js +661 -0
- package/node_modules/@codemirror/lang-html/package.json +46 -0
- package/node_modules/@codemirror/lang-javascript/.github/workflows/dispatch.yml +16 -0
- package/node_modules/@codemirror/lang-javascript/CHANGELOG.md +206 -0
- package/node_modules/@codemirror/lang-javascript/LICENSE +21 -0
- package/node_modules/@codemirror/lang-javascript/README.md +125 -0
- package/node_modules/@codemirror/lang-javascript/dist/index.cjs +526 -0
- package/node_modules/@codemirror/lang-javascript/dist/index.d.cts +93 -0
- package/node_modules/@codemirror/lang-javascript/dist/index.d.ts +93 -0
- package/node_modules/@codemirror/lang-javascript/dist/index.js +513 -0
- package/node_modules/@codemirror/lang-javascript/package.json +45 -0
- package/node_modules/@codemirror/lang-json/.github/workflows/dispatch.yml +16 -0
- package/node_modules/@codemirror/lang-json/CHANGELOG.md +59 -0
- package/node_modules/@codemirror/lang-json/LICENSE +21 -0
- package/node_modules/@codemirror/lang-json/README.md +56 -0
- package/node_modules/@codemirror/lang-json/dist/index.cjs +68 -0
- package/node_modules/@codemirror/lang-json/dist/index.d.cts +22 -0
- package/node_modules/@codemirror/lang-json/dist/index.d.ts +22 -0
- package/node_modules/@codemirror/lang-json/dist/index.js +64 -0
- package/node_modules/@codemirror/lang-json/package.json +39 -0
- package/node_modules/@codemirror/lang-markdown/.github/workflows/dispatch.yml +16 -0
- package/node_modules/@codemirror/lang-markdown/CHANGELOG.md +246 -0
- package/node_modules/@codemirror/lang-markdown/LICENSE +21 -0
- package/node_modules/@codemirror/lang-markdown/README.md +162 -0
- package/node_modules/@codemirror/lang-markdown/dist/index.cjs +501 -0
- package/node_modules/@codemirror/lang-markdown/dist/index.d.cts +124 -0
- package/node_modules/@codemirror/lang-markdown/dist/index.d.ts +124 -0
- package/node_modules/@codemirror/lang-markdown/dist/index.js +492 -0
- package/node_modules/@codemirror/lang-markdown/package.json +44 -0
- package/node_modules/@codemirror/lang-python/.github/workflows/dispatch.yml +16 -0
- package/node_modules/@codemirror/lang-python/CHANGELOG.md +174 -0
- package/node_modules/@codemirror/lang-python/LICENSE +21 -0
- package/node_modules/@codemirror/lang-python/README.md +61 -0
- package/node_modules/@codemirror/lang-python/dist/index.cjs +313 -0
- package/node_modules/@codemirror/lang-python/dist/index.d.cts +26 -0
- package/node_modules/@codemirror/lang-python/dist/index.d.ts +26 -0
- package/node_modules/@codemirror/lang-python/dist/index.js +308 -0
- package/node_modules/@codemirror/lang-python/package.json +42 -0
- package/node_modules/@codemirror/language/.github/workflows/dispatch.yml +16 -0
- package/node_modules/@codemirror/language/CHANGELOG.md +412 -0
- package/node_modules/@codemirror/language/LICENSE +21 -0
- package/node_modules/@codemirror/language/README.md +66 -0
- package/node_modules/@codemirror/language/dist/index.cjs +2742 -0
- package/node_modules/@codemirror/language/dist/index.d.cts +1220 -0
- package/node_modules/@codemirror/language/dist/index.d.ts +1220 -0
- package/node_modules/@codemirror/language/dist/index.js +2687 -0
- package/node_modules/@codemirror/language/package.json +44 -0
- package/node_modules/@codemirror/lint/.github/workflows/dispatch.yml +16 -0
- package/node_modules/@codemirror/lint/CHANGELOG.md +318 -0
- package/node_modules/@codemirror/lint/LICENSE +21 -0
- package/node_modules/@codemirror/lint/README.md +18 -0
- package/node_modules/@codemirror/lint/dist/index.cjs +958 -0
- package/node_modules/@codemirror/lint/dist/index.d.cts +195 -0
- package/node_modules/@codemirror/lint/dist/index.d.ts +195 -0
- package/node_modules/@codemirror/lint/dist/index.js +945 -0
- package/node_modules/@codemirror/lint/package.json +40 -0
- package/node_modules/@codemirror/search/.github/workflows/dispatch.yml +16 -0
- package/node_modules/@codemirror/search/CHANGELOG.md +324 -0
- package/node_modules/@codemirror/search/LICENSE +21 -0
- package/node_modules/@codemirror/search/README.md +18 -0
- package/node_modules/@codemirror/search/dist/index.cjs +1237 -0
- package/node_modules/@codemirror/search/dist/index.d.cts +385 -0
- package/node_modules/@codemirror/search/dist/index.d.ts +385 -0
- package/node_modules/@codemirror/search/dist/index.js +1217 -0
- package/node_modules/@codemirror/search/package.json +40 -0
- package/node_modules/@codemirror/state/.github/workflows/dispatch.yml +16 -0
- package/node_modules/@codemirror/state/CHANGELOG.md +308 -0
- package/node_modules/@codemirror/state/LICENSE +21 -0
- package/node_modules/@codemirror/state/README.md +18 -0
- package/node_modules/@codemirror/state/dist/index.cjs +3922 -0
- package/node_modules/@codemirror/state/dist/index.d.cts +1713 -0
- package/node_modules/@codemirror/state/dist/index.d.ts +1713 -0
- package/node_modules/@codemirror/state/dist/index.js +3892 -0
- package/node_modules/@codemirror/state/package.json +38 -0
- package/node_modules/@codemirror/theme-one-dark/.github/workflows/dispatch.yml +16 -0
- package/node_modules/@codemirror/theme-one-dark/CHANGELOG.md +97 -0
- package/node_modules/@codemirror/theme-one-dark/LICENSE +21 -0
- package/node_modules/@codemirror/theme-one-dark/README.md +46 -0
- package/node_modules/@codemirror/theme-one-dark/dist/index.cjs +139 -0
- package/node_modules/@codemirror/theme-one-dark/dist/index.d.cts +39 -0
- package/node_modules/@codemirror/theme-one-dark/dist/index.d.ts +39 -0
- package/node_modules/@codemirror/theme-one-dark/dist/index.js +134 -0
- package/node_modules/@codemirror/theme-one-dark/package.json +41 -0
- package/node_modules/@codemirror/view/.github/workflows/dispatch.yml +16 -0
- package/node_modules/@codemirror/view/CHANGELOG.md +2284 -0
- package/node_modules/@codemirror/view/LICENSE +21 -0
- package/node_modules/@codemirror/view/README.md +37 -0
- package/node_modules/@codemirror/view/dist/index.cjs +11796 -0
- package/node_modules/@codemirror/view/dist/index.d.cts +2389 -0
- package/node_modules/@codemirror/view/dist/index.d.ts +2389 -0
- package/node_modules/@codemirror/view/dist/index.js +11745 -0
- package/node_modules/@codemirror/view/package.json +41 -0
- package/node_modules/@groove-dev/daemon/src/api.js +147 -2
- package/node_modules/@groove-dev/daemon/src/filewatcher.js +59 -0
- package/node_modules/@groove-dev/daemon/src/index.js +28 -1
- package/node_modules/@groove-dev/gui/dist/assets/index-Dxg9hdf3.js +103 -0
- package/node_modules/@groove-dev/gui/dist/index.html +1 -1
- package/node_modules/@groove-dev/gui/package.json +15 -2
- package/node_modules/@groove-dev/gui/src/App.jsx +3 -0
- package/node_modules/@groove-dev/gui/src/components/CodeEditor.jsx +143 -0
- package/node_modules/@groove-dev/gui/src/components/EditorTabs.jsx +83 -0
- package/node_modules/@groove-dev/gui/src/components/FileTree.jsx +193 -0
- package/node_modules/@groove-dev/gui/src/stores/groove.js +158 -1
- package/node_modules/@groove-dev/gui/src/views/FileEditor.jsx +142 -0
- package/node_modules/@lezer/common/LICENSE +21 -0
- package/node_modules/@lezer/common/README.md +14 -0
- package/node_modules/@lezer/common/dist/index.cjs +2209 -0
- package/node_modules/@lezer/common/dist/index.d.cts +1174 -0
- package/node_modules/@lezer/common/dist/index.d.ts +1174 -0
- package/node_modules/@lezer/common/dist/index.js +2196 -0
- package/node_modules/@lezer/common/package.json +32 -0
- package/node_modules/@lezer/css/CHANGELOG.md +307 -0
- package/node_modules/@lezer/css/LICENSE +21 -0
- package/node_modules/@lezer/css/README.md +6 -0
- package/node_modules/@lezer/css/dist/index.cjs +151 -0
- package/node_modules/@lezer/css/dist/index.d.cts +3 -0
- package/node_modules/@lezer/css/dist/index.d.ts +3 -0
- package/node_modules/@lezer/css/dist/index.js +147 -0
- package/node_modules/@lezer/css/package.json +36 -0
- package/node_modules/@lezer/css/rollup.config.js +16 -0
- package/node_modules/@lezer/css/src/css.grammar +290 -0
- package/node_modules/@lezer/css/src/highlight.js +36 -0
- package/node_modules/@lezer/css/src/parser.js +31 -0
- package/node_modules/@lezer/css/src/parser.terms.js +63 -0
- package/node_modules/@lezer/css/src/tokens.js +75 -0
- package/node_modules/@lezer/css/test/declarations.txt +241 -0
- package/node_modules/@lezer/css/test/selector.txt +178 -0
- package/node_modules/@lezer/css/test/statements.txt +227 -0
- package/node_modules/@lezer/css/test/test-css.js +16 -0
- package/node_modules/@lezer/highlight/LICENSE +21 -0
- package/node_modules/@lezer/highlight/README.md +14 -0
- package/node_modules/@lezer/highlight/dist/index.cjs +936 -0
- package/node_modules/@lezer/highlight/dist/index.d.cts +623 -0
- package/node_modules/@lezer/highlight/dist/index.d.ts +623 -0
- package/node_modules/@lezer/highlight/dist/index.js +927 -0
- package/node_modules/@lezer/highlight/package.json +31 -0
- package/node_modules/@lezer/html/CHANGELOG.md +303 -0
- package/node_modules/@lezer/html/LICENSE +21 -0
- package/node_modules/@lezer/html/README.md +37 -0
- package/node_modules/@lezer/html/dist/index.cjs +354 -0
- package/node_modules/@lezer/html/dist/index.d.cts +14 -0
- package/node_modules/@lezer/html/dist/index.d.ts +14 -0
- package/node_modules/@lezer/html/dist/index.js +349 -0
- package/node_modules/@lezer/html/package.json +37 -0
- package/node_modules/@lezer/html/rollup.config.js +16 -0
- package/node_modules/@lezer/html/src/.tern-port +1 -0
- package/node_modules/@lezer/html/src/content.js +87 -0
- package/node_modules/@lezer/html/src/highlight.js +15 -0
- package/node_modules/@lezer/html/src/html.grammar +181 -0
- package/node_modules/@lezer/html/src/index.js +2 -0
- package/node_modules/@lezer/html/src/parser.js +27 -0
- package/node_modules/@lezer/html/src/parser.terms.js +53 -0
- package/node_modules/@lezer/html/src/tokens.js +199 -0
- package/node_modules/@lezer/html/test/mixed.txt +69 -0
- package/node_modules/@lezer/html/test/tags.txt +370 -0
- package/node_modules/@lezer/html/test/test-html.js +29 -0
- package/node_modules/@lezer/html/test/test-incremental.js +97 -0
- package/node_modules/@lezer/html/test/vue.txt +56 -0
- package/node_modules/@lezer/javascript/CHANGELOG.md +485 -0
- package/node_modules/@lezer/javascript/LICENSE +21 -0
- package/node_modules/@lezer/javascript/README.md +14 -0
- package/node_modules/@lezer/javascript/dist/index.cjs +196 -0
- package/node_modules/@lezer/javascript/dist/index.d.cts +3 -0
- package/node_modules/@lezer/javascript/dist/index.d.ts +3 -0
- package/node_modules/@lezer/javascript/dist/index.js +192 -0
- package/node_modules/@lezer/javascript/package.json +36 -0
- package/node_modules/@lezer/javascript/rollup.config.js +16 -0
- package/node_modules/@lezer/javascript/src/highlight.js +62 -0
- package/node_modules/@lezer/javascript/src/javascript.grammar +735 -0
- package/node_modules/@lezer/javascript/src/parser.js +33 -0
- package/node_modules/@lezer/javascript/src/parser.terms.js +177 -0
- package/node_modules/@lezer/javascript/src/tokens.js +87 -0
- package/node_modules/@lezer/javascript/test/decorator.txt +64 -0
- package/node_modules/@lezer/javascript/test/expression.txt +686 -0
- package/node_modules/@lezer/javascript/test/jsx.txt +79 -0
- package/node_modules/@lezer/javascript/test/semicolon.txt +77 -0
- package/node_modules/@lezer/javascript/test/statement.txt +404 -0
- package/node_modules/@lezer/javascript/test/test-javascript.js +17 -0
- package/node_modules/@lezer/javascript/test/typescript.txt +401 -0
- package/node_modules/@lezer/json/CHANGELOG.md +79 -0
- package/node_modules/@lezer/json/LICENSE +21 -0
- package/node_modules/@lezer/json/README.md +7 -0
- package/node_modules/@lezer/json/dist/index.cjs +41 -0
- package/node_modules/@lezer/json/dist/index.d.cts +3 -0
- package/node_modules/@lezer/json/dist/index.d.ts +3 -0
- package/node_modules/@lezer/json/dist/index.js +37 -0
- package/node_modules/@lezer/json/package.json +36 -0
- package/node_modules/@lezer/json/rollup.config.js +15 -0
- package/node_modules/@lezer/json/src/highlight.js +12 -0
- package/node_modules/@lezer/json/src/json.grammar +38 -0
- package/node_modules/@lezer/json/src/parser.js +23 -0
- package/node_modules/@lezer/json/src/parser.terms.js +12 -0
- package/node_modules/@lezer/json/test/arrays.txt +34 -0
- package/node_modules/@lezer/json/test/literals.txt +23 -0
- package/node_modules/@lezer/json/test/numbers.txt +87 -0
- package/node_modules/@lezer/json/test/objects.txt +34 -0
- package/node_modules/@lezer/json/test/strings.txt +50 -0
- package/node_modules/@lezer/json/test/test-json.js +17 -0
- package/node_modules/@lezer/lr/LICENSE +21 -0
- package/node_modules/@lezer/lr/README.md +25 -0
- package/node_modules/@lezer/lr/dist/constants.d.ts +45 -0
- package/node_modules/@lezer/lr/dist/constants.js +5 -0
- package/node_modules/@lezer/lr/dist/index.cjs +1891 -0
- package/node_modules/@lezer/lr/dist/index.d.cts +303 -0
- package/node_modules/@lezer/lr/dist/index.d.ts +303 -0
- package/node_modules/@lezer/lr/dist/index.js +1884 -0
- package/node_modules/@lezer/lr/package.json +32 -0
- package/node_modules/@lezer/markdown/CHANGELOG.md +279 -0
- package/node_modules/@lezer/markdown/LICENSE +21 -0
- package/node_modules/@lezer/markdown/README.md +725 -0
- package/node_modules/@lezer/markdown/bin/build-readme.cjs +39 -0
- package/node_modules/@lezer/markdown/build.js +16 -0
- package/node_modules/@lezer/markdown/dist/index.cjs +2352 -0
- package/node_modules/@lezer/markdown/dist/index.d.cts +600 -0
- package/node_modules/@lezer/markdown/dist/index.d.ts +600 -0
- package/node_modules/@lezer/markdown/dist/index.js +2335 -0
- package/node_modules/@lezer/markdown/package.json +37 -0
- package/node_modules/@lezer/markdown/src/README.md +83 -0
- package/node_modules/@lezer/markdown/src/extension.ts +301 -0
- package/node_modules/@lezer/markdown/src/index.ts +5 -0
- package/node_modules/@lezer/markdown/src/markdown.ts +1961 -0
- package/node_modules/@lezer/markdown/src/nest.ts +46 -0
- package/node_modules/@lezer/markdown/test/compare-tree.ts +14 -0
- package/node_modules/@lezer/markdown/test/spec.ts +79 -0
- package/node_modules/@lezer/markdown/test/test-extension.ts +269 -0
- package/node_modules/@lezer/markdown/test/test-incremental.ts +265 -0
- package/node_modules/@lezer/markdown/test/test-markdown.ts +3574 -0
- package/node_modules/@lezer/markdown/test/test-nesting.ts +86 -0
- package/node_modules/@lezer/markdown/test/tsconfig.json +12 -0
- package/node_modules/@lezer/markdown/tsconfig.json +14 -0
- package/node_modules/@lezer/python/CHANGELOG.md +243 -0
- package/node_modules/@lezer/python/LICENSE +21 -0
- package/node_modules/@lezer/python/README.md +6 -0
- package/node_modules/@lezer/python/dist/index.cjs +330 -0
- package/node_modules/@lezer/python/dist/index.d.cts +3 -0
- package/node_modules/@lezer/python/dist/index.d.ts +3 -0
- package/node_modules/@lezer/python/dist/index.js +326 -0
- package/node_modules/@lezer/python/package.json +36 -0
- package/node_modules/@lezer/python/rollup.config.js +16 -0
- package/node_modules/@lezer/python/src/highlight.js +35 -0
- package/node_modules/@lezer/python/src/python.grammar +381 -0
- package/node_modules/@lezer/python/src/tokens.js +224 -0
- package/node_modules/@lezer/python/test/expression.txt +231 -0
- package/node_modules/@lezer/python/test/statement.txt +442 -0
- package/node_modules/@lezer/python/test/test-incremental.js +33 -0
- package/node_modules/@lezer/python/test/test-python.js +17 -0
- package/node_modules/@marijn/find-cluster-break/LICENSE +21 -0
- package/node_modules/@marijn/find-cluster-break/README.md +28 -0
- package/node_modules/@marijn/find-cluster-break/dist/index.cjs +85 -0
- package/node_modules/@marijn/find-cluster-break/dist/index.d.cts +15 -0
- package/node_modules/@marijn/find-cluster-break/package.json +35 -0
- package/node_modules/@marijn/find-cluster-break/rollup.config.js +7 -0
- package/node_modules/@marijn/find-cluster-break/src/index.d.ts +15 -0
- package/node_modules/@marijn/find-cluster-break/src/index.js +87 -0
- package/node_modules/@marijn/find-cluster-break/test/test-cluster.js +30 -0
- package/node_modules/crelt/LICENSE +19 -0
- package/node_modules/crelt/README.md +23 -0
- package/node_modules/crelt/dist/index.cjs +31 -0
- package/node_modules/crelt/dist/index.d.cts +4 -0
- package/node_modules/crelt/index.d.ts +4 -0
- package/node_modules/crelt/index.js +28 -0
- package/node_modules/crelt/package.json +35 -0
- package/node_modules/crelt/rollup.config.js +13 -0
- package/node_modules/style-mod/LICENSE +19 -0
- package/node_modules/style-mod/README.md +98 -0
- package/node_modules/style-mod/dist/style-mod.cjs +165 -0
- package/node_modules/style-mod/dist/style-mod.d.cts +16 -0
- package/node_modules/style-mod/package.json +39 -0
- package/node_modules/style-mod/src/README.md +34 -0
- package/node_modules/style-mod/src/style-mod.d.ts +16 -0
- package/node_modules/style-mod/src/style-mod.js +172 -0
- package/node_modules/style-mod/test/test-style-mod.js +104 -0
- package/node_modules/w3c-keyname/.tern-port +1 -0
- package/node_modules/w3c-keyname/LICENSE +19 -0
- package/node_modules/w3c-keyname/README.md +18 -0
- package/node_modules/w3c-keyname/index.cjs +127 -0
- package/node_modules/w3c-keyname/index.d.cts +5 -0
- package/node_modules/w3c-keyname/index.d.ts +5 -0
- package/node_modules/w3c-keyname/index.js +119 -0
- package/node_modules/w3c-keyname/package.json +37 -0
- package/package.json +1 -1
- package/packages/daemon/src/api.js +147 -2
- package/packages/daemon/src/filewatcher.js +59 -0
- package/packages/daemon/src/index.js +28 -1
- package/packages/gui/dist/assets/index-Dxg9hdf3.js +103 -0
- package/packages/gui/dist/index.html +1 -1
- package/packages/gui/package.json +15 -2
- package/packages/gui/src/App.jsx +3 -0
- package/packages/gui/src/components/CodeEditor.jsx +143 -0
- package/packages/gui/src/components/EditorTabs.jsx +83 -0
- package/packages/gui/src/components/FileTree.jsx +193 -0
- package/packages/gui/src/stores/groove.js +158 -1
- package/packages/gui/src/views/FileEditor.jsx +142 -0
- package/node_modules/@groove-dev/gui/dist/assets/index-8Kqi_LVo.js +0 -74
- package/packages/gui/dist/assets/index-8Kqi_LVo.js +0 -74
|
@@ -0,0 +1,370 @@
|
|
|
1
|
+
# Regular tag
|
|
2
|
+
|
|
3
|
+
<foo>bar</foo>
|
|
4
|
+
|
|
5
|
+
==>
|
|
6
|
+
|
|
7
|
+
Document(Element(OpenTag(StartTag,TagName,EndTag),Text,CloseTag(StartCloseTag,TagName,EndTag)))
|
|
8
|
+
|
|
9
|
+
# Nested tag
|
|
10
|
+
|
|
11
|
+
<a><b>c</b><br></a>
|
|
12
|
+
|
|
13
|
+
==>
|
|
14
|
+
|
|
15
|
+
Document(Element(OpenTag(StartTag,TagName,EndTag),
|
|
16
|
+
Element(OpenTag(StartTag,TagName,EndTag),Text,CloseTag(StartCloseTag,TagName,EndTag)),
|
|
17
|
+
Element(SelfClosingTag(StartTag,TagName,EndTag)),
|
|
18
|
+
CloseTag(StartCloseTag,TagName,EndTag)))
|
|
19
|
+
|
|
20
|
+
# Attribute
|
|
21
|
+
|
|
22
|
+
<br foo="bar">
|
|
23
|
+
|
|
24
|
+
==>
|
|
25
|
+
|
|
26
|
+
Document(Element(SelfClosingTag(StartTag,TagName,Attribute(AttributeName,Is,AttributeValue),EndTag)))
|
|
27
|
+
|
|
28
|
+
# Multiple attributes
|
|
29
|
+
|
|
30
|
+
<a x="one" y="two" z="three"></a>
|
|
31
|
+
|
|
32
|
+
==>
|
|
33
|
+
|
|
34
|
+
Document(Element(OpenTag(StartTag,TagName,
|
|
35
|
+
Attribute(AttributeName,Is,AttributeValue),
|
|
36
|
+
Attribute(AttributeName,Is,AttributeValue),
|
|
37
|
+
Attribute(AttributeName,Is,AttributeValue),EndTag),
|
|
38
|
+
CloseTag(StartCloseTag,TagName,EndTag)))
|
|
39
|
+
|
|
40
|
+
# Value-less attributes
|
|
41
|
+
|
|
42
|
+
<a x y="one" z></a>
|
|
43
|
+
|
|
44
|
+
==>
|
|
45
|
+
|
|
46
|
+
Document(Element(OpenTag(StartTag,TagName,
|
|
47
|
+
Attribute(AttributeName),
|
|
48
|
+
Attribute(AttributeName,Is,AttributeValue),
|
|
49
|
+
Attribute(AttributeName),EndTag),
|
|
50
|
+
CloseTag(StartCloseTag,TagName,EndTag)))
|
|
51
|
+
|
|
52
|
+
# Unquoted attributes
|
|
53
|
+
|
|
54
|
+
<a x=one y z=two></a>
|
|
55
|
+
|
|
56
|
+
==>
|
|
57
|
+
|
|
58
|
+
Document(Element(OpenTag(StartTag,TagName,
|
|
59
|
+
Attribute(AttributeName,Is,UnquotedAttributeValue),
|
|
60
|
+
Attribute(AttributeName),
|
|
61
|
+
Attribute(AttributeName,Is,UnquotedAttributeValue),EndTag),
|
|
62
|
+
CloseTag(StartCloseTag,TagName,EndTag)))
|
|
63
|
+
|
|
64
|
+
# Unquoted attributes with slashes
|
|
65
|
+
|
|
66
|
+
<link as=font crossorigin=anonymous href=/fonts/google-sans/regular/latin.woff2 rel=preload>
|
|
67
|
+
|
|
68
|
+
==>
|
|
69
|
+
|
|
70
|
+
Document(Element(SelfClosingTag(StartTag,TagName,
|
|
71
|
+
Attribute(AttributeName,Is,UnquotedAttributeValue),
|
|
72
|
+
Attribute(AttributeName,Is,UnquotedAttributeValue),
|
|
73
|
+
Attribute(AttributeName,Is,UnquotedAttributeValue),
|
|
74
|
+
Attribute(AttributeName,Is,UnquotedAttributeValue),
|
|
75
|
+
EndTag)))
|
|
76
|
+
|
|
77
|
+
# Single-quoted attributes
|
|
78
|
+
|
|
79
|
+
<link x='one' z='two&'>
|
|
80
|
+
|
|
81
|
+
==>
|
|
82
|
+
|
|
83
|
+
Document(Element(SelfClosingTag(StartTag, TagName,
|
|
84
|
+
Attribute(AttributeName, Is, AttributeValue),
|
|
85
|
+
Attribute(AttributeName, Is, AttributeValue(EntityReference)),
|
|
86
|
+
EndTag)))
|
|
87
|
+
|
|
88
|
+
# Entities
|
|
89
|
+
|
|
90
|
+
<a attr="one&two">&C</a>
|
|
91
|
+
|
|
92
|
+
==>
|
|
93
|
+
|
|
94
|
+
Document(Element(OpenTag(StartTag,TagName,
|
|
95
|
+
Attribute(AttributeName,Is,AttributeValue(EntityReference)),EndTag),
|
|
96
|
+
EntityReference,CharacterReference,
|
|
97
|
+
CloseTag(StartCloseTag,TagName,EndTag)))
|
|
98
|
+
|
|
99
|
+
# Doctype
|
|
100
|
+
|
|
101
|
+
<!doctype html>
|
|
102
|
+
<doc></doc>
|
|
103
|
+
|
|
104
|
+
==>
|
|
105
|
+
|
|
106
|
+
Document(DoctypeDecl,Text,Element(OpenTag(StartTag,TagName,EndTag),CloseTag(StartCloseTag,TagName,EndTag)))
|
|
107
|
+
|
|
108
|
+
# Processing instructions
|
|
109
|
+
|
|
110
|
+
<?foo?><bar><?baz?></bar>
|
|
111
|
+
|
|
112
|
+
==>
|
|
113
|
+
|
|
114
|
+
Document(ProcessingInst,Element(OpenTag(StartTag,TagName,EndTag),ProcessingInst,CloseTag(StartCloseTag,TagName,EndTag)))
|
|
115
|
+
|
|
116
|
+
# Comments
|
|
117
|
+
|
|
118
|
+
<!-- top comment -->
|
|
119
|
+
<element><!-- inner comment --> text</element>
|
|
120
|
+
<!---->
|
|
121
|
+
<!--
|
|
122
|
+
-->
|
|
123
|
+
|
|
124
|
+
==>
|
|
125
|
+
|
|
126
|
+
Document(Comment,Text,Element(OpenTag(StartTag,TagName,EndTag),Comment,Text,CloseTag(StartCloseTag,TagName,EndTag)),Text,Comment,Text,Comment)
|
|
127
|
+
|
|
128
|
+
# Mismatched tag
|
|
129
|
+
|
|
130
|
+
<a></b>
|
|
131
|
+
|
|
132
|
+
==>
|
|
133
|
+
|
|
134
|
+
Document(Element(OpenTag(StartTag,TagName,EndTag),MismatchedCloseTag(StartCloseTag,TagName,EndTag)))
|
|
135
|
+
|
|
136
|
+
# Unclosed tag
|
|
137
|
+
|
|
138
|
+
<a>
|
|
139
|
+
|
|
140
|
+
==>
|
|
141
|
+
|
|
142
|
+
Document(Element(OpenTag(StartTag,TagName,EndTag)))
|
|
143
|
+
|
|
144
|
+
# Ignore pseudo-xml self-closers
|
|
145
|
+
|
|
146
|
+
<br/>
|
|
147
|
+
|
|
148
|
+
==>
|
|
149
|
+
|
|
150
|
+
Document(Element(SelfClosingTag(StartTag,TagName,EndTag)))
|
|
151
|
+
|
|
152
|
+
# Unclosed implicitly closed tag
|
|
153
|
+
|
|
154
|
+
<p>
|
|
155
|
+
|
|
156
|
+
==>
|
|
157
|
+
|
|
158
|
+
Document(Element(OpenTag(StartTag,TagName,EndTag)))
|
|
159
|
+
|
|
160
|
+
# Nested mismatched tag
|
|
161
|
+
|
|
162
|
+
<a><b><c></c></x></a>
|
|
163
|
+
|
|
164
|
+
==>
|
|
165
|
+
|
|
166
|
+
Document(Element(OpenTag(StartTag,TagName,EndTag),
|
|
167
|
+
Element(OpenTag(StartTag,TagName,EndTag),
|
|
168
|
+
Element(OpenTag(StartTag,TagName,EndTag),CloseTag(StartCloseTag,TagName,EndTag)),
|
|
169
|
+
MismatchedCloseTag(StartCloseTag,TagName,EndTag),
|
|
170
|
+
⚠),
|
|
171
|
+
CloseTag(StartCloseTag,TagName,EndTag)))
|
|
172
|
+
|
|
173
|
+
# Incomplete close tag
|
|
174
|
+
|
|
175
|
+
<html><body></</html>
|
|
176
|
+
|
|
177
|
+
==>
|
|
178
|
+
|
|
179
|
+
Document(Element(OpenTag(StartTag,TagName,EndTag),
|
|
180
|
+
Element(OpenTag(StartTag,TagName,EndTag), IncompleteCloseTag, ⚠),
|
|
181
|
+
CloseTag(StartCloseTag,TagName,EndTag)))
|
|
182
|
+
|
|
183
|
+
# Re-synchronize close tags
|
|
184
|
+
|
|
185
|
+
<a><b><c></x></c></a>
|
|
186
|
+
|
|
187
|
+
==>
|
|
188
|
+
|
|
189
|
+
Document(Element(OpenTag(StartTag,TagName,EndTag),
|
|
190
|
+
Element(OpenTag(StartTag,TagName,EndTag),
|
|
191
|
+
Element(OpenTag(StartTag,TagName,EndTag),
|
|
192
|
+
MismatchedCloseTag(StartCloseTag,TagName,EndTag),
|
|
193
|
+
CloseTag(StartCloseTag,TagName,EndTag)),
|
|
194
|
+
⚠),
|
|
195
|
+
CloseTag(StartCloseTag,TagName,EndTag)))
|
|
196
|
+
|
|
197
|
+
# Top-level mismatched close tag
|
|
198
|
+
|
|
199
|
+
<a></a></a>
|
|
200
|
+
|
|
201
|
+
==>
|
|
202
|
+
|
|
203
|
+
Document(
|
|
204
|
+
Element(OpenTag(StartTag,TagName,EndTag),CloseTag(StartCloseTag,TagName,EndTag)),
|
|
205
|
+
MismatchedCloseTag(StartCloseTag,TagName,EndTag))
|
|
206
|
+
|
|
207
|
+
# Self-closing tags
|
|
208
|
+
|
|
209
|
+
<a><img src=blah></a>
|
|
210
|
+
|
|
211
|
+
==>
|
|
212
|
+
|
|
213
|
+
Document(Element(OpenTag(StartTag,TagName,EndTag),
|
|
214
|
+
Element(SelfClosingTag(StartTag,TagName,Attribute(AttributeName,Is,UnquotedAttributeValue),EndTag)),
|
|
215
|
+
CloseTag(StartCloseTag,TagName,EndTag)))
|
|
216
|
+
|
|
217
|
+
# Implicitly closed
|
|
218
|
+
|
|
219
|
+
<dl><dd>Hello</dl>
|
|
220
|
+
|
|
221
|
+
==>
|
|
222
|
+
|
|
223
|
+
Document(Element(OpenTag(StartTag,TagName,EndTag),
|
|
224
|
+
Element(OpenTag(StartTag,TagName,EndTag),Text),
|
|
225
|
+
CloseTag(StartCloseTag,TagName,EndTag)))
|
|
226
|
+
|
|
227
|
+
# Closed by sibling
|
|
228
|
+
|
|
229
|
+
<div>
|
|
230
|
+
<p>Foo
|
|
231
|
+
<p>Bar
|
|
232
|
+
</div>
|
|
233
|
+
|
|
234
|
+
==>
|
|
235
|
+
|
|
236
|
+
Document(Element(OpenTag(StartTag,TagName,EndTag),
|
|
237
|
+
Text,
|
|
238
|
+
Element(OpenTag(StartTag,TagName,EndTag),Text),
|
|
239
|
+
Element(OpenTag(StartTag,TagName,EndTag),Text),
|
|
240
|
+
CloseTag(StartCloseTag,TagName,EndTag)))
|
|
241
|
+
|
|
242
|
+
# Closed by sibling at top
|
|
243
|
+
|
|
244
|
+
<p>Foo
|
|
245
|
+
<p>Bar
|
|
246
|
+
|
|
247
|
+
==>
|
|
248
|
+
|
|
249
|
+
Document(Element(OpenTag(StartTag,TagName,EndTag),Text),Element(OpenTag(StartTag,TagName,EndTag),Text))
|
|
250
|
+
|
|
251
|
+
# Textarea
|
|
252
|
+
|
|
253
|
+
<p>Enter something: <textarea code-lang=javascript>function foo() {
|
|
254
|
+
return "</bar>"
|
|
255
|
+
}</textarea>
|
|
256
|
+
|
|
257
|
+
==>
|
|
258
|
+
|
|
259
|
+
Document(Element(OpenTag(StartTag,TagName,EndTag),
|
|
260
|
+
Text,
|
|
261
|
+
Element(OpenTag(StartTag,TagName,Attribute(AttributeName,Is,UnquotedAttributeValue),EndTag),
|
|
262
|
+
TextareaText,
|
|
263
|
+
CloseTag(StartCloseTag,TagName,EndTag))))
|
|
264
|
+
|
|
265
|
+
# Script
|
|
266
|
+
|
|
267
|
+
<script>This is not an entity: <</script>
|
|
268
|
+
|
|
269
|
+
==>
|
|
270
|
+
|
|
271
|
+
Document(Element(OpenTag(StartTag,TagName,EndTag),ScriptText,CloseTag(StartCloseTag,TagName,EndTag)))
|
|
272
|
+
|
|
273
|
+
# Doesn't get confused by a stray ampersand
|
|
274
|
+
|
|
275
|
+
<html>a&b</html>
|
|
276
|
+
|
|
277
|
+
==>
|
|
278
|
+
|
|
279
|
+
Document(Element(OpenTag(StartTag,TagName,EndTag),Text,InvalidEntity,Text,CloseTag(StartCloseTag,TagName,EndTag)))
|
|
280
|
+
|
|
281
|
+
# Can ignore mismatches {"dialect": "noMatch"}
|
|
282
|
+
|
|
283
|
+
<div>foo</p>
|
|
284
|
+
|
|
285
|
+
==>
|
|
286
|
+
|
|
287
|
+
Document(Element(OpenTag(StartTag,TagName,EndTag),Text,CloseTag(StartCloseTag,TagName,EndTag)))
|
|
288
|
+
|
|
289
|
+
# Can handle lone close tags {"dialect": "noMatch"}
|
|
290
|
+
|
|
291
|
+
</strong>
|
|
292
|
+
|
|
293
|
+
==>
|
|
294
|
+
|
|
295
|
+
Document(CloseTag(StartCloseTag,TagName,EndTag))
|
|
296
|
+
|
|
297
|
+
# Parses ampersands in attributes
|
|
298
|
+
|
|
299
|
+
<img src="foo&bar">
|
|
300
|
+
|
|
301
|
+
==>
|
|
302
|
+
|
|
303
|
+
Document(Element(SelfClosingTag(StartTag, TagName, Attribute(AttributeName, Is, AttributeValue(InvalidEntity)), EndTag)))
|
|
304
|
+
|
|
305
|
+
# Supports self-closing dialect {"dialect": "selfClosing"}
|
|
306
|
+
|
|
307
|
+
<section><image id=i2 /></section>
|
|
308
|
+
|
|
309
|
+
==>
|
|
310
|
+
|
|
311
|
+
Document(Element(
|
|
312
|
+
OpenTag(StartTag,TagName,EndTag),
|
|
313
|
+
Element(SelfClosingTag(StartTag,TagName,Attribute(AttributeName,Is,UnquotedAttributeValue),SelfClosingEndTag)),
|
|
314
|
+
CloseTag(StartCloseTag,TagName,EndTag)))
|
|
315
|
+
|
|
316
|
+
# Allows self-closing in foreign elements
|
|
317
|
+
|
|
318
|
+
<div><svg><circle/></svg></div>
|
|
319
|
+
|
|
320
|
+
==>
|
|
321
|
+
|
|
322
|
+
Document(Element(OpenTag(StartTag,TagName,EndTag),
|
|
323
|
+
Element(OpenTag(StartTag,TagName,EndTag),
|
|
324
|
+
Element(SelfClosingTag(StartTag,TagName,SelfClosingEndTag)),
|
|
325
|
+
CloseTag(StartCloseTag,TagName,EndTag)),
|
|
326
|
+
CloseTag(StartCloseTag,TagName,EndTag)))
|
|
327
|
+
|
|
328
|
+
# Parses multiple unfinished tags in a row
|
|
329
|
+
|
|
330
|
+
<div
|
|
331
|
+
<div
|
|
332
|
+
<div
|
|
333
|
+
|
|
334
|
+
==>
|
|
335
|
+
|
|
336
|
+
Document(Element(OpenTag(StartTag,TagName,⚠),
|
|
337
|
+
Element(OpenTag(StartTag,TagName,⚠),
|
|
338
|
+
Element(OpenTag(StartTag,TagName,⚠),⚠),⚠),⚠))
|
|
339
|
+
|
|
340
|
+
# Allows self-closing on special tags {"dialect": "selfClosing"}
|
|
341
|
+
|
|
342
|
+
<body>
|
|
343
|
+
<br/>
|
|
344
|
+
<textarea/>
|
|
345
|
+
<script/>
|
|
346
|
+
<style/>
|
|
347
|
+
</body>
|
|
348
|
+
|
|
349
|
+
==>
|
|
350
|
+
|
|
351
|
+
Document(Element(
|
|
352
|
+
OpenTag(StartTag,TagName,EndTag),
|
|
353
|
+
Text,
|
|
354
|
+
Element(SelfClosingTag(StartTag,TagName,SelfClosingEndTag)),
|
|
355
|
+
Text,
|
|
356
|
+
Element(SelfClosingTag(StartTag,TagName,SelfClosingEndTag)),
|
|
357
|
+
Text,
|
|
358
|
+
Element(SelfClosingTag(StartTag,TagName,SelfClosingEndTag)),
|
|
359
|
+
Text,
|
|
360
|
+
Element(SelfClosingTag(StartTag,TagName,SelfClosingEndTag)),
|
|
361
|
+
Text,
|
|
362
|
+
CloseTag(StartCloseTag,TagName,EndTag)))
|
|
363
|
+
|
|
364
|
+
# Only treats less-than as opening a tag when followed by a name
|
|
365
|
+
|
|
366
|
+
< div>x
|
|
367
|
+
|
|
368
|
+
==>
|
|
369
|
+
|
|
370
|
+
Document(IncompleteTag,Text)
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import {parser, configureNesting} from "../dist/index.js"
|
|
2
|
+
import {parser as jsParser} from "@lezer/javascript"
|
|
3
|
+
import {fileTests} from "@lezer/generator/dist/test"
|
|
4
|
+
|
|
5
|
+
import * as fs from "fs"
|
|
6
|
+
import * as path from "path"
|
|
7
|
+
import {fileURLToPath} from "url"
|
|
8
|
+
let caseDir = path.dirname(fileURLToPath(import.meta.url))
|
|
9
|
+
|
|
10
|
+
let mixed = parser.configure({
|
|
11
|
+
wrap: configureNesting([{
|
|
12
|
+
tag: "script",
|
|
13
|
+
attrs(attrs) {
|
|
14
|
+
return !attrs.type || /^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(attrs.type)
|
|
15
|
+
},
|
|
16
|
+
parser: jsParser
|
|
17
|
+
}])
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
for (let file of fs.readdirSync(caseDir)) {
|
|
21
|
+
if (!/\.txt$/.test(file)) continue
|
|
22
|
+
let name = /^[^\.]*/.exec(file)[0]
|
|
23
|
+
describe(name, () => {
|
|
24
|
+
let p = name == "mixed" ? mixed : parser
|
|
25
|
+
for (let {name, run} of fileTests(fs.readFileSync(path.join(caseDir, file), "utf8"), file))
|
|
26
|
+
it(name, () => run(p))
|
|
27
|
+
})
|
|
28
|
+
}
|
|
29
|
+
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import {parser as baseParser} from "../dist/index.js"
|
|
2
|
+
import {TreeFragment} from "@lezer/common"
|
|
3
|
+
|
|
4
|
+
let parser = baseParser.configure({bufferLength: 2})
|
|
5
|
+
|
|
6
|
+
let r = n => Math.floor(Math.random() * n)
|
|
7
|
+
|
|
8
|
+
let tags = ["p", "ul", "li", "div", "span", "th", "tr", "body", "head", "title", "dd", "code", "em", "strong"]
|
|
9
|
+
|
|
10
|
+
function randomDoc(size) {
|
|
11
|
+
let doc = ""
|
|
12
|
+
if (!r(5)) doc += "<!doctype html>"
|
|
13
|
+
let scope = []
|
|
14
|
+
for (let i = 0; i < size; i++) {
|
|
15
|
+
let sel = r(20)
|
|
16
|
+
if (sel < 5) {
|
|
17
|
+
let tag = tags[r(tags.length)]
|
|
18
|
+
doc += `<${tag}${r(2) ? " a=b" : ""}>`
|
|
19
|
+
scope.push(tag)
|
|
20
|
+
} else if (sel < 10 && scope.length) {
|
|
21
|
+
let name = scope.pop()
|
|
22
|
+
doc += `</${r(5) ? name : "div"}>`
|
|
23
|
+
} else if (sel == 10) {
|
|
24
|
+
doc += `<img>`
|
|
25
|
+
} else if (sel == 11) {
|
|
26
|
+
doc += "<script>a()</script>"
|
|
27
|
+
} else if (sel == 12) {
|
|
28
|
+
doc += r(2) ? "&" : "<!--@-->"
|
|
29
|
+
} else {
|
|
30
|
+
for (let i = r(6) + 1; i >= 0; i--)
|
|
31
|
+
doc += String.fromCharCode(97 + r(26))
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
while (scope.length) {
|
|
35
|
+
let name = scope.pop()
|
|
36
|
+
if (r(5)) doc += `</${name}>`
|
|
37
|
+
}
|
|
38
|
+
return doc
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function check(doc, [tp, pos, txt], prevAST) {
|
|
42
|
+
let change = {fromA: pos, toA: pos, fromB: pos, toB: pos}, newDoc
|
|
43
|
+
if (tp == "insert") {
|
|
44
|
+
newDoc = doc.slice(0, pos) + txt + doc.slice(pos)
|
|
45
|
+
change.toA += txt.length
|
|
46
|
+
} else if (tp == "del") {
|
|
47
|
+
newDoc = doc.slice(0, pos) + doc.slice(pos + 1)
|
|
48
|
+
change.toB++
|
|
49
|
+
} else {
|
|
50
|
+
newDoc = doc.slice(0, pos) + txt + doc.slice(pos + 1)
|
|
51
|
+
change.toA += txt.length
|
|
52
|
+
change.toB++
|
|
53
|
+
}
|
|
54
|
+
let fragments = TreeFragment.applyChanges(TreeFragment.addTree(prevAST || parser.parse(doc)), [change], 2)
|
|
55
|
+
let ast = parser.parse(newDoc, fragments)
|
|
56
|
+
let orig = parser.parse(newDoc)
|
|
57
|
+
if (ast.toString() != orig.toString()) {
|
|
58
|
+
throw new Error(`Mismatch:\n ${ast}\nvs\n ${orig}\ndocument: ${
|
|
59
|
+
JSON.stringify(doc)}\naction: ${JSON.stringify([tp, pos, ch])}`)
|
|
60
|
+
}
|
|
61
|
+
return [newDoc, ast]
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// Call this to just run random tests until a failing one is found.
|
|
65
|
+
// Not directly called in the tests because there's a bunch of
|
|
66
|
+
// circumstances in which uninteresting deviations in error recovery
|
|
67
|
+
// will create differing parses, so results have to be manually
|
|
68
|
+
// inspected.
|
|
69
|
+
function generate() {
|
|
70
|
+
for (let count = 0, size = 2;; size = Math.min(40, size + 1)) {
|
|
71
|
+
let doc = randomDoc(size), prev = null
|
|
72
|
+
for (let i = 0; i < 2; i++) {
|
|
73
|
+
console.log("Attempt", ++count)
|
|
74
|
+
let action = [["del", "insert", "replace"][r(3)], r(doc.length - 1), "<>/piabc "[r(9)]]
|
|
75
|
+
;([doc, prev] = check(doc, action, prev))
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
describe("Incremental parsing", () => {
|
|
81
|
+
it("doesn't get confused by reused opening tags", () => {
|
|
82
|
+
check("<code><code>mgnbni</code></code>", ["del", 29])
|
|
83
|
+
})
|
|
84
|
+
|
|
85
|
+
it("can handle a renamed opening tag after a self-closing", () => {
|
|
86
|
+
check("<p>one two three four five six seven<p>eight", ["replace", 37, "a"])
|
|
87
|
+
})
|
|
88
|
+
|
|
89
|
+
it("is okay with nameless elements", () => {
|
|
90
|
+
check("<body><code><img></code><>body>", ["replace", 14, ">"])
|
|
91
|
+
check("abcde<>fghij<", ["replace", 12, ">"])
|
|
92
|
+
})
|
|
93
|
+
|
|
94
|
+
it("doesn't get confused by an invalid close tag receiving a matching open tag", () => {
|
|
95
|
+
check("<div><p>foo</body>", ["insert", 0, "<body>"])
|
|
96
|
+
})
|
|
97
|
+
})
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# Parses Vue builtin directives
|
|
2
|
+
|
|
3
|
+
<span v-text="msg"></span>
|
|
4
|
+
|
|
5
|
+
==>
|
|
6
|
+
|
|
7
|
+
Document(
|
|
8
|
+
Element(
|
|
9
|
+
OpenTag(StartTag, TagName, Attribute(AttributeName, Is, AttributeValue), EndTag),
|
|
10
|
+
CloseTag(StartCloseTag, TagName, EndTag)))
|
|
11
|
+
|
|
12
|
+
# Parses Vue :is shorthand syntax
|
|
13
|
+
|
|
14
|
+
<Component :is="view"></Component>
|
|
15
|
+
|
|
16
|
+
==>
|
|
17
|
+
|
|
18
|
+
Document(
|
|
19
|
+
Element(
|
|
20
|
+
OpenTag(StartTag, TagName, Attribute(AttributeName, Is, AttributeValue),EndTag),
|
|
21
|
+
CloseTag(StartCloseTag, TagName, EndTag)))
|
|
22
|
+
|
|
23
|
+
# Parses Vue @click shorthand syntax
|
|
24
|
+
|
|
25
|
+
<button @click="handler()">Click me</button>
|
|
26
|
+
|
|
27
|
+
==>
|
|
28
|
+
|
|
29
|
+
Document(
|
|
30
|
+
Element(
|
|
31
|
+
OpenTag(StartTag, TagName, Attribute(AttributeName, Is, AttributeValue), EndTag),
|
|
32
|
+
Text,
|
|
33
|
+
CloseTag(StartCloseTag, TagName, EndTag)))
|
|
34
|
+
|
|
35
|
+
# Parses Vue @submit.prevent shorthand syntax
|
|
36
|
+
|
|
37
|
+
<form @submit.prevent="onSubmit"></form>
|
|
38
|
+
|
|
39
|
+
==>
|
|
40
|
+
|
|
41
|
+
Document(
|
|
42
|
+
Element(
|
|
43
|
+
OpenTag(StartTag, TagName, Attribute(AttributeName, Is, AttributeValue), EndTag),
|
|
44
|
+
CloseTag(StartCloseTag, TagName, EndTag)))
|
|
45
|
+
|
|
46
|
+
# Parses Vue Dynamic Arguments
|
|
47
|
+
|
|
48
|
+
<a v-bind:[attributeName]="url">Link</a>
|
|
49
|
+
|
|
50
|
+
==>
|
|
51
|
+
|
|
52
|
+
Document(
|
|
53
|
+
Element(
|
|
54
|
+
OpenTag(StartTag, TagName, Attribute(AttributeName, Is, AttributeValue), EndTag),
|
|
55
|
+
Text,
|
|
56
|
+
CloseTag(StartCloseTag, TagName, EndTag)))
|