@fangzhongya/vue-archive 0.0.2-8 → 0.0.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/es/_virtual/_commonjsHelpers.js +28 -26
- package/dist/es/_virtual/_plugin-vue_export-helper.js +7 -6
- package/dist/es/_virtual/emphasis.js +2 -2
- package/dist/es/_virtual/entities.js +7 -6
- package/dist/es/_virtual/html_re.js +2 -2
- package/dist/es/_virtual/index.js +7 -6
- package/dist/es/_virtual/index2.js +2 -2
- package/dist/es/_virtual/index3.js +2 -2
- package/dist/es/_virtual/index4.js +2 -2
- package/dist/es/_virtual/parser-html.js +7 -6
- package/dist/es/_virtual/parser-typescript.js +7 -6
- package/dist/es/_virtual/punycode.es6.js +4 -4
- package/dist/es/_virtual/standalone.js +7 -6
- package/dist/es/_virtual/strikethrough.js +2 -2
- package/dist/es/_virtual/utils.js +2 -2
- package/dist/es/node_modules/.pnpm/@fangzhongya_utils@0.0.7-10/node_modules/@fangzhongya/utils/dist/chunk-4OBNLDTJ.js +3 -3
- package/dist/es/node_modules/.pnpm/@fangzhongya_utils@0.0.7-10/node_modules/@fangzhongya/utils/dist/chunk-EWJJKQIO.js +3 -3
- package/dist/es/node_modules/.pnpm/@fangzhongya_utils@0.0.7-10/node_modules/@fangzhongya/utils/dist/chunk-GOJN3OQ4.js +16 -8
- package/dist/es/node_modules/.pnpm/@fangzhongya_utils@0.0.7-10/node_modules/@fangzhongya/utils/dist/chunk-J7CICTHH.js +18 -12
- package/dist/es/node_modules/.pnpm/@fangzhongya_utils@0.0.7-10/node_modules/@fangzhongya/utils/dist/chunk-RD4EP3M5.js +40 -27
- package/dist/es/node_modules/.pnpm/@fangzhongya_utils@0.0.7-10/node_modules/@fangzhongya/utils/dist/chunk-SNABGVNO.js +9 -6
- package/dist/es/node_modules/.pnpm/@fangzhongya_utils@0.0.7-10/node_modules/@fangzhongya/utils/dist/chunk-XCDKXZFR.js +8 -5
- package/dist/es/node_modules/.pnpm/@fangzhongya_utils@0.0.7-10/node_modules/@fangzhongya/utils/dist/chunk-XQB2HUHZ.js +14 -11
- package/dist/es/node_modules/.pnpm/@fangzhongya_utils@0.0.7-10/node_modules/@fangzhongya/utils/dist/chunk-ZVBCHJA5.js +12 -7
- package/dist/es/node_modules/.pnpm/@highlightjs_vue-plugin@2.1.0_jsvakxz56e7tk77soxhxnrhzhm/node_modules/@highlightjs/vue-plugin/dist/highlightjs-vue.esm.min.js +27 -28
- package/dist/es/node_modules/.pnpm/comment-parser@1.3.1/node_modules/comment-parser/es6/index.js +6 -6
- package/dist/es/node_modules/.pnpm/comment-parser@1.3.1/node_modules/comment-parser/es6/parser/block-parser.js +21 -12
- package/dist/es/node_modules/.pnpm/comment-parser@1.3.1/node_modules/comment-parser/es6/parser/index.js +33 -29
- package/dist/es/node_modules/.pnpm/comment-parser@1.3.1/node_modules/comment-parser/es6/parser/source-parser.js +38 -17
- package/dist/es/node_modules/.pnpm/comment-parser@1.3.1/node_modules/comment-parser/es6/parser/spec-parser.js +11 -9
- package/dist/es/node_modules/.pnpm/comment-parser@1.3.1/node_modules/comment-parser/es6/parser/tokenizers/description.js +28 -17
- package/dist/es/node_modules/.pnpm/comment-parser@1.3.1/node_modules/comment-parser/es6/parser/tokenizers/name.js +69 -38
- package/dist/es/node_modules/.pnpm/comment-parser@1.3.1/node_modules/comment-parser/es6/parser/tokenizers/tag.js +19 -10
- package/dist/es/node_modules/.pnpm/comment-parser@1.3.1/node_modules/comment-parser/es6/parser/tokenizers/type.js +51 -26
- package/dist/es/node_modules/.pnpm/comment-parser@1.3.1/node_modules/comment-parser/es6/primitives.js +8 -5
- package/dist/es/node_modules/.pnpm/comment-parser@1.3.1/node_modules/comment-parser/es6/transforms/align.js +12 -1
- package/dist/es/node_modules/.pnpm/comment-parser@1.3.1/node_modules/comment-parser/es6/transforms/crlf.js +12 -1
- package/dist/es/node_modules/.pnpm/comment-parser@1.3.1/node_modules/comment-parser/es6/transforms/indent.js +12 -1
- package/dist/es/node_modules/.pnpm/comment-parser@1.3.1/node_modules/comment-parser/es6/util.js +20 -20
- package/dist/es/node_modules/.pnpm/entities@3.0.1/node_modules/entities/lib/maps/entities.json.js +6373 -4251
- package/dist/es/node_modules/.pnpm/es-module-lexer@1.1.1/node_modules/es-module-lexer/dist/lexer.js +38 -40
- package/dist/es/node_modules/.pnpm/highlight.js@11.7.0/node_modules/highlight.js/es/common.js +3 -3
- package/dist/es/node_modules/.pnpm/highlight.js@11.7.0/node_modules/highlight.js/es/core.js +3 -3
- package/dist/es/node_modules/.pnpm/highlight.js@11.7.0/node_modules/highlight.js/lib/common.js +79 -79
- package/dist/es/node_modules/.pnpm/highlight.js@11.7.0/node_modules/highlight.js/lib/core.js +1157 -648
- package/dist/es/node_modules/.pnpm/highlight.js@11.7.0/node_modules/highlight.js/lib/languages/bash.js +75 -57
- package/dist/es/node_modules/.pnpm/highlight.js@11.7.0/node_modules/highlight.js/lib/languages/c.js +157 -137
- package/dist/es/node_modules/.pnpm/highlight.js@11.7.0/node_modules/highlight.js/lib/languages/cpp.js +118 -93
- package/dist/es/node_modules/.pnpm/highlight.js@11.7.0/node_modules/highlight.js/lib/languages/csharp.js +112 -92
- package/dist/es/node_modules/.pnpm/highlight.js@11.7.0/node_modules/highlight.js/lib/languages/css.js +92 -77
- package/dist/es/node_modules/.pnpm/highlight.js@11.7.0/node_modules/highlight.js/lib/languages/diff.js +13 -11
- package/dist/es/node_modules/.pnpm/highlight.js@11.7.0/node_modules/highlight.js/lib/languages/go.js +98 -92
- package/dist/es/node_modules/.pnpm/highlight.js@11.7.0/node_modules/highlight.js/lib/languages/graphql.js +20 -17
- package/dist/es/node_modules/.pnpm/highlight.js@11.7.0/node_modules/highlight.js/lib/languages/ini.js +51 -39
- package/dist/es/node_modules/.pnpm/highlight.js@11.7.0/node_modules/highlight.js/lib/languages/java.js +132 -114
- package/dist/es/node_modules/.pnpm/highlight.js@11.7.0/node_modules/highlight.js/lib/languages/javascript.js +237 -192
- package/dist/es/node_modules/.pnpm/highlight.js@11.7.0/node_modules/highlight.js/lib/languages/json.js +26 -21
- package/dist/es/node_modules/.pnpm/highlight.js@11.7.0/node_modules/highlight.js/lib/languages/kotlin.js +98 -82
- package/dist/es/node_modules/.pnpm/highlight.js@11.7.0/node_modules/highlight.js/lib/languages/less.js +161 -134
- package/dist/es/node_modules/.pnpm/highlight.js@11.7.0/node_modules/highlight.js/lib/languages/lua.js +34 -29
- package/dist/es/node_modules/.pnpm/highlight.js@11.7.0/node_modules/highlight.js/lib/languages/makefile.js +33 -26
- package/dist/es/node_modules/.pnpm/highlight.js@11.7.0/node_modules/highlight.js/lib/languages/markdown.js +95 -77
- package/dist/es/node_modules/.pnpm/highlight.js@11.7.0/node_modules/highlight.js/lib/languages/objectivec.js +188 -179
- package/dist/es/node_modules/.pnpm/highlight.js@11.7.0/node_modules/highlight.js/lib/languages/perl.js +78 -61
- package/dist/es/node_modules/.pnpm/highlight.js@11.7.0/node_modules/highlight.js/lib/languages/php-template.js +17 -15
- package/dist/es/node_modules/.pnpm/highlight.js@11.7.0/node_modules/highlight.js/lib/languages/php.js +157 -121
- package/dist/es/node_modules/.pnpm/highlight.js@11.7.0/node_modules/highlight.js/lib/languages/plaintext.js +11 -9
- package/dist/es/node_modules/.pnpm/highlight.js@11.7.0/node_modules/highlight.js/lib/languages/python-repl.js +10 -8
- package/dist/es/node_modules/.pnpm/highlight.js@11.7.0/node_modules/highlight.js/lib/languages/python.js +191 -172
- package/dist/es/node_modules/.pnpm/highlight.js@11.7.0/node_modules/highlight.js/lib/languages/r.js +39 -33
- package/dist/es/node_modules/.pnpm/highlight.js@11.7.0/node_modules/highlight.js/lib/languages/ruby.js +159 -131
- package/dist/es/node_modules/.pnpm/highlight.js@11.7.0/node_modules/highlight.js/lib/languages/rust.js +45 -37
- package/dist/es/node_modules/.pnpm/highlight.js@11.7.0/node_modules/highlight.js/lib/languages/scss.js +94 -79
- package/dist/es/node_modules/.pnpm/highlight.js@11.7.0/node_modules/highlight.js/lib/languages/shell.js +10 -8
- package/dist/es/node_modules/.pnpm/highlight.js@11.7.0/node_modules/highlight.js/lib/languages/sql.js +78 -49
- package/dist/es/node_modules/.pnpm/highlight.js@11.7.0/node_modules/highlight.js/lib/languages/swift.js +292 -219
- package/dist/es/node_modules/.pnpm/highlight.js@11.7.0/node_modules/highlight.js/lib/languages/typescript.js +284 -223
- package/dist/es/node_modules/.pnpm/highlight.js@11.7.0/node_modules/highlight.js/lib/languages/vbnet.js +51 -37
- package/dist/es/node_modules/.pnpm/highlight.js@11.7.0/node_modules/highlight.js/lib/languages/wasm.js +49 -39
- package/dist/es/node_modules/.pnpm/highlight.js@11.7.0/node_modules/highlight.js/lib/languages/xml.js +55 -45
- package/dist/es/node_modules/.pnpm/highlight.js@11.7.0/node_modules/highlight.js/lib/languages/yaml.js +66 -46
- package/dist/es/node_modules/.pnpm/highlight.js@11.7.0/node_modules/highlight.js/styles/stackoverflow-light.css.js +2 -2
- package/dist/es/node_modules/.pnpm/linkify-it@4.0.1/node_modules/linkify-it/index.js +304 -138
- package/dist/es/node_modules/.pnpm/linkify-it@4.0.1/node_modules/linkify-it/lib/re.js +49 -16
- package/dist/es/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/index.js +8 -8
- package/dist/es/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/common/entities.js +5 -5
- package/dist/es/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/common/html_blocks.js +2 -2
- package/dist/es/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/common/html_re.js +18 -5
- package/dist/es/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/common/utils.js +153 -77
- package/dist/es/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/helpers/index.js +8 -8
- package/dist/es/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/helpers/parse_link_destination.js +61 -26
- package/dist/es/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/helpers/parse_link_label.js +27 -13
- package/dist/es/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/helpers/parse_link_title.js +37 -14
- package/dist/es/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/index.js +156 -83
- package/dist/es/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/parser_block.js +69 -42
- package/dist/es/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/parser_core.js +32 -28
- package/dist/es/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/parser_inline.js +96 -66
- package/dist/es/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/presets/commonmark.js +7 -7
- package/dist/es/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/presets/default.js +7 -7
- package/dist/es/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/presets/zero.js +7 -7
- package/dist/es/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/renderer.js +132 -64
- package/dist/es/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/ruler.js +122 -74
- package/dist/es/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/rules_block/blockquote.js +147 -27
- package/dist/es/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/rules_block/code.js +18 -12
- package/dist/es/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/rules_block/fence.js +63 -11
- package/dist/es/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/rules_block/heading.js +40 -9
- package/dist/es/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/rules_block/hr.js +32 -11
- package/dist/es/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/rules_block/html_block.js +56 -26
- package/dist/es/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/rules_block/lheading.js +53 -18
- package/dist/es/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/rules_block/list.js +196 -53
- package/dist/es/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/rules_block/paragraph.js +32 -12
- package/dist/es/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/rules_block/reference.js +142 -44
- package/dist/es/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/rules_block/state_block.js +150 -60
- package/dist/es/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/rules_block/table.js +174 -44
- package/dist/es/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/rules_core/block.js +12 -4
- package/dist/es/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/rules_core/inline.js +9 -5
- package/dist/es/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/rules_core/linkify.js +90 -20
- package/dist/es/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/rules_core/normalize.js +8 -5
- package/dist/es/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/rules_core/replacements.js +53 -17
- package/dist/es/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/rules_core/smartquotes.js +143 -50
- package/dist/es/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/rules_core/state_core.js +11 -7
- package/dist/es/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/rules_core/text_join.js +26 -10
- package/dist/es/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/rules_inline/autolink.js +57 -10
- package/dist/es/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/rules_inline/backticks.js +42 -16
- package/dist/es/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/rules_inline/balance_pairs.js +59 -16
- package/dist/es/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/rules_inline/emphasis.js +64 -24
- package/dist/es/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/rules_inline/entity.js +45 -13
- package/dist/es/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/rules_inline/escape.js +51 -16
- package/dist/es/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/rules_inline/fragments_join.js +21 -6
- package/dist/es/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/rules_inline/html_inline.js +37 -13
- package/dist/es/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/rules_inline/image.js +107 -32
- package/dist/es/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/rules_inline/link.js +100 -26
- package/dist/es/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/rules_inline/linkify.js +44 -4
- package/dist/es/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/rules_inline/newline.js +32 -19
- package/dist/es/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/rules_inline/state_inline.js +91 -23
- package/dist/es/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/rules_inline/strikethrough.js +79 -25
- package/dist/es/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/rules_inline/text.js +18 -9
- package/dist/es/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/token.js +52 -21
- package/dist/es/node_modules/.pnpm/mdurl@1.0.1/node_modules/mdurl/decode.js +74 -32
- package/dist/es/node_modules/.pnpm/mdurl@1.0.1/node_modules/mdurl/encode.js +54 -29
- package/dist/es/node_modules/.pnpm/mdurl@1.0.1/node_modules/mdurl/format.js +16 -4
- package/dist/es/node_modules/.pnpm/mdurl@1.0.1/node_modules/mdurl/index.js +10 -10
- package/dist/es/node_modules/.pnpm/mdurl@1.0.1/node_modules/mdurl/parse.js +158 -60
- package/dist/es/node_modules/.pnpm/prettier@2.8.4/node_modules/prettier/parser-html.js +2375 -2274
- package/dist/es/node_modules/.pnpm/prettier@2.8.4/node_modules/prettier/parser-typescript.js +23493 -23223
- package/dist/es/node_modules/.pnpm/prettier@2.8.4/node_modules/prettier/standalone.js +8281 -8174
- package/dist/es/node_modules/.pnpm/punycode@2.3.0/node_modules/punycode/punycode.es6.js +208 -107
- package/dist/es/node_modules/.pnpm/uc.micro@1.0.6/node_modules/uc.micro/categories/Cc/regex.js +9 -4
- package/dist/es/node_modules/.pnpm/uc.micro@1.0.6/node_modules/uc.micro/categories/Cf/regex.js +9 -4
- package/dist/es/node_modules/.pnpm/uc.micro@1.0.6/node_modules/uc.micro/categories/P/regex.js +2 -2
- package/dist/es/node_modules/.pnpm/uc.micro@1.0.6/node_modules/uc.micro/categories/Z/regex.js +9 -4
- package/dist/es/node_modules/.pnpm/uc.micro@1.0.6/node_modules/uc.micro/index.js +18 -10
- package/dist/es/node_modules/.pnpm/uc.micro@1.0.6/node_modules/uc.micro/properties/Any/regex.js +9 -4
- package/dist/es/packages/components/aside/index.vue.js +109 -79
- package/dist/es/packages/components/aside/index.vue2.js +2 -2
- package/dist/es/packages/components/boxurl/index.vue.js +55 -34
- package/dist/es/packages/components/boxurl/index.vue2.js +2 -2
- package/dist/es/packages/components/choice/choice.vue.js +43 -35
- package/dist/es/packages/components/choice/choice.vue2.js +2 -2
- package/dist/es/packages/components/choice/index.vue.js +69 -48
- package/dist/es/packages/components/choice/index.vue2.js +2 -2
- package/dist/es/packages/components/code/highlight.vue.js +11 -12
- package/dist/es/packages/components/code/highlight.vue2.js +4 -4
- package/dist/es/packages/components/code/index.vue.js +91 -74
- package/dist/es/packages/components/code/index.vue2.js +2 -2
- package/dist/es/packages/components/compo/ftable.vue.js +46 -32
- package/dist/es/packages/components/compo/ftable.vue2.js +2 -2
- package/dist/es/packages/components/compo/index.js +207 -135
- package/dist/es/packages/components/compo/index.vue.js +151 -121
- package/dist/es/packages/components/compo/index.vue2.js +2 -2
- package/dist/es/packages/components/compo/info.vue.js +43 -32
- package/dist/es/packages/components/compo/info.vue2.js +2 -2
- package/dist/es/packages/components/compo/top.js +114 -85
- package/dist/es/packages/components/header/index.vue.js +7 -8
- package/dist/es/packages/components/main/index.vue.js +59 -45
- package/dist/es/packages/components/main/index.vue2.js +2 -2
- package/dist/es/packages/components/md/index.vue.js +53 -45
- package/dist/es/packages/components/md/index.vue2.js +2 -2
- package/dist/es/packages/components/test/index.js +99 -70
- package/dist/es/packages/components/test/index.vue.js +91 -71
- package/dist/es/packages/components/test/index.vue2.js +2 -2
- package/dist/es/packages/components/test/top.js +128 -99
- package/dist/es/packages/components/use/index.js +109 -84
- package/dist/es/packages/components/use/retrie/any/index.vue.js +82 -63
- package/dist/es/packages/components/use/retrie/any/index.vue2.js +2 -2
- package/dist/es/packages/components/use/retrie/array/index.vue.js +54 -39
- package/dist/es/packages/components/use/retrie/array/index.vue2.js +2 -2
- package/dist/es/packages/components/use/retrie/boolean/index.vue.js +61 -43
- package/dist/es/packages/components/use/retrie/boolean/index.vue2.js +2 -2
- package/dist/es/packages/components/use/retrie/choice/index.vue.js +154 -96
- package/dist/es/packages/components/use/retrie/choice/index.vue2.js +2 -2
- package/dist/es/packages/components/use/retrie/choice/index.vue3.js +2 -2
- package/dist/es/packages/components/use/retrie/expose/index.vue.js +65 -47
- package/dist/es/packages/components/use/retrie/expose/index.vue2.js +2 -2
- package/dist/es/packages/components/use/retrie/form/index.vue.js +104 -96
- package/dist/es/packages/components/use/retrie/form/index.vue2.js +2 -2
- package/dist/es/packages/components/use/retrie/function/index.vue.js +60 -47
- package/dist/es/packages/components/use/retrie/function/index.vue2.js +2 -2
- package/dist/es/packages/components/use/retrie/index.vue.js +56 -47
- package/dist/es/packages/components/use/retrie/index.vue2.js +2 -2
- package/dist/es/packages/components/use/retrie/number/index.vue.js +41 -33
- package/dist/es/packages/components/use/retrie/number/index.vue2.js +2 -2
- package/dist/es/packages/components/use/retrie/object/index.vue.js +54 -39
- package/dist/es/packages/components/use/retrie/object/index.vue2.js +2 -2
- package/dist/es/packages/components/use/retrie/other/index.vue.js +54 -37
- package/dist/es/packages/components/use/retrie/other/index.vue2.js +2 -2
- package/dist/es/packages/components/use/retrie/select/index.vue.js +112 -79
- package/dist/es/packages/components/use/retrie/select/index.vue2.js +2 -2
- package/dist/es/packages/components/use/retrie/select/index.vue3.js +2 -2
- package/dist/es/packages/components/use/retrie/slot/index.vue.js +41 -33
- package/dist/es/packages/components/use/retrie/slot/index.vue2.js +2 -2
- package/dist/es/packages/components/use/retrie/string/index.vue.js +36 -27
- package/dist/es/packages/components/use/retrie/string/index.vue2.js +2 -2
- package/dist/es/packages/components/use/set-code.vue.js +148 -104
- package/dist/es/packages/components/use/set-code.vue2.js +2 -2
- package/dist/es/packages/components/use/set-emit.vue.js +46 -34
- package/dist/es/packages/components/use/set-emit.vue2.js +2 -2
- package/dist/es/packages/components/use/set-expose.vue.js +37 -30
- package/dist/es/packages/components/use/set-expose.vue2.js +2 -2
- package/dist/es/packages/components/use/set-props.vue.js +104 -66
- package/dist/es/packages/components/use/set-props.vue2.js +2 -2
- package/dist/es/packages/components/use/set-slot.vue.js +39 -34
- package/dist/es/packages/components/use/set-slot.vue2.js +2 -2
- package/dist/es/packages/components/use/util.js +156 -74
- package/dist/es/packages/config.d.ts +3 -3
- package/dist/es/packages/config.js +8 -8
- package/dist/es/packages/index/index.vue.js +10 -10
- package/dist/es/packages/index/index.vue2.js +2 -2
- package/dist/es/packages/index.js +9 -9
- package/dist/es/packages/page/compon/index.vue.js +2 -2
- package/dist/es/packages/page/compon/index.vue2.js +19 -17
- package/dist/es/packages/page/develop/index.vue.js +2 -2
- package/dist/es/packages/page/develop/index.vue2.js +19 -17
- package/dist/es/packages/page/index/index.vue.js +2 -2
- package/dist/es/packages/page/index/index.vue2.js +50 -38
- package/dist/es/packages/page/single/index.vue.js +2 -2
- package/dist/es/packages/page/single/index.vue2.js +75 -61
- package/dist/es/packages/page/tests/index.vue.js +2 -2
- package/dist/es/packages/page/tests/index.vue2.js +74 -49
- package/dist/es/packages/router/index.js +99 -62
- package/dist/es/packages/utils/common.js +138 -80
- package/dist/es/packages/utils/glob.js +480 -306
- package/dist/es/packages/utils/index.js +14 -13
- package/dist/es/packages/utils/props.js +171 -66
- package/dist/es/packages/utils/storage.js +27 -19
- package/dist/es/style.css +367 -2
- package/dist/lib/_virtual/_commonjsHelpers.js +38 -1
- package/dist/lib/_virtual/_plugin-vue_export-helper.js +9 -1
- package/dist/lib/_virtual/emphasis.js +4 -1
- package/dist/lib/_virtual/entities.js +12 -1
- package/dist/lib/_virtual/html_re.js +4 -1
- package/dist/lib/_virtual/index.js +12 -1
- package/dist/lib/_virtual/index2.js +4 -1
- package/dist/lib/_virtual/index3.js +4 -1
- package/dist/lib/_virtual/index4.js +4 -1
- package/dist/lib/_virtual/parser-html.js +12 -1
- package/dist/lib/_virtual/parser-typescript.js +12 -1
- package/dist/lib/_virtual/punycode.es6.js +5 -1
- package/dist/lib/_virtual/standalone.js +12 -1
- package/dist/lib/_virtual/strikethrough.js +4 -1
- package/dist/lib/_virtual/utils.js +4 -1
- package/dist/lib/node_modules/.pnpm/@fangzhongya_utils@0.0.7-10/node_modules/@fangzhongya/utils/dist/chunk-4OBNLDTJ.js +6 -1
- package/dist/lib/node_modules/.pnpm/@fangzhongya_utils@0.0.7-10/node_modules/@fangzhongya/utils/dist/chunk-EWJJKQIO.js +6 -1
- package/dist/lib/node_modules/.pnpm/@fangzhongya_utils@0.0.7-10/node_modules/@fangzhongya/utils/dist/chunk-GOJN3OQ4.js +20 -1
- package/dist/lib/node_modules/.pnpm/@fangzhongya_utils@0.0.7-10/node_modules/@fangzhongya/utils/dist/chunk-J7CICTHH.js +23 -1
- package/dist/lib/node_modules/.pnpm/@fangzhongya_utils@0.0.7-10/node_modules/@fangzhongya/utils/dist/chunk-RD4EP3M5.js +44 -1
- package/dist/lib/node_modules/.pnpm/@fangzhongya_utils@0.0.7-10/node_modules/@fangzhongya/utils/dist/chunk-SNABGVNO.js +12 -1
- package/dist/lib/node_modules/.pnpm/@fangzhongya_utils@0.0.7-10/node_modules/@fangzhongya/utils/dist/chunk-XCDKXZFR.js +11 -1
- package/dist/lib/node_modules/.pnpm/@fangzhongya_utils@0.0.7-10/node_modules/@fangzhongya/utils/dist/chunk-XQB2HUHZ.js +21 -1
- package/dist/lib/node_modules/.pnpm/@fangzhongya_utils@0.0.7-10/node_modules/@fangzhongya/utils/dist/chunk-ZVBCHJA5.js +16 -1
- package/dist/lib/node_modules/.pnpm/@highlightjs_vue-plugin@2.1.0_jsvakxz56e7tk77soxhxnrhzhm/node_modules/@highlightjs/vue-plugin/dist/highlightjs-vue.esm.min.js +34 -1
- package/dist/lib/node_modules/.pnpm/comment-parser@1.3.1/node_modules/comment-parser/es6/index.js +15 -1
- package/dist/lib/node_modules/.pnpm/comment-parser@1.3.1/node_modules/comment-parser/es6/parser/block-parser.js +25 -1
- package/dist/lib/node_modules/.pnpm/comment-parser@1.3.1/node_modules/comment-parser/es6/parser/index.js +41 -1
- package/dist/lib/node_modules/.pnpm/comment-parser@1.3.1/node_modules/comment-parser/es6/parser/source-parser.js +44 -1
- package/dist/lib/node_modules/.pnpm/comment-parser@1.3.1/node_modules/comment-parser/es6/parser/spec-parser.js +15 -1
- package/dist/lib/node_modules/.pnpm/comment-parser@1.3.1/node_modules/comment-parser/es6/parser/tokenizers/description.js +35 -2
- package/dist/lib/node_modules/.pnpm/comment-parser@1.3.1/node_modules/comment-parser/es6/parser/tokenizers/name.js +83 -1
- package/dist/lib/node_modules/.pnpm/comment-parser@1.3.1/node_modules/comment-parser/es6/parser/tokenizers/tag.js +22 -1
- package/dist/lib/node_modules/.pnpm/comment-parser@1.3.1/node_modules/comment-parser/es6/parser/tokenizers/type.js +60 -2
- package/dist/lib/node_modules/.pnpm/comment-parser@1.3.1/node_modules/comment-parser/es6/primitives.js +9 -1
- package/dist/lib/node_modules/.pnpm/comment-parser@1.3.1/node_modules/comment-parser/es6/transforms/align.js +14 -1
- package/dist/lib/node_modules/.pnpm/comment-parser@1.3.1/node_modules/comment-parser/es6/transforms/crlf.js +13 -1
- package/dist/lib/node_modules/.pnpm/comment-parser@1.3.1/node_modules/comment-parser/es6/transforms/indent.js +13 -1
- package/dist/lib/node_modules/.pnpm/comment-parser@1.3.1/node_modules/comment-parser/es6/util.js +28 -1
- package/dist/lib/node_modules/.pnpm/entities@3.0.1/node_modules/entities/lib/maps/entities.json.js +6376 -2
- package/dist/lib/node_modules/.pnpm/es-module-lexer@1.1.1/node_modules/es-module-lexer/dist/lexer.js +50 -3
- package/dist/lib/node_modules/.pnpm/highlight.js@11.7.0/node_modules/highlight.js/es/common.js +5 -1
- package/dist/lib/node_modules/.pnpm/highlight.js@11.7.0/node_modules/highlight.js/es/core.js +5 -1
- package/dist/lib/node_modules/.pnpm/highlight.js@11.7.0/node_modules/highlight.js/lib/common.js +80 -1
- package/dist/lib/node_modules/.pnpm/highlight.js@11.7.0/node_modules/highlight.js/lib/core.js +1573 -2
- package/dist/lib/node_modules/.pnpm/highlight.js@11.7.0/node_modules/highlight.js/lib/languages/bash.js +381 -1
- package/dist/lib/node_modules/.pnpm/highlight.js@11.7.0/node_modules/highlight.js/lib/languages/c.js +289 -1
- package/dist/lib/node_modules/.pnpm/highlight.js@11.7.0/node_modules/highlight.js/lib/languages/cpp.js +544 -1
- package/dist/lib/node_modules/.pnpm/highlight.js@11.7.0/node_modules/highlight.js/lib/languages/csharp.js +398 -1
- package/dist/lib/node_modules/.pnpm/highlight.js@11.7.0/node_modules/highlight.js/lib/languages/css.js +741 -1
- package/dist/lib/node_modules/.pnpm/highlight.js@11.7.0/node_modules/highlight.js/lib/languages/diff.js +63 -1
- package/dist/lib/node_modules/.pnpm/highlight.js@11.7.0/node_modules/highlight.js/lib/languages/go.js +144 -1
- package/dist/lib/node_modules/.pnpm/highlight.js@11.7.0/node_modules/highlight.js/lib/languages/graphql.js +80 -1
- package/dist/lib/node_modules/.pnpm/highlight.js@11.7.0/node_modules/highlight.js/lib/languages/ini.js +126 -1
- package/dist/lib/node_modules/.pnpm/highlight.js@11.7.0/node_modules/highlight.js/lib/languages/java.js +263 -1
- package/dist/lib/node_modules/.pnpm/highlight.js@11.7.0/node_modules/highlight.js/lib/languages/javascript.js +691 -1
- package/dist/lib/node_modules/.pnpm/highlight.js@11.7.0/node_modules/highlight.js/lib/languages/json.js +49 -1
- package/dist/lib/node_modules/.pnpm/highlight.js@11.7.0/node_modules/highlight.js/lib/languages/kotlin.js +265 -2
- package/dist/lib/node_modules/.pnpm/highlight.js@11.7.0/node_modules/highlight.js/lib/languages/less.js +822 -1
- package/dist/lib/node_modules/.pnpm/highlight.js@11.7.0/node_modules/highlight.js/lib/languages/lua.js +70 -1
- package/dist/lib/node_modules/.pnpm/highlight.js@11.7.0/node_modules/highlight.js/lib/languages/makefile.js +77 -1
- package/dist/lib/node_modules/.pnpm/highlight.js@11.7.0/node_modules/highlight.js/lib/languages/markdown.js +236 -1
- package/dist/lib/node_modules/.pnpm/highlight.js@11.7.0/node_modules/highlight.js/lib/languages/objectivec.js +253 -1
- package/dist/lib/node_modules/.pnpm/highlight.js@11.7.0/node_modules/highlight.js/lib/languages/perl.js +461 -1
- package/dist/lib/node_modules/.pnpm/highlight.js@11.7.0/node_modules/highlight.js/lib/languages/php-template.js +56 -1
- package/dist/lib/node_modules/.pnpm/highlight.js@11.7.0/node_modules/highlight.js/lib/languages/php.js +586 -2
- package/dist/lib/node_modules/.pnpm/highlight.js@11.7.0/node_modules/highlight.js/lib/languages/plaintext.js +22 -1
- package/dist/lib/node_modules/.pnpm/highlight.js@11.7.0/node_modules/highlight.js/lib/languages/python-repl.js +35 -1
- package/dist/lib/node_modules/.pnpm/highlight.js@11.7.0/node_modules/highlight.js/lib/languages/python.js +423 -1
- package/dist/lib/node_modules/.pnpm/highlight.js@11.7.0/node_modules/highlight.js/lib/languages/r.js +220 -1
- package/dist/lib/node_modules/.pnpm/highlight.js@11.7.0/node_modules/highlight.js/lib/languages/ruby.js +423 -1
- package/dist/lib/node_modules/.pnpm/highlight.js@11.7.0/node_modules/highlight.js/lib/languages/rust.js +305 -1
- package/dist/lib/node_modules/.pnpm/highlight.js@11.7.0/node_modules/highlight.js/lib/languages/scss.js +726 -1
- package/dist/lib/node_modules/.pnpm/highlight.js@11.7.0/node_modules/highlight.js/lib/languages/shell.js +34 -1
- package/dist/lib/node_modules/.pnpm/highlight.js@11.7.0/node_modules/highlight.js/lib/languages/sql.js +648 -1
- package/dist/lib/node_modules/.pnpm/highlight.js@11.7.0/node_modules/highlight.js/lib/languages/swift.js +785 -1
- package/dist/lib/node_modules/.pnpm/highlight.js@11.7.0/node_modules/highlight.js/lib/languages/typescript.js +779 -1
- package/dist/lib/node_modules/.pnpm/highlight.js@11.7.0/node_modules/highlight.js/lib/languages/vbnet.js +143 -1
- package/dist/lib/node_modules/.pnpm/highlight.js@11.7.0/node_modules/highlight.js/lib/languages/wasm.js +131 -1
- package/dist/lib/node_modules/.pnpm/highlight.js@11.7.0/node_modules/highlight.js/lib/languages/xml.js +236 -1
- package/dist/lib/node_modules/.pnpm/highlight.js@11.7.0/node_modules/highlight.js/lib/languages/yaml.js +194 -1
- package/dist/lib/node_modules/.pnpm/highlight.js@11.7.0/node_modules/highlight.js/styles/stackoverflow-light.css.js +3 -1
- package/dist/lib/node_modules/.pnpm/linkify-it@4.0.1/node_modules/linkify-it/index.js +354 -1
- package/dist/lib/node_modules/.pnpm/linkify-it@4.0.1/node_modules/linkify-it/lib/re.js +54 -1
- package/dist/lib/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/index.js +9 -1
- package/dist/lib/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/common/entities.js +6 -1
- package/dist/lib/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/common/html_blocks.js +66 -1
- package/dist/lib/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/common/html_re.js +19 -1
- package/dist/lib/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/common/utils.js +226 -1
- package/dist/lib/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/helpers/index.js +9 -1
- package/dist/lib/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/helpers/parse_link_destination.js +78 -1
- package/dist/lib/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/helpers/parse_link_label.js +32 -1
- package/dist/lib/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/helpers/parse_link_title.js +45 -1
- package/dist/lib/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/index.js +181 -1
- package/dist/lib/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/parser_block.js +79 -1
- package/dist/lib/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/parser_core.js +38 -1
- package/dist/lib/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/parser_inline.js +112 -1
- package/dist/lib/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/presets/commonmark.js +77 -1
- package/dist/lib/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/presets/default.js +39 -1
- package/dist/lib/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/presets/zero.js +58 -1
- package/dist/lib/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/renderer.js +150 -13
- package/dist/lib/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/ruler.js +143 -1
- package/dist/lib/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/rules_block/blockquote.js +160 -1
- package/dist/lib/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/rules_block/code.js +26 -2
- package/dist/lib/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/rules_block/fence.js +67 -1
- package/dist/lib/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/rules_block/heading.js +43 -1
- package/dist/lib/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/rules_block/hr.js +36 -1
- package/dist/lib/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/rules_block/html_block.js +62 -1
- package/dist/lib/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/rules_block/lheading.js +59 -1
- package/dist/lib/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/rules_block/list.js +220 -1
- package/dist/lib/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/rules_block/paragraph.js +36 -1
- package/dist/lib/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/rules_block/reference.js +152 -1
- package/dist/lib/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/rules_block/state_block.js +167 -1
- package/dist/lib/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/rules_block/table.js +184 -1
- package/dist/lib/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/rules_core/block.js +14 -1
- package/dist/lib/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/rules_core/inline.js +11 -1
- package/dist/lib/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/rules_core/linkify.js +100 -1
- package/dist/lib/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/rules_core/normalize.js +10 -2
- package/dist/lib/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/rules_core/replacements.js +62 -1
- package/dist/lib/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/rules_core/smartquotes.js +157 -1
- package/dist/lib/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/rules_core/state_core.js +13 -1
- package/dist/lib/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/rules_core/text_join.js +29 -1
- package/dist/lib/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/rules_inline/autolink.js +61 -1
- package/dist/lib/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/rules_inline/backticks.js +45 -1
- package/dist/lib/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/rules_inline/balance_pairs.js +65 -1
- package/dist/lib/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/rules_inline/emphasis.js +82 -1
- package/dist/lib/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/rules_inline/entity.js +49 -1
- package/dist/lib/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/rules_inline/escape.js +56 -1
- package/dist/lib/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/rules_inline/fragments_join.js +23 -1
- package/dist/lib/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/rules_inline/html_inline.js +43 -1
- package/dist/lib/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/rules_inline/image.js +112 -1
- package/dist/lib/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/rules_inline/link.js +105 -1
- package/dist/lib/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/rules_inline/linkify.js +46 -1
- package/dist/lib/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/rules_inline/newline.js +35 -1
- package/dist/lib/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/rules_inline/state_inline.js +98 -1
- package/dist/lib/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/rules_inline/strikethrough.js +88 -1
- package/dist/lib/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/rules_inline/text.js +46 -1
- package/dist/lib/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/lib/token.js +61 -1
- package/dist/lib/node_modules/.pnpm/mdurl@1.0.1/node_modules/mdurl/decode.js +84 -1
- package/dist/lib/node_modules/.pnpm/mdurl@1.0.1/node_modules/mdurl/encode.js +64 -1
- package/dist/lib/node_modules/.pnpm/mdurl@1.0.1/node_modules/mdurl/format.js +18 -1
- package/dist/lib/node_modules/.pnpm/mdurl@1.0.1/node_modules/mdurl/index.js +11 -1
- package/dist/lib/node_modules/.pnpm/mdurl@1.0.1/node_modules/mdurl/parse.js +171 -2
- package/dist/lib/node_modules/.pnpm/prettier@2.8.4/node_modules/prettier/parser-html.js +3149 -20
- package/dist/lib/node_modules/.pnpm/prettier@2.8.4/node_modules/prettier/parser-typescript.js +33275 -78
- package/dist/lib/node_modules/.pnpm/prettier@2.8.4/node_modules/prettier/standalone.js +11383 -88
- package/dist/lib/node_modules/.pnpm/punycode@2.3.0/node_modules/punycode/punycode.es6.js +240 -1
- package/dist/lib/node_modules/.pnpm/uc.micro@1.0.6/node_modules/uc.micro/categories/Cc/regex.js +12 -1
- package/dist/lib/node_modules/.pnpm/uc.micro@1.0.6/node_modules/uc.micro/categories/Cf/regex.js +12 -1
- package/dist/lib/node_modules/.pnpm/uc.micro@1.0.6/node_modules/uc.micro/categories/P/regex.js +3 -1
- package/dist/lib/node_modules/.pnpm/uc.micro@1.0.6/node_modules/uc.micro/categories/Z/regex.js +12 -1
- package/dist/lib/node_modules/.pnpm/uc.micro@1.0.6/node_modules/uc.micro/index.js +21 -1
- package/dist/lib/node_modules/.pnpm/uc.micro@1.0.6/node_modules/uc.micro/properties/Any/regex.js +12 -1
- package/dist/lib/packages/components/aside/index.vue.js +133 -1
- package/dist/lib/packages/components/aside/index.vue2.js +3 -1
- package/dist/lib/packages/components/boxurl/index.vue.js +78 -1
- package/dist/lib/packages/components/boxurl/index.vue2.js +3 -1
- package/dist/lib/packages/components/choice/choice.vue.js +58 -1
- package/dist/lib/packages/components/choice/choice.vue2.js +3 -1
- package/dist/lib/packages/components/choice/index.vue.js +99 -1
- package/dist/lib/packages/components/choice/index.vue2.js +3 -1
- package/dist/lib/packages/components/code/highlight.vue.js +15 -1
- package/dist/lib/packages/components/code/highlight.vue2.js +17 -1
- package/dist/lib/packages/components/code/index.vue.js +131 -1
- package/dist/lib/packages/components/code/index.vue2.js +3 -1
- package/dist/lib/packages/components/compo/ftable.vue.js +77 -1
- package/dist/lib/packages/components/compo/ftable.vue2.js +3 -1
- package/dist/lib/packages/components/compo/index.js +290 -1
- package/dist/lib/packages/components/compo/index.vue.js +226 -1
- package/dist/lib/packages/components/compo/index.vue2.js +3 -1
- package/dist/lib/packages/components/compo/info.vue.js +56 -1
- package/dist/lib/packages/components/compo/info.vue2.js +3 -1
- package/dist/lib/packages/components/compo/top.js +151 -1
- package/dist/lib/packages/components/header/index.vue.js +9 -1
- package/dist/lib/packages/components/main/index.vue.js +71 -1
- package/dist/lib/packages/components/main/index.vue2.js +3 -1
- package/dist/lib/packages/components/md/index.vue.js +70 -1
- package/dist/lib/packages/components/md/index.vue2.js +3 -1
- package/dist/lib/packages/components/test/index.js +129 -1
- package/dist/lib/packages/components/test/index.vue.js +108 -1
- package/dist/lib/packages/components/test/index.vue2.js +3 -1
- package/dist/lib/packages/components/test/top.js +187 -1
- package/dist/lib/packages/components/use/index.js +202 -1
- package/dist/lib/packages/components/use/retrie/any/index.vue.js +153 -1
- package/dist/lib/packages/components/use/retrie/any/index.vue2.js +3 -1
- package/dist/lib/packages/components/use/retrie/array/index.vue.js +79 -5
- package/dist/lib/packages/components/use/retrie/array/index.vue2.js +3 -1
- package/dist/lib/packages/components/use/retrie/boolean/index.vue.js +90 -1
- package/dist/lib/packages/components/use/retrie/boolean/index.vue2.js +3 -1
- package/dist/lib/packages/components/use/retrie/choice/index.vue.js +207 -3
- package/dist/lib/packages/components/use/retrie/choice/index.vue2.js +3 -1
- package/dist/lib/packages/components/use/retrie/choice/index.vue3.js +4 -1
- package/dist/lib/packages/components/use/retrie/expose/index.vue.js +89 -1
- package/dist/lib/packages/components/use/retrie/expose/index.vue2.js +3 -1
- package/dist/lib/packages/components/use/retrie/form/index.vue.js +159 -1
- package/dist/lib/packages/components/use/retrie/form/index.vue2.js +3 -1
- package/dist/lib/packages/components/use/retrie/function/index.vue.js +94 -3
- package/dist/lib/packages/components/use/retrie/function/index.vue2.js +3 -1
- package/dist/lib/packages/components/use/retrie/index.vue.js +112 -1
- package/dist/lib/packages/components/use/retrie/index.vue2.js +3 -1
- package/dist/lib/packages/components/use/retrie/number/index.vue.js +58 -1
- package/dist/lib/packages/components/use/retrie/number/index.vue2.js +3 -1
- package/dist/lib/packages/components/use/retrie/object/index.vue.js +79 -5
- package/dist/lib/packages/components/use/retrie/object/index.vue2.js +3 -1
- package/dist/lib/packages/components/use/retrie/other/index.vue.js +93 -3
- package/dist/lib/packages/components/use/retrie/other/index.vue2.js +3 -1
- package/dist/lib/packages/components/use/retrie/select/index.vue.js +160 -1
- package/dist/lib/packages/components/use/retrie/select/index.vue2.js +3 -1
- package/dist/lib/packages/components/use/retrie/select/index.vue3.js +4 -1
- package/dist/lib/packages/components/use/retrie/slot/index.vue.js +57 -1
- package/dist/lib/packages/components/use/retrie/slot/index.vue2.js +3 -1
- package/dist/lib/packages/components/use/retrie/string/index.vue.js +62 -1
- package/dist/lib/packages/components/use/retrie/string/index.vue2.js +3 -1
- package/dist/lib/packages/components/use/set-code.vue.js +182 -12
- package/dist/lib/packages/components/use/set-code.vue2.js +3 -1
- package/dist/lib/packages/components/use/set-emit.vue.js +63 -1
- package/dist/lib/packages/components/use/set-emit.vue2.js +3 -1
- package/dist/lib/packages/components/use/set-expose.vue.js +52 -1
- package/dist/lib/packages/components/use/set-expose.vue2.js +3 -1
- package/dist/lib/packages/components/use/set-props.vue.js +131 -1
- package/dist/lib/packages/components/use/set-props.vue2.js +3 -1
- package/dist/lib/packages/components/use/set-slot.vue.js +52 -1
- package/dist/lib/packages/components/use/set-slot.vue2.js +3 -1
- package/dist/lib/packages/components/use/util.js +181 -4
- package/dist/lib/packages/config.d.ts +3 -3
- package/dist/lib/packages/config.js +14 -1
- package/dist/lib/packages/index/index.vue.js +14 -1
- package/dist/lib/packages/index/index.vue2.js +3 -1
- package/dist/lib/packages/index.js +14 -1
- package/dist/lib/packages/page/compon/index.vue.js +3 -1
- package/dist/lib/packages/page/compon/index.vue2.js +23 -1
- package/dist/lib/packages/page/develop/index.vue.js +3 -1
- package/dist/lib/packages/page/develop/index.vue2.js +23 -1
- package/dist/lib/packages/page/index/index.vue.js +3 -1
- package/dist/lib/packages/page/index/index.vue2.js +62 -1
- package/dist/lib/packages/page/single/index.vue.js +3 -1
- package/dist/lib/packages/page/single/index.vue2.js +86 -1
- package/dist/lib/packages/page/tests/index.vue.js +3 -1
- package/dist/lib/packages/page/tests/index.vue2.js +94 -1
- package/dist/lib/packages/router/index.js +173 -1
- package/dist/lib/packages/utils/common.js +166 -1
- package/dist/lib/packages/utils/glob.js +561 -2
- package/dist/lib/packages/utils/index.js +19 -1
- package/dist/lib/packages/utils/props.js +197 -1
- package/dist/lib/packages/utils/storage.js +42 -1
- package/package.json +9 -10
- package/dist/es/node_modules/.pnpm/@vue_compiler-core@3.2.47/node_modules/@vue/compiler-core/dist/compiler-core.esm-bundler.js +0 -2881
- package/dist/es/node_modules/.pnpm/@vue_compiler-dom@3.2.47/node_modules/@vue/compiler-dom/dist/compiler-dom.esm-bundler.js +0 -408
- package/dist/es/node_modules/.pnpm/@vue_reactivity@3.2.47/node_modules/@vue/reactivity/dist/reactivity.esm-bundler.js +0 -700
- package/dist/es/node_modules/.pnpm/@vue_runtime-core@3.2.47/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js +0 -3908
- package/dist/es/node_modules/.pnpm/@vue_runtime-dom@3.2.47/node_modules/@vue/runtime-dom/dist/runtime-dom.esm-bundler.js +0 -1023
- package/dist/es/node_modules/.pnpm/@vue_shared@3.2.47/node_modules/@vue/shared/dist/shared.esm-bundler.js +0 -280
- package/dist/es/node_modules/.pnpm/vue@3.2.47/node_modules/vue/dist/vue.esm-bundler.js +0 -163
- package/dist/lib/node_modules/.pnpm/@vue_compiler-core@3.2.47/node_modules/@vue/compiler-core/dist/compiler-core.esm-bundler.js +0 -9
- package/dist/lib/node_modules/.pnpm/@vue_compiler-dom@3.2.47/node_modules/@vue/compiler-dom/dist/compiler-dom.esm-bundler.js +0 -1
- package/dist/lib/node_modules/.pnpm/@vue_reactivity@3.2.47/node_modules/@vue/reactivity/dist/reactivity.esm-bundler.js +0 -1
- package/dist/lib/node_modules/.pnpm/@vue_runtime-core@3.2.47/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js +0 -14
- package/dist/lib/node_modules/.pnpm/@vue_runtime-dom@3.2.47/node_modules/@vue/runtime-dom/dist/runtime-dom.esm-bundler.js +0 -1
- package/dist/lib/node_modules/.pnpm/@vue_shared@3.2.47/node_modules/@vue/shared/dist/shared.esm-bundler.js +0 -2
- package/dist/lib/node_modules/.pnpm/vue@3.2.47/node_modules/vue/dist/vue.esm-bundler.js +0 -2
package/dist/es/node_modules/.pnpm/highlight.js@11.7.0/node_modules/highlight.js/lib/core.js
CHANGED
|
@@ -1,83 +1,113 @@
|
|
|
1
|
-
var
|
|
2
|
-
function
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
var deepFreezeEs6 = { exports: {} };
|
|
2
|
+
function deepFreeze(obj) {
|
|
3
|
+
if (obj instanceof Map) {
|
|
4
|
+
obj.clear = obj.delete = obj.set = function() {
|
|
5
|
+
throw new Error("map is read-only");
|
|
6
|
+
};
|
|
7
|
+
} else if (obj instanceof Set) {
|
|
8
|
+
obj.add = obj.clear = obj.delete = function() {
|
|
9
|
+
throw new Error("set is read-only");
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
Object.freeze(obj);
|
|
13
|
+
Object.getOwnPropertyNames(obj).forEach(function(name) {
|
|
14
|
+
var prop = obj[name];
|
|
15
|
+
if (typeof prop == "object" && !Object.isFrozen(prop)) {
|
|
16
|
+
deepFreeze(prop);
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
return obj;
|
|
11
20
|
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
class
|
|
21
|
+
deepFreezeEs6.exports = deepFreeze;
|
|
22
|
+
deepFreezeEs6.exports.default = deepFreeze;
|
|
23
|
+
class Response {
|
|
15
24
|
/**
|
|
16
25
|
* @param {CompiledMode} mode
|
|
17
26
|
*/
|
|
18
|
-
constructor(
|
|
19
|
-
|
|
27
|
+
constructor(mode) {
|
|
28
|
+
if (mode.data === void 0)
|
|
29
|
+
mode.data = {};
|
|
30
|
+
this.data = mode.data;
|
|
31
|
+
this.isMatchIgnored = false;
|
|
20
32
|
}
|
|
21
33
|
ignoreMatch() {
|
|
22
|
-
this.isMatchIgnored =
|
|
34
|
+
this.isMatchIgnored = true;
|
|
23
35
|
}
|
|
24
36
|
}
|
|
25
|
-
function
|
|
26
|
-
return
|
|
37
|
+
function escapeHTML(value) {
|
|
38
|
+
return value.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
27
39
|
}
|
|
28
|
-
function
|
|
29
|
-
const
|
|
30
|
-
for (const
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
40
|
+
function inherit$1(original, ...objects) {
|
|
41
|
+
const result = /* @__PURE__ */ Object.create(null);
|
|
42
|
+
for (const key in original) {
|
|
43
|
+
result[key] = original[key];
|
|
44
|
+
}
|
|
45
|
+
objects.forEach(function(obj) {
|
|
46
|
+
for (const key in obj) {
|
|
47
|
+
result[key] = obj[key];
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
return (
|
|
51
|
+
/** @type {T} */
|
|
52
|
+
result
|
|
53
|
+
);
|
|
37
54
|
}
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
|
|
55
|
+
const SPAN_CLOSE = "</span>";
|
|
56
|
+
const emitsWrappingTags = (node) => {
|
|
57
|
+
return !!node.scope || node.sublanguage && node.language;
|
|
58
|
+
};
|
|
59
|
+
const scopeToCSSClass = (name, { prefix }) => {
|
|
60
|
+
if (name.includes(".")) {
|
|
61
|
+
const pieces = name.split(".");
|
|
41
62
|
return [
|
|
42
|
-
`${
|
|
43
|
-
...
|
|
63
|
+
`${prefix}${pieces.shift()}`,
|
|
64
|
+
...pieces.map((x, i) => `${x}${"_".repeat(i + 1)}`)
|
|
44
65
|
].join(" ");
|
|
45
66
|
}
|
|
46
|
-
return `${
|
|
67
|
+
return `${prefix}${name}`;
|
|
47
68
|
};
|
|
48
|
-
class
|
|
69
|
+
class HTMLRenderer {
|
|
49
70
|
/**
|
|
50
71
|
* Creates a new HTMLRenderer
|
|
51
72
|
*
|
|
52
73
|
* @param {Tree} parseTree - the parse tree (must support `walk` API)
|
|
53
74
|
* @param {{classPrefix: string}} options
|
|
54
75
|
*/
|
|
55
|
-
constructor(
|
|
56
|
-
this.buffer = ""
|
|
76
|
+
constructor(parseTree, options) {
|
|
77
|
+
this.buffer = "";
|
|
78
|
+
this.classPrefix = options.classPrefix;
|
|
79
|
+
parseTree.walk(this);
|
|
57
80
|
}
|
|
58
81
|
/**
|
|
59
82
|
* Adds texts to the output stream
|
|
60
83
|
*
|
|
61
84
|
* @param {string} text */
|
|
62
|
-
addText(
|
|
63
|
-
this.buffer +=
|
|
85
|
+
addText(text) {
|
|
86
|
+
this.buffer += escapeHTML(text);
|
|
64
87
|
}
|
|
65
88
|
/**
|
|
66
89
|
* Adds a node open to the output stream (if needed)
|
|
67
90
|
*
|
|
68
91
|
* @param {Node} node */
|
|
69
|
-
openNode(
|
|
70
|
-
if (!
|
|
92
|
+
openNode(node) {
|
|
93
|
+
if (!emitsWrappingTags(node))
|
|
71
94
|
return;
|
|
72
|
-
let
|
|
73
|
-
|
|
95
|
+
let className = "";
|
|
96
|
+
if (node.sublanguage) {
|
|
97
|
+
className = `language-${node.language}`;
|
|
98
|
+
} else {
|
|
99
|
+
className = scopeToCSSClass(node.scope, { prefix: this.classPrefix });
|
|
100
|
+
}
|
|
101
|
+
this.span(className);
|
|
74
102
|
}
|
|
75
103
|
/**
|
|
76
104
|
* Adds a node close to the output stream (if needed)
|
|
77
105
|
*
|
|
78
106
|
* @param {Node} node */
|
|
79
|
-
closeNode(
|
|
80
|
-
|
|
107
|
+
closeNode(node) {
|
|
108
|
+
if (!emitsWrappingTags(node))
|
|
109
|
+
return;
|
|
110
|
+
this.buffer += SPAN_CLOSE;
|
|
81
111
|
}
|
|
82
112
|
/**
|
|
83
113
|
* returns the accumulated buffer
|
|
@@ -90,17 +120,19 @@ class qe {
|
|
|
90
120
|
* Builds a span element
|
|
91
121
|
*
|
|
92
122
|
* @param {string} className */
|
|
93
|
-
span(
|
|
94
|
-
this.buffer += `<span class="${
|
|
123
|
+
span(className) {
|
|
124
|
+
this.buffer += `<span class="${className}">`;
|
|
95
125
|
}
|
|
96
126
|
}
|
|
97
|
-
const
|
|
98
|
-
const
|
|
99
|
-
|
|
127
|
+
const newNode = (opts = {}) => {
|
|
128
|
+
const result = { children: [] };
|
|
129
|
+
Object.assign(result, opts);
|
|
130
|
+
return result;
|
|
100
131
|
};
|
|
101
|
-
class
|
|
132
|
+
class TokenTree {
|
|
102
133
|
constructor() {
|
|
103
|
-
this.rootNode =
|
|
134
|
+
this.rootNode = newNode();
|
|
135
|
+
this.stack = [this.rootNode];
|
|
104
136
|
}
|
|
105
137
|
get top() {
|
|
106
138
|
return this.stack[this.stack.length - 1];
|
|
@@ -109,20 +141,23 @@ class ie {
|
|
|
109
141
|
return this.rootNode;
|
|
110
142
|
}
|
|
111
143
|
/** @param {Node} node */
|
|
112
|
-
add(
|
|
113
|
-
this.top.children.push(
|
|
144
|
+
add(node) {
|
|
145
|
+
this.top.children.push(node);
|
|
114
146
|
}
|
|
115
147
|
/** @param {string} scope */
|
|
116
|
-
openNode(
|
|
117
|
-
const
|
|
118
|
-
this.add(
|
|
148
|
+
openNode(scope) {
|
|
149
|
+
const node = newNode({ scope });
|
|
150
|
+
this.add(node);
|
|
151
|
+
this.stack.push(node);
|
|
119
152
|
}
|
|
120
153
|
closeNode() {
|
|
121
|
-
if (this.stack.length > 1)
|
|
154
|
+
if (this.stack.length > 1) {
|
|
122
155
|
return this.stack.pop();
|
|
156
|
+
}
|
|
157
|
+
return void 0;
|
|
123
158
|
}
|
|
124
159
|
closeAllNodes() {
|
|
125
|
-
|
|
160
|
+
while (this.closeNode())
|
|
126
161
|
;
|
|
127
162
|
}
|
|
128
163
|
toJSON() {
|
|
@@ -132,161 +167,226 @@ class ie {
|
|
|
132
167
|
* @typedef { import("./html_renderer").Renderer } Renderer
|
|
133
168
|
* @param {Renderer} builder
|
|
134
169
|
*/
|
|
135
|
-
walk(
|
|
136
|
-
return this.constructor._walk(
|
|
170
|
+
walk(builder) {
|
|
171
|
+
return this.constructor._walk(builder, this.rootNode);
|
|
137
172
|
}
|
|
138
173
|
/**
|
|
139
174
|
* @param {Renderer} builder
|
|
140
175
|
* @param {Node} node
|
|
141
176
|
*/
|
|
142
|
-
static _walk(
|
|
143
|
-
|
|
177
|
+
static _walk(builder, node) {
|
|
178
|
+
if (typeof node === "string") {
|
|
179
|
+
builder.addText(node);
|
|
180
|
+
} else if (node.children) {
|
|
181
|
+
builder.openNode(node);
|
|
182
|
+
node.children.forEach((child) => this._walk(builder, child));
|
|
183
|
+
builder.closeNode(node);
|
|
184
|
+
}
|
|
185
|
+
return builder;
|
|
144
186
|
}
|
|
145
187
|
/**
|
|
146
188
|
* @param {Node} node
|
|
147
189
|
*/
|
|
148
|
-
static _collapse(
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
190
|
+
static _collapse(node) {
|
|
191
|
+
if (typeof node === "string")
|
|
192
|
+
return;
|
|
193
|
+
if (!node.children)
|
|
194
|
+
return;
|
|
195
|
+
if (node.children.every((el) => typeof el === "string")) {
|
|
196
|
+
node.children = [node.children.join("")];
|
|
197
|
+
} else {
|
|
198
|
+
node.children.forEach((child) => {
|
|
199
|
+
TokenTree._collapse(child);
|
|
200
|
+
});
|
|
201
|
+
}
|
|
152
202
|
}
|
|
153
203
|
}
|
|
154
|
-
class
|
|
204
|
+
class TokenTreeEmitter extends TokenTree {
|
|
155
205
|
/**
|
|
156
206
|
* @param {*} options
|
|
157
207
|
*/
|
|
158
|
-
constructor(
|
|
159
|
-
super()
|
|
208
|
+
constructor(options) {
|
|
209
|
+
super();
|
|
210
|
+
this.options = options;
|
|
160
211
|
}
|
|
161
212
|
/**
|
|
162
213
|
* @param {string} text
|
|
163
214
|
* @param {string} scope
|
|
164
215
|
*/
|
|
165
|
-
addKeyword(
|
|
166
|
-
|
|
216
|
+
addKeyword(text, scope) {
|
|
217
|
+
if (text === "") {
|
|
218
|
+
return;
|
|
219
|
+
}
|
|
220
|
+
this.openNode(scope);
|
|
221
|
+
this.addText(text);
|
|
222
|
+
this.closeNode();
|
|
167
223
|
}
|
|
168
224
|
/**
|
|
169
225
|
* @param {string} text
|
|
170
226
|
*/
|
|
171
|
-
addText(
|
|
172
|
-
|
|
227
|
+
addText(text) {
|
|
228
|
+
if (text === "") {
|
|
229
|
+
return;
|
|
230
|
+
}
|
|
231
|
+
this.add(text);
|
|
173
232
|
}
|
|
174
233
|
/**
|
|
175
234
|
* @param {Emitter & {root: DataNode}} emitter
|
|
176
235
|
* @param {string} name
|
|
177
236
|
*/
|
|
178
|
-
addSublanguage(
|
|
179
|
-
const
|
|
180
|
-
|
|
237
|
+
addSublanguage(emitter, name) {
|
|
238
|
+
const node = emitter.root;
|
|
239
|
+
node.sublanguage = true;
|
|
240
|
+
node.language = name;
|
|
241
|
+
this.add(node);
|
|
181
242
|
}
|
|
182
243
|
toHTML() {
|
|
183
|
-
|
|
244
|
+
const renderer = new HTMLRenderer(this, this.options);
|
|
245
|
+
return renderer.value();
|
|
184
246
|
}
|
|
185
247
|
finalize() {
|
|
186
|
-
return
|
|
248
|
+
return true;
|
|
187
249
|
}
|
|
188
250
|
}
|
|
189
|
-
function
|
|
190
|
-
|
|
251
|
+
function source(re) {
|
|
252
|
+
if (!re)
|
|
253
|
+
return null;
|
|
254
|
+
if (typeof re === "string")
|
|
255
|
+
return re;
|
|
256
|
+
return re.source;
|
|
191
257
|
}
|
|
192
|
-
function
|
|
193
|
-
return
|
|
258
|
+
function lookahead(re) {
|
|
259
|
+
return concat("(?=", re, ")");
|
|
194
260
|
}
|
|
195
|
-
function
|
|
196
|
-
return
|
|
261
|
+
function anyNumberOfTimes(re) {
|
|
262
|
+
return concat("(?:", re, ")*");
|
|
197
263
|
}
|
|
198
|
-
function
|
|
199
|
-
return
|
|
264
|
+
function optional(re) {
|
|
265
|
+
return concat("(?:", re, ")?");
|
|
200
266
|
}
|
|
201
|
-
function
|
|
202
|
-
|
|
267
|
+
function concat(...args) {
|
|
268
|
+
const joined = args.map((x) => source(x)).join("");
|
|
269
|
+
return joined;
|
|
203
270
|
}
|
|
204
|
-
function
|
|
205
|
-
const
|
|
206
|
-
|
|
271
|
+
function stripOptionsFromArgs(args) {
|
|
272
|
+
const opts = args[args.length - 1];
|
|
273
|
+
if (typeof opts === "object" && opts.constructor === Object) {
|
|
274
|
+
args.splice(args.length - 1, 1);
|
|
275
|
+
return opts;
|
|
276
|
+
} else {
|
|
277
|
+
return {};
|
|
278
|
+
}
|
|
207
279
|
}
|
|
208
|
-
function
|
|
209
|
-
|
|
280
|
+
function either(...args) {
|
|
281
|
+
const opts = stripOptionsFromArgs(args);
|
|
282
|
+
const joined = "(" + (opts.capture ? "" : "?:") + args.map((x) => source(x)).join("|") + ")";
|
|
283
|
+
return joined;
|
|
210
284
|
}
|
|
211
|
-
function
|
|
212
|
-
return new RegExp(
|
|
285
|
+
function countMatchGroups(re) {
|
|
286
|
+
return new RegExp(re.toString() + "|").exec("").length - 1;
|
|
213
287
|
}
|
|
214
|
-
function
|
|
215
|
-
const
|
|
216
|
-
return
|
|
288
|
+
function startsWith(re, lexeme) {
|
|
289
|
+
const match = re && re.exec(lexeme);
|
|
290
|
+
return match && match.index === 0;
|
|
217
291
|
}
|
|
218
|
-
const
|
|
219
|
-
function
|
|
220
|
-
let
|
|
221
|
-
return
|
|
222
|
-
|
|
223
|
-
const
|
|
224
|
-
let
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
292
|
+
const BACKREF_RE = /\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;
|
|
293
|
+
function _rewriteBackreferences(regexps, { joinWith }) {
|
|
294
|
+
let numCaptures = 0;
|
|
295
|
+
return regexps.map((regex) => {
|
|
296
|
+
numCaptures += 1;
|
|
297
|
+
const offset = numCaptures;
|
|
298
|
+
let re = source(regex);
|
|
299
|
+
let out = "";
|
|
300
|
+
while (re.length > 0) {
|
|
301
|
+
const match = BACKREF_RE.exec(re);
|
|
302
|
+
if (!match) {
|
|
303
|
+
out += re;
|
|
229
304
|
break;
|
|
230
305
|
}
|
|
231
|
-
|
|
306
|
+
out += re.substring(0, match.index);
|
|
307
|
+
re = re.substring(match.index + match[0].length);
|
|
308
|
+
if (match[0][0] === "\\" && match[1]) {
|
|
309
|
+
out += "\\" + String(Number(match[1]) + offset);
|
|
310
|
+
} else {
|
|
311
|
+
out += match[0];
|
|
312
|
+
if (match[0] === "(") {
|
|
313
|
+
numCaptures++;
|
|
314
|
+
}
|
|
315
|
+
}
|
|
232
316
|
}
|
|
233
|
-
return
|
|
234
|
-
}).map((
|
|
317
|
+
return out;
|
|
318
|
+
}).map((re) => `(${re})`).join(joinWith);
|
|
235
319
|
}
|
|
236
|
-
const
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
320
|
+
const MATCH_NOTHING_RE = /\b\B/;
|
|
321
|
+
const IDENT_RE = "[a-zA-Z]\\w*";
|
|
322
|
+
const UNDERSCORE_IDENT_RE = "[a-zA-Z_]\\w*";
|
|
323
|
+
const NUMBER_RE = "\\b\\d+(\\.\\d+)?";
|
|
324
|
+
const C_NUMBER_RE = "(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)";
|
|
325
|
+
const BINARY_NUMBER_RE = "\\b(0b[01]+)";
|
|
326
|
+
const RE_STARTERS_RE = "!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~";
|
|
327
|
+
const SHEBANG = (opts = {}) => {
|
|
328
|
+
const beginShebang = /^#![ ]*\//;
|
|
329
|
+
if (opts.binary) {
|
|
330
|
+
opts.begin = concat(
|
|
331
|
+
beginShebang,
|
|
332
|
+
/.*\b/,
|
|
333
|
+
opts.binary,
|
|
334
|
+
/\b.*/
|
|
335
|
+
);
|
|
336
|
+
}
|
|
337
|
+
return inherit$1({
|
|
244
338
|
scope: "meta",
|
|
245
|
-
begin:
|
|
339
|
+
begin: beginShebang,
|
|
246
340
|
end: /$/,
|
|
247
341
|
relevance: 0,
|
|
248
342
|
/** @type {ModeCallback} */
|
|
249
|
-
"on:begin": (
|
|
250
|
-
|
|
343
|
+
"on:begin": (m, resp) => {
|
|
344
|
+
if (m.index !== 0)
|
|
345
|
+
resp.ignoreMatch();
|
|
251
346
|
}
|
|
252
|
-
},
|
|
253
|
-
}
|
|
347
|
+
}, opts);
|
|
348
|
+
};
|
|
349
|
+
const BACKSLASH_ESCAPE = {
|
|
254
350
|
begin: "\\\\[\\s\\S]",
|
|
255
351
|
relevance: 0
|
|
256
|
-
}
|
|
352
|
+
};
|
|
353
|
+
const APOS_STRING_MODE = {
|
|
257
354
|
scope: "string",
|
|
258
355
|
begin: "'",
|
|
259
356
|
end: "'",
|
|
260
357
|
illegal: "\\n",
|
|
261
|
-
contains: [
|
|
262
|
-
}
|
|
358
|
+
contains: [BACKSLASH_ESCAPE]
|
|
359
|
+
};
|
|
360
|
+
const QUOTE_STRING_MODE = {
|
|
263
361
|
scope: "string",
|
|
264
362
|
begin: '"',
|
|
265
363
|
end: '"',
|
|
266
364
|
illegal: "\\n",
|
|
267
|
-
contains: [
|
|
268
|
-
}
|
|
365
|
+
contains: [BACKSLASH_ESCAPE]
|
|
366
|
+
};
|
|
367
|
+
const PHRASAL_WORDS_MODE = {
|
|
269
368
|
begin: /\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/
|
|
270
|
-
}
|
|
271
|
-
|
|
369
|
+
};
|
|
370
|
+
const COMMENT = function(begin, end, modeOptions = {}) {
|
|
371
|
+
const mode = inherit$1(
|
|
272
372
|
{
|
|
273
373
|
scope: "comment",
|
|
274
|
-
begin
|
|
275
|
-
end
|
|
374
|
+
begin,
|
|
375
|
+
end,
|
|
276
376
|
contains: []
|
|
277
377
|
},
|
|
278
|
-
|
|
378
|
+
modeOptions
|
|
279
379
|
);
|
|
280
|
-
|
|
380
|
+
mode.contains.push({
|
|
281
381
|
scope: "doctag",
|
|
282
382
|
// hack to avoid the space from being included. the space is necessary to
|
|
283
383
|
// match here to prevent the plain text rule below from gobbling up doctags
|
|
284
384
|
begin: "[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",
|
|
285
385
|
end: /(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,
|
|
286
|
-
excludeBegin:
|
|
386
|
+
excludeBegin: true,
|
|
287
387
|
relevance: 0
|
|
288
388
|
});
|
|
289
|
-
const
|
|
389
|
+
const ENGLISH_WORD = either(
|
|
290
390
|
// list of common 1 and 2 letter words in English
|
|
291
391
|
"I",
|
|
292
392
|
"a",
|
|
@@ -307,7 +407,7 @@ const st = /\b\B/, Re = "[a-zA-Z]\\w*", ce = "[a-zA-Z_]\\w*", Se = "\\b\\d+(\\.\
|
|
|
307
407
|
/[A-Za-z][a-z]{2,}/
|
|
308
408
|
// allow capitalized words at beginning of sentences
|
|
309
409
|
);
|
|
310
|
-
|
|
410
|
+
mode.contains.push(
|
|
311
411
|
{
|
|
312
412
|
// TODO: how to include ", (, ) without breaking grammars that use these for
|
|
313
413
|
// comment delimiters?
|
|
@@ -322,30 +422,38 @@ const st = /\b\B/, Re = "[a-zA-Z]\\w*", ce = "[a-zA-Z_]\\w*", Se = "\\b\\d+(\\.\
|
|
|
322
422
|
//
|
|
323
423
|
// for a visual example please see:
|
|
324
424
|
// https://github.com/highlightjs/highlight.js/issues/2827
|
|
325
|
-
begin:
|
|
425
|
+
begin: concat(
|
|
326
426
|
/[ ]+/,
|
|
327
427
|
// necessary to prevent us gobbling up doctags like /* @author Bob Mcgill */
|
|
328
428
|
"(",
|
|
329
|
-
|
|
429
|
+
ENGLISH_WORD,
|
|
330
430
|
/[.]?[:]?([.][ ]|[ ])/,
|
|
331
431
|
"){3}"
|
|
332
432
|
)
|
|
333
433
|
// look for 3 words in a row
|
|
334
434
|
}
|
|
335
|
-
)
|
|
336
|
-
|
|
435
|
+
);
|
|
436
|
+
return mode;
|
|
437
|
+
};
|
|
438
|
+
const C_LINE_COMMENT_MODE = COMMENT("//", "$");
|
|
439
|
+
const C_BLOCK_COMMENT_MODE = COMMENT("/\\*", "\\*/");
|
|
440
|
+
const HASH_COMMENT_MODE = COMMENT("#", "$");
|
|
441
|
+
const NUMBER_MODE = {
|
|
337
442
|
scope: "number",
|
|
338
|
-
begin:
|
|
443
|
+
begin: NUMBER_RE,
|
|
339
444
|
relevance: 0
|
|
340
|
-
}
|
|
445
|
+
};
|
|
446
|
+
const C_NUMBER_MODE = {
|
|
341
447
|
scope: "number",
|
|
342
|
-
begin:
|
|
448
|
+
begin: C_NUMBER_RE,
|
|
343
449
|
relevance: 0
|
|
344
|
-
}
|
|
450
|
+
};
|
|
451
|
+
const BINARY_NUMBER_MODE = {
|
|
345
452
|
scope: "number",
|
|
346
|
-
begin:
|
|
453
|
+
begin: BINARY_NUMBER_RE,
|
|
347
454
|
relevance: 0
|
|
348
|
-
}
|
|
455
|
+
};
|
|
456
|
+
const REGEXP_MODE = {
|
|
349
457
|
// this outer rule makes sure we actually have a WHOLE regex and not simply
|
|
350
458
|
// an expression such as:
|
|
351
459
|
//
|
|
@@ -359,106 +467,136 @@ const st = /\b\B/, Re = "[a-zA-Z]\\w*", ce = "[a-zA-Z_]\\w*", Se = "\\b\\d+(\\.\
|
|
|
359
467
|
end: /\/[gimuy]*/,
|
|
360
468
|
illegal: /\n/,
|
|
361
469
|
contains: [
|
|
362
|
-
|
|
470
|
+
BACKSLASH_ESCAPE,
|
|
363
471
|
{
|
|
364
472
|
begin: /\[/,
|
|
365
473
|
end: /\]/,
|
|
366
474
|
relevance: 0,
|
|
367
|
-
contains: [
|
|
475
|
+
contains: [BACKSLASH_ESCAPE]
|
|
368
476
|
}
|
|
369
477
|
]
|
|
370
478
|
}]
|
|
371
|
-
}
|
|
479
|
+
};
|
|
480
|
+
const TITLE_MODE = {
|
|
372
481
|
scope: "title",
|
|
373
|
-
begin:
|
|
482
|
+
begin: IDENT_RE,
|
|
374
483
|
relevance: 0
|
|
375
|
-
}
|
|
484
|
+
};
|
|
485
|
+
const UNDERSCORE_TITLE_MODE = {
|
|
376
486
|
scope: "title",
|
|
377
|
-
begin:
|
|
487
|
+
begin: UNDERSCORE_IDENT_RE,
|
|
378
488
|
relevance: 0
|
|
379
|
-
}
|
|
489
|
+
};
|
|
490
|
+
const METHOD_GUARD = {
|
|
380
491
|
// excludes method names from keyword processing
|
|
381
|
-
begin: "\\.\\s*" +
|
|
492
|
+
begin: "\\.\\s*" + UNDERSCORE_IDENT_RE,
|
|
382
493
|
relevance: 0
|
|
383
|
-
}
|
|
494
|
+
};
|
|
495
|
+
const END_SAME_AS_BEGIN = function(mode) {
|
|
384
496
|
return Object.assign(
|
|
385
|
-
|
|
497
|
+
mode,
|
|
386
498
|
{
|
|
387
499
|
/** @type {ModeCallback} */
|
|
388
|
-
"on:begin": (
|
|
389
|
-
|
|
500
|
+
"on:begin": (m, resp) => {
|
|
501
|
+
resp.data._beginMatch = m[1];
|
|
390
502
|
},
|
|
391
503
|
/** @type {ModeCallback} */
|
|
392
|
-
"on:end": (
|
|
393
|
-
|
|
504
|
+
"on:end": (m, resp) => {
|
|
505
|
+
if (resp.data._beginMatch !== m[1])
|
|
506
|
+
resp.ignoreMatch();
|
|
394
507
|
}
|
|
395
508
|
}
|
|
396
509
|
);
|
|
397
510
|
};
|
|
398
|
-
var
|
|
511
|
+
var MODES = /* @__PURE__ */ Object.freeze({
|
|
399
512
|
__proto__: null,
|
|
400
|
-
MATCH_NOTHING_RE
|
|
401
|
-
IDENT_RE
|
|
402
|
-
UNDERSCORE_IDENT_RE
|
|
403
|
-
NUMBER_RE
|
|
404
|
-
C_NUMBER_RE
|
|
405
|
-
BINARY_NUMBER_RE
|
|
406
|
-
RE_STARTERS_RE
|
|
407
|
-
SHEBANG
|
|
408
|
-
BACKSLASH_ESCAPE
|
|
409
|
-
APOS_STRING_MODE
|
|
410
|
-
QUOTE_STRING_MODE
|
|
411
|
-
PHRASAL_WORDS_MODE
|
|
412
|
-
COMMENT
|
|
413
|
-
C_LINE_COMMENT_MODE
|
|
414
|
-
C_BLOCK_COMMENT_MODE
|
|
415
|
-
HASH_COMMENT_MODE
|
|
416
|
-
NUMBER_MODE
|
|
417
|
-
C_NUMBER_MODE
|
|
418
|
-
BINARY_NUMBER_MODE
|
|
419
|
-
REGEXP_MODE
|
|
420
|
-
TITLE_MODE
|
|
421
|
-
UNDERSCORE_TITLE_MODE
|
|
422
|
-
METHOD_GUARD
|
|
423
|
-
END_SAME_AS_BEGIN
|
|
513
|
+
MATCH_NOTHING_RE,
|
|
514
|
+
IDENT_RE,
|
|
515
|
+
UNDERSCORE_IDENT_RE,
|
|
516
|
+
NUMBER_RE,
|
|
517
|
+
C_NUMBER_RE,
|
|
518
|
+
BINARY_NUMBER_RE,
|
|
519
|
+
RE_STARTERS_RE,
|
|
520
|
+
SHEBANG,
|
|
521
|
+
BACKSLASH_ESCAPE,
|
|
522
|
+
APOS_STRING_MODE,
|
|
523
|
+
QUOTE_STRING_MODE,
|
|
524
|
+
PHRASAL_WORDS_MODE,
|
|
525
|
+
COMMENT,
|
|
526
|
+
C_LINE_COMMENT_MODE,
|
|
527
|
+
C_BLOCK_COMMENT_MODE,
|
|
528
|
+
HASH_COMMENT_MODE,
|
|
529
|
+
NUMBER_MODE,
|
|
530
|
+
C_NUMBER_MODE,
|
|
531
|
+
BINARY_NUMBER_MODE,
|
|
532
|
+
REGEXP_MODE,
|
|
533
|
+
TITLE_MODE,
|
|
534
|
+
UNDERSCORE_TITLE_MODE,
|
|
535
|
+
METHOD_GUARD,
|
|
536
|
+
END_SAME_AS_BEGIN
|
|
424
537
|
});
|
|
425
|
-
function
|
|
426
|
-
|
|
538
|
+
function skipIfHasPrecedingDot(match, response) {
|
|
539
|
+
const before = match.input[match.index - 1];
|
|
540
|
+
if (before === ".") {
|
|
541
|
+
response.ignoreMatch();
|
|
542
|
+
}
|
|
427
543
|
}
|
|
428
|
-
function
|
|
429
|
-
|
|
544
|
+
function scopeClassName(mode, _parent) {
|
|
545
|
+
if (mode.className !== void 0) {
|
|
546
|
+
mode.scope = mode.className;
|
|
547
|
+
delete mode.className;
|
|
548
|
+
}
|
|
430
549
|
}
|
|
431
|
-
function
|
|
432
|
-
|
|
550
|
+
function beginKeywords(mode, parent) {
|
|
551
|
+
if (!parent)
|
|
552
|
+
return;
|
|
553
|
+
if (!mode.beginKeywords)
|
|
554
|
+
return;
|
|
555
|
+
mode.begin = "\\b(" + mode.beginKeywords.split(" ").join("|") + ")(?!\\.)(?=\\b|\\s)";
|
|
556
|
+
mode.__beforeBegin = skipIfHasPrecedingDot;
|
|
557
|
+
mode.keywords = mode.keywords || mode.beginKeywords;
|
|
558
|
+
delete mode.beginKeywords;
|
|
559
|
+
if (mode.relevance === void 0)
|
|
560
|
+
mode.relevance = 0;
|
|
433
561
|
}
|
|
434
|
-
function
|
|
435
|
-
Array.isArray(
|
|
562
|
+
function compileIllegal(mode, _parent) {
|
|
563
|
+
if (!Array.isArray(mode.illegal))
|
|
564
|
+
return;
|
|
565
|
+
mode.illegal = either(...mode.illegal);
|
|
436
566
|
}
|
|
437
|
-
function
|
|
438
|
-
if (
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
567
|
+
function compileMatch(mode, _parent) {
|
|
568
|
+
if (!mode.match)
|
|
569
|
+
return;
|
|
570
|
+
if (mode.begin || mode.end)
|
|
571
|
+
throw new Error("begin & end are not supported with match");
|
|
572
|
+
mode.begin = mode.match;
|
|
573
|
+
delete mode.match;
|
|
443
574
|
}
|
|
444
|
-
function
|
|
445
|
-
|
|
575
|
+
function compileRelevance(mode, _parent) {
|
|
576
|
+
if (mode.relevance === void 0)
|
|
577
|
+
mode.relevance = 1;
|
|
446
578
|
}
|
|
447
|
-
const
|
|
448
|
-
if (!
|
|
579
|
+
const beforeMatchExt = (mode, parent) => {
|
|
580
|
+
if (!mode.beforeMatch)
|
|
449
581
|
return;
|
|
450
|
-
if (
|
|
582
|
+
if (mode.starts)
|
|
451
583
|
throw new Error("beforeMatch cannot be used with starts");
|
|
452
|
-
const
|
|
453
|
-
Object.keys(
|
|
454
|
-
delete
|
|
455
|
-
})
|
|
584
|
+
const originalMode = Object.assign({}, mode);
|
|
585
|
+
Object.keys(mode).forEach((key) => {
|
|
586
|
+
delete mode[key];
|
|
587
|
+
});
|
|
588
|
+
mode.keywords = originalMode.keywords;
|
|
589
|
+
mode.begin = concat(originalMode.beforeMatch, lookahead(originalMode.begin));
|
|
590
|
+
mode.starts = {
|
|
456
591
|
relevance: 0,
|
|
457
592
|
contains: [
|
|
458
|
-
Object.assign(
|
|
593
|
+
Object.assign(originalMode, { endsParent: true })
|
|
459
594
|
]
|
|
460
|
-
}
|
|
461
|
-
|
|
595
|
+
};
|
|
596
|
+
mode.relevance = 0;
|
|
597
|
+
delete originalMode.beforeMatch;
|
|
598
|
+
};
|
|
599
|
+
const COMMON_KEYWORDS = [
|
|
462
600
|
"of",
|
|
463
601
|
"and",
|
|
464
602
|
"for",
|
|
@@ -473,106 +611,174 @@ const At = (e, t) => {
|
|
|
473
611
|
// common variable name
|
|
474
612
|
"value"
|
|
475
613
|
// common variable name
|
|
476
|
-
]
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
);
|
|
484
|
-
}
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
614
|
+
];
|
|
615
|
+
const DEFAULT_KEYWORD_SCOPE = "keyword";
|
|
616
|
+
function compileKeywords(rawKeywords, caseInsensitive, scopeName = DEFAULT_KEYWORD_SCOPE) {
|
|
617
|
+
const compiledKeywords = /* @__PURE__ */ Object.create(null);
|
|
618
|
+
if (typeof rawKeywords === "string") {
|
|
619
|
+
compileList(scopeName, rawKeywords.split(" "));
|
|
620
|
+
} else if (Array.isArray(rawKeywords)) {
|
|
621
|
+
compileList(scopeName, rawKeywords);
|
|
622
|
+
} else {
|
|
623
|
+
Object.keys(rawKeywords).forEach(function(scopeName2) {
|
|
624
|
+
Object.assign(
|
|
625
|
+
compiledKeywords,
|
|
626
|
+
compileKeywords(rawKeywords[scopeName2], caseInsensitive, scopeName2)
|
|
627
|
+
);
|
|
628
|
+
});
|
|
629
|
+
}
|
|
630
|
+
return compiledKeywords;
|
|
631
|
+
function compileList(scopeName2, keywordList) {
|
|
632
|
+
if (caseInsensitive) {
|
|
633
|
+
keywordList = keywordList.map((x) => x.toLowerCase());
|
|
634
|
+
}
|
|
635
|
+
keywordList.forEach(function(keyword) {
|
|
636
|
+
const pair = keyword.split("|");
|
|
637
|
+
compiledKeywords[pair[0]] = [scopeName2, scoreForKeyword(pair[0], pair[1])];
|
|
489
638
|
});
|
|
490
639
|
}
|
|
491
640
|
}
|
|
492
|
-
function
|
|
493
|
-
|
|
641
|
+
function scoreForKeyword(keyword, providedScore) {
|
|
642
|
+
if (providedScore) {
|
|
643
|
+
return Number(providedScore);
|
|
644
|
+
}
|
|
645
|
+
return commonKeyword(keyword) ? 0 : 1;
|
|
494
646
|
}
|
|
495
|
-
function
|
|
496
|
-
return
|
|
647
|
+
function commonKeyword(keyword) {
|
|
648
|
+
return COMMON_KEYWORDS.includes(keyword.toLowerCase());
|
|
497
649
|
}
|
|
498
|
-
const
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
}
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
650
|
+
const seenDeprecations = {};
|
|
651
|
+
const error = (message) => {
|
|
652
|
+
console.error(message);
|
|
653
|
+
};
|
|
654
|
+
const warn = (message, ...args) => {
|
|
655
|
+
console.log(`WARN: ${message}`, ...args);
|
|
656
|
+
};
|
|
657
|
+
const deprecated = (version2, message) => {
|
|
658
|
+
if (seenDeprecations[`${version2}/${message}`])
|
|
659
|
+
return;
|
|
660
|
+
console.log(`Deprecated as of ${version2}. ${message}`);
|
|
661
|
+
seenDeprecations[`${version2}/${message}`] = true;
|
|
662
|
+
};
|
|
663
|
+
const MultiClassError = new Error();
|
|
664
|
+
function remapScopeNames(mode, regexes, { key }) {
|
|
665
|
+
let offset = 0;
|
|
666
|
+
const scopeNames = mode[key];
|
|
667
|
+
const emit = {};
|
|
668
|
+
const positions = {};
|
|
669
|
+
for (let i = 1; i <= regexes.length; i++) {
|
|
670
|
+
positions[i + offset] = scopeNames[i];
|
|
671
|
+
emit[i + offset] = true;
|
|
672
|
+
offset += countMatchGroups(regexes[i - 1]);
|
|
673
|
+
}
|
|
674
|
+
mode[key] = positions;
|
|
675
|
+
mode[key]._emit = emit;
|
|
676
|
+
mode[key]._multi = true;
|
|
511
677
|
}
|
|
512
|
-
function
|
|
513
|
-
if (Array.isArray(
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
678
|
+
function beginMultiClass(mode) {
|
|
679
|
+
if (!Array.isArray(mode.begin))
|
|
680
|
+
return;
|
|
681
|
+
if (mode.skip || mode.excludeBegin || mode.returnBegin) {
|
|
682
|
+
error("skip, excludeBegin, returnBegin not compatible with beginScope: {}");
|
|
683
|
+
throw MultiClassError;
|
|
684
|
+
}
|
|
685
|
+
if (typeof mode.beginScope !== "object" || mode.beginScope === null) {
|
|
686
|
+
error("beginScope must be object");
|
|
687
|
+
throw MultiClassError;
|
|
519
688
|
}
|
|
689
|
+
remapScopeNames(mode, mode.begin, { key: "beginScope" });
|
|
690
|
+
mode.begin = _rewriteBackreferences(mode.begin, { joinWith: "" });
|
|
520
691
|
}
|
|
521
|
-
function
|
|
522
|
-
if (Array.isArray(
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
692
|
+
function endMultiClass(mode) {
|
|
693
|
+
if (!Array.isArray(mode.end))
|
|
694
|
+
return;
|
|
695
|
+
if (mode.skip || mode.excludeEnd || mode.returnEnd) {
|
|
696
|
+
error("skip, excludeEnd, returnEnd not compatible with endScope: {}");
|
|
697
|
+
throw MultiClassError;
|
|
698
|
+
}
|
|
699
|
+
if (typeof mode.endScope !== "object" || mode.endScope === null) {
|
|
700
|
+
error("endScope must be object");
|
|
701
|
+
throw MultiClassError;
|
|
528
702
|
}
|
|
703
|
+
remapScopeNames(mode, mode.end, { key: "endScope" });
|
|
704
|
+
mode.end = _rewriteBackreferences(mode.end, { joinWith: "" });
|
|
529
705
|
}
|
|
530
|
-
function
|
|
531
|
-
|
|
706
|
+
function scopeSugar(mode) {
|
|
707
|
+
if (mode.scope && typeof mode.scope === "object" && mode.scope !== null) {
|
|
708
|
+
mode.beginScope = mode.scope;
|
|
709
|
+
delete mode.scope;
|
|
710
|
+
}
|
|
532
711
|
}
|
|
533
|
-
function
|
|
534
|
-
|
|
712
|
+
function MultiClass(mode) {
|
|
713
|
+
scopeSugar(mode);
|
|
714
|
+
if (typeof mode.beginScope === "string") {
|
|
715
|
+
mode.beginScope = { _wrap: mode.beginScope };
|
|
716
|
+
}
|
|
717
|
+
if (typeof mode.endScope === "string") {
|
|
718
|
+
mode.endScope = { _wrap: mode.endScope };
|
|
719
|
+
}
|
|
720
|
+
beginMultiClass(mode);
|
|
721
|
+
endMultiClass(mode);
|
|
535
722
|
}
|
|
536
|
-
function
|
|
537
|
-
function
|
|
723
|
+
function compileLanguage(language) {
|
|
724
|
+
function langRe(value, global) {
|
|
538
725
|
return new RegExp(
|
|
539
|
-
|
|
540
|
-
"m" + (
|
|
726
|
+
source(value),
|
|
727
|
+
"m" + (language.case_insensitive ? "i" : "") + (language.unicodeRegex ? "u" : "") + (global ? "g" : "")
|
|
541
728
|
);
|
|
542
729
|
}
|
|
543
|
-
class
|
|
730
|
+
class MultiRegex {
|
|
544
731
|
constructor() {
|
|
545
|
-
this.matchIndexes = {}
|
|
732
|
+
this.matchIndexes = {};
|
|
733
|
+
this.regexes = [];
|
|
734
|
+
this.matchAt = 1;
|
|
735
|
+
this.position = 0;
|
|
546
736
|
}
|
|
547
737
|
// @ts-ignore
|
|
548
|
-
addRule(
|
|
549
|
-
|
|
738
|
+
addRule(re, opts) {
|
|
739
|
+
opts.position = this.position++;
|
|
740
|
+
this.matchIndexes[this.matchAt] = opts;
|
|
741
|
+
this.regexes.push([opts, re]);
|
|
742
|
+
this.matchAt += countMatchGroups(re) + 1;
|
|
550
743
|
}
|
|
551
744
|
compile() {
|
|
552
|
-
this.regexes.length === 0
|
|
553
|
-
|
|
554
|
-
|
|
745
|
+
if (this.regexes.length === 0) {
|
|
746
|
+
this.exec = () => null;
|
|
747
|
+
}
|
|
748
|
+
const terminators = this.regexes.map((el) => el[1]);
|
|
749
|
+
this.matcherRe = langRe(_rewriteBackreferences(terminators, { joinWith: "|" }), true);
|
|
750
|
+
this.lastIndex = 0;
|
|
555
751
|
}
|
|
556
752
|
/** @param {string} s */
|
|
557
|
-
exec(
|
|
753
|
+
exec(s) {
|
|
558
754
|
this.matcherRe.lastIndex = this.lastIndex;
|
|
559
|
-
const
|
|
560
|
-
if (!
|
|
755
|
+
const match = this.matcherRe.exec(s);
|
|
756
|
+
if (!match) {
|
|
561
757
|
return null;
|
|
562
|
-
|
|
563
|
-
|
|
758
|
+
}
|
|
759
|
+
const i = match.findIndex((el, i2) => i2 > 0 && el !== void 0);
|
|
760
|
+
const matchData = this.matchIndexes[i];
|
|
761
|
+
match.splice(0, i);
|
|
762
|
+
return Object.assign(match, matchData);
|
|
564
763
|
}
|
|
565
764
|
}
|
|
566
|
-
class
|
|
765
|
+
class ResumableMultiRegex {
|
|
567
766
|
constructor() {
|
|
568
|
-
this.rules = []
|
|
767
|
+
this.rules = [];
|
|
768
|
+
this.multiRegexes = [];
|
|
769
|
+
this.count = 0;
|
|
770
|
+
this.lastIndex = 0;
|
|
771
|
+
this.regexIndex = 0;
|
|
569
772
|
}
|
|
570
773
|
// @ts-ignore
|
|
571
|
-
getMatcher(
|
|
572
|
-
if (this.multiRegexes[
|
|
573
|
-
return this.multiRegexes[
|
|
574
|
-
const
|
|
575
|
-
|
|
774
|
+
getMatcher(index) {
|
|
775
|
+
if (this.multiRegexes[index])
|
|
776
|
+
return this.multiRegexes[index];
|
|
777
|
+
const matcher = new MultiRegex();
|
|
778
|
+
this.rules.slice(index).forEach(([re, opts]) => matcher.addRule(re, opts));
|
|
779
|
+
matcher.compile();
|
|
780
|
+
this.multiRegexes[index] = matcher;
|
|
781
|
+
return matcher;
|
|
576
782
|
}
|
|
577
783
|
resumingScanAtSamePosition() {
|
|
578
784
|
return this.regexIndex !== 0;
|
|
@@ -581,89 +787,173 @@ function Ht(e) {
|
|
|
581
787
|
this.regexIndex = 0;
|
|
582
788
|
}
|
|
583
789
|
// @ts-ignore
|
|
584
|
-
addRule(
|
|
585
|
-
this.rules.push([
|
|
790
|
+
addRule(re, opts) {
|
|
791
|
+
this.rules.push([re, opts]);
|
|
792
|
+
if (opts.type === "begin")
|
|
793
|
+
this.count++;
|
|
586
794
|
}
|
|
587
795
|
/** @param {string} s */
|
|
588
|
-
exec(
|
|
589
|
-
const
|
|
590
|
-
|
|
591
|
-
let
|
|
592
|
-
if (this.resumingScanAtSamePosition()
|
|
593
|
-
|
|
594
|
-
|
|
796
|
+
exec(s) {
|
|
797
|
+
const m = this.getMatcher(this.regexIndex);
|
|
798
|
+
m.lastIndex = this.lastIndex;
|
|
799
|
+
let result = m.exec(s);
|
|
800
|
+
if (this.resumingScanAtSamePosition()) {
|
|
801
|
+
if (result && result.index === this.lastIndex)
|
|
802
|
+
;
|
|
803
|
+
else {
|
|
804
|
+
const m2 = this.getMatcher(0);
|
|
805
|
+
m2.lastIndex = this.lastIndex + 1;
|
|
806
|
+
result = m2.exec(s);
|
|
807
|
+
}
|
|
595
808
|
}
|
|
596
|
-
|
|
809
|
+
if (result) {
|
|
810
|
+
this.regexIndex += result.position + 1;
|
|
811
|
+
if (this.regexIndex === this.count) {
|
|
812
|
+
this.considerAll();
|
|
813
|
+
}
|
|
814
|
+
}
|
|
815
|
+
return result;
|
|
597
816
|
}
|
|
598
817
|
}
|
|
599
|
-
function
|
|
600
|
-
const
|
|
601
|
-
|
|
818
|
+
function buildModeRegex(mode) {
|
|
819
|
+
const mm = new ResumableMultiRegex();
|
|
820
|
+
mode.contains.forEach((term) => mm.addRule(term.begin, { rule: term, type: "begin" }));
|
|
821
|
+
if (mode.terminatorEnd) {
|
|
822
|
+
mm.addRule(mode.terminatorEnd, { type: "end" });
|
|
823
|
+
}
|
|
824
|
+
if (mode.illegal) {
|
|
825
|
+
mm.addRule(mode.illegal, { type: "illegal" });
|
|
826
|
+
}
|
|
827
|
+
return mm;
|
|
602
828
|
}
|
|
603
|
-
function
|
|
604
|
-
const
|
|
829
|
+
function compileMode(mode, parent) {
|
|
830
|
+
const cmode = (
|
|
605
831
|
/** @type CompiledMode */
|
|
606
|
-
|
|
832
|
+
mode
|
|
607
833
|
);
|
|
608
|
-
if (
|
|
609
|
-
return
|
|
834
|
+
if (mode.isCompiled)
|
|
835
|
+
return cmode;
|
|
610
836
|
[
|
|
611
|
-
|
|
837
|
+
scopeClassName,
|
|
612
838
|
// do this early so compiler extensions generally don't have to worry about
|
|
613
839
|
// the distinction between match/begin
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
].forEach((
|
|
618
|
-
|
|
840
|
+
compileMatch,
|
|
841
|
+
MultiClass,
|
|
842
|
+
beforeMatchExt
|
|
843
|
+
].forEach((ext) => ext(mode, parent));
|
|
844
|
+
language.compilerExtensions.forEach((ext) => ext(mode, parent));
|
|
845
|
+
mode.__beforeBegin = null;
|
|
846
|
+
[
|
|
847
|
+
beginKeywords,
|
|
619
848
|
// do this later so compiler extensions that come earlier have access to the
|
|
620
849
|
// raw array if they wanted to perhaps manipulate it, etc.
|
|
621
|
-
|
|
850
|
+
compileIllegal,
|
|
622
851
|
// default to 1 relevance if not specified
|
|
623
|
-
|
|
624
|
-
].forEach((
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
}
|
|
632
|
-
|
|
852
|
+
compileRelevance
|
|
853
|
+
].forEach((ext) => ext(mode, parent));
|
|
854
|
+
mode.isCompiled = true;
|
|
855
|
+
let keywordPattern = null;
|
|
856
|
+
if (typeof mode.keywords === "object" && mode.keywords.$pattern) {
|
|
857
|
+
mode.keywords = Object.assign({}, mode.keywords);
|
|
858
|
+
keywordPattern = mode.keywords.$pattern;
|
|
859
|
+
delete mode.keywords.$pattern;
|
|
860
|
+
}
|
|
861
|
+
keywordPattern = keywordPattern || /\w+/;
|
|
862
|
+
if (mode.keywords) {
|
|
863
|
+
mode.keywords = compileKeywords(mode.keywords, language.case_insensitive);
|
|
864
|
+
}
|
|
865
|
+
cmode.keywordPatternRe = langRe(keywordPattern, true);
|
|
866
|
+
if (parent) {
|
|
867
|
+
if (!mode.begin)
|
|
868
|
+
mode.begin = /\B|\b/;
|
|
869
|
+
cmode.beginRe = langRe(cmode.begin);
|
|
870
|
+
if (!mode.end && !mode.endsWithParent)
|
|
871
|
+
mode.end = /\B|\b/;
|
|
872
|
+
if (mode.end)
|
|
873
|
+
cmode.endRe = langRe(cmode.end);
|
|
874
|
+
cmode.terminatorEnd = source(cmode.end) || "";
|
|
875
|
+
if (mode.endsWithParent && parent.terminatorEnd) {
|
|
876
|
+
cmode.terminatorEnd += (mode.end ? "|" : "") + parent.terminatorEnd;
|
|
877
|
+
}
|
|
878
|
+
}
|
|
879
|
+
if (mode.illegal)
|
|
880
|
+
cmode.illegalRe = langRe(
|
|
881
|
+
/** @type {RegExp | string} */
|
|
882
|
+
mode.illegal
|
|
883
|
+
);
|
|
884
|
+
if (!mode.contains)
|
|
885
|
+
mode.contains = [];
|
|
886
|
+
mode.contains = [].concat(...mode.contains.map(function(c) {
|
|
887
|
+
return expandOrCloneMode(c === "self" ? mode : c);
|
|
888
|
+
}));
|
|
889
|
+
mode.contains.forEach(function(c) {
|
|
890
|
+
compileMode(
|
|
633
891
|
/** @type Mode */
|
|
634
|
-
|
|
635
|
-
|
|
892
|
+
c,
|
|
893
|
+
cmode
|
|
636
894
|
);
|
|
637
|
-
})
|
|
895
|
+
});
|
|
896
|
+
if (mode.starts) {
|
|
897
|
+
compileMode(mode.starts, parent);
|
|
898
|
+
}
|
|
899
|
+
cmode.matcher = buildModeRegex(cmode);
|
|
900
|
+
return cmode;
|
|
638
901
|
}
|
|
639
|
-
if (
|
|
902
|
+
if (!language.compilerExtensions)
|
|
903
|
+
language.compilerExtensions = [];
|
|
904
|
+
if (language.contains && language.contains.includes("self")) {
|
|
640
905
|
throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");
|
|
641
|
-
|
|
906
|
+
}
|
|
907
|
+
language.classNameAliases = inherit$1(language.classNameAliases || {});
|
|
908
|
+
return compileMode(
|
|
642
909
|
/** @type Mode */
|
|
643
|
-
|
|
910
|
+
language
|
|
644
911
|
);
|
|
645
912
|
}
|
|
646
|
-
function
|
|
647
|
-
|
|
913
|
+
function dependencyOnParent(mode) {
|
|
914
|
+
if (!mode)
|
|
915
|
+
return false;
|
|
916
|
+
return mode.endsWithParent || dependencyOnParent(mode.starts);
|
|
648
917
|
}
|
|
649
|
-
function
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
918
|
+
function expandOrCloneMode(mode) {
|
|
919
|
+
if (mode.variants && !mode.cachedVariants) {
|
|
920
|
+
mode.cachedVariants = mode.variants.map(function(variant) {
|
|
921
|
+
return inherit$1(mode, { variants: null }, variant);
|
|
922
|
+
});
|
|
923
|
+
}
|
|
924
|
+
if (mode.cachedVariants) {
|
|
925
|
+
return mode.cachedVariants;
|
|
926
|
+
}
|
|
927
|
+
if (dependencyOnParent(mode)) {
|
|
928
|
+
return inherit$1(mode, { starts: mode.starts ? inherit$1(mode.starts) : null });
|
|
929
|
+
}
|
|
930
|
+
if (Object.isFrozen(mode)) {
|
|
931
|
+
return inherit$1(mode);
|
|
932
|
+
}
|
|
933
|
+
return mode;
|
|
653
934
|
}
|
|
654
|
-
var
|
|
655
|
-
class
|
|
656
|
-
constructor(
|
|
657
|
-
super(
|
|
935
|
+
var version = "11.7.0";
|
|
936
|
+
class HTMLInjectionError extends Error {
|
|
937
|
+
constructor(reason, html) {
|
|
938
|
+
super(reason);
|
|
939
|
+
this.name = "HTMLInjectionError";
|
|
940
|
+
this.html = html;
|
|
658
941
|
}
|
|
659
942
|
}
|
|
660
|
-
const
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
943
|
+
const escape = escapeHTML;
|
|
944
|
+
const inherit = inherit$1;
|
|
945
|
+
const NO_MATCH = Symbol("nomatch");
|
|
946
|
+
const MAX_KEYWORD_HITS = 7;
|
|
947
|
+
const HLJS = function(hljs) {
|
|
948
|
+
const languages = /* @__PURE__ */ Object.create(null);
|
|
949
|
+
const aliases = /* @__PURE__ */ Object.create(null);
|
|
950
|
+
const plugins = [];
|
|
951
|
+
let SAFE_MODE = true;
|
|
952
|
+
const LANGUAGE_NOT_FOUND = "Could not find the language '{}', did you forget to load/include a language module?";
|
|
953
|
+
const PLAINTEXT_LANGUAGE = { disableAutodetect: true, name: "Plain text", contains: [] };
|
|
954
|
+
let options = {
|
|
955
|
+
ignoreUnescapedHTML: false,
|
|
956
|
+
throwUnescapedHTML: false,
|
|
667
957
|
noHighlightRe: /^(no-?highlight)$/i,
|
|
668
958
|
languageDetectRe: /\blang(?:uage)?-([\w-]+)\b/i,
|
|
669
959
|
classPrefix: "hljs-",
|
|
@@ -671,394 +961,613 @@ const ee = xe, we = v, Me = Symbol("nomatch"), $t = 7, Gt = function(e) {
|
|
|
671
961
|
languages: null,
|
|
672
962
|
// beta configuration options, subject to change, welcome to discuss
|
|
673
963
|
// https://github.com/highlightjs/highlight.js/issues/1086
|
|
674
|
-
__emitter:
|
|
964
|
+
__emitter: TokenTreeEmitter
|
|
675
965
|
};
|
|
676
|
-
function
|
|
677
|
-
return
|
|
678
|
-
}
|
|
679
|
-
function
|
|
680
|
-
let
|
|
681
|
-
|
|
682
|
-
const
|
|
683
|
-
if (
|
|
684
|
-
const
|
|
685
|
-
|
|
966
|
+
function shouldNotHighlight(languageName) {
|
|
967
|
+
return options.noHighlightRe.test(languageName);
|
|
968
|
+
}
|
|
969
|
+
function blockLanguage(block) {
|
|
970
|
+
let classes = block.className + " ";
|
|
971
|
+
classes += block.parentNode ? block.parentNode.className : "";
|
|
972
|
+
const match = options.languageDetectRe.exec(classes);
|
|
973
|
+
if (match) {
|
|
974
|
+
const language = getLanguage(match[1]);
|
|
975
|
+
if (!language) {
|
|
976
|
+
warn(LANGUAGE_NOT_FOUND.replace("{}", match[1]));
|
|
977
|
+
warn("Falling back to no-highlight mode for this block.", block);
|
|
978
|
+
}
|
|
979
|
+
return language ? match[1] : "no-highlight";
|
|
980
|
+
}
|
|
981
|
+
return classes.split(/\s+/).find((_class) => shouldNotHighlight(_class) || getLanguage(_class));
|
|
982
|
+
}
|
|
983
|
+
function highlight2(codeOrLanguageName, optionsOrCode, ignoreIllegals) {
|
|
984
|
+
let code = "";
|
|
985
|
+
let languageName = "";
|
|
986
|
+
if (typeof optionsOrCode === "object") {
|
|
987
|
+
code = codeOrLanguageName;
|
|
988
|
+
ignoreIllegals = optionsOrCode.ignoreIllegals;
|
|
989
|
+
languageName = optionsOrCode.language;
|
|
990
|
+
} else {
|
|
991
|
+
deprecated("10.7.0", "highlight(lang, code, ...args) has been deprecated.");
|
|
992
|
+
deprecated("10.7.0", "Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277");
|
|
993
|
+
languageName = codeOrLanguageName;
|
|
994
|
+
code = optionsOrCode;
|
|
995
|
+
}
|
|
996
|
+
if (ignoreIllegals === void 0) {
|
|
997
|
+
ignoreIllegals = true;
|
|
686
998
|
}
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
let p = "", M = "";
|
|
691
|
-
typeof a == "object" ? (p = n, h = a.ignoreIllegals, M = a.language) : (C("10.7.0", "highlight(lang, code, ...args) has been deprecated."), C("10.7.0", `Please use highlight(code, options) instead.
|
|
692
|
-
https://github.com/highlightjs/highlight.js/issues/2277`), M = n, p = a), h === void 0 && (h = !0);
|
|
693
|
-
const S = {
|
|
694
|
-
code: p,
|
|
695
|
-
language: M
|
|
999
|
+
const context = {
|
|
1000
|
+
code,
|
|
1001
|
+
language: languageName
|
|
696
1002
|
};
|
|
697
|
-
|
|
698
|
-
const
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
1003
|
+
fire("before:highlight", context);
|
|
1004
|
+
const result = context.result ? context.result : _highlight(context.language, context.code, ignoreIllegals);
|
|
1005
|
+
result.code = context.code;
|
|
1006
|
+
fire("after:highlight", result);
|
|
1007
|
+
return result;
|
|
1008
|
+
}
|
|
1009
|
+
function _highlight(languageName, codeToHighlight, ignoreIllegals, continuation) {
|
|
1010
|
+
const keywordHits = /* @__PURE__ */ Object.create(null);
|
|
1011
|
+
function keywordData(mode, matchText) {
|
|
1012
|
+
return mode.keywords[matchText];
|
|
705
1013
|
}
|
|
706
|
-
function
|
|
707
|
-
if (!
|
|
708
|
-
|
|
1014
|
+
function processKeywords() {
|
|
1015
|
+
if (!top.keywords) {
|
|
1016
|
+
emitter.addText(modeBuffer);
|
|
709
1017
|
return;
|
|
710
1018
|
}
|
|
711
|
-
let
|
|
712
|
-
|
|
713
|
-
let
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
1019
|
+
let lastIndex = 0;
|
|
1020
|
+
top.keywordPatternRe.lastIndex = 0;
|
|
1021
|
+
let match = top.keywordPatternRe.exec(modeBuffer);
|
|
1022
|
+
let buf = "";
|
|
1023
|
+
while (match) {
|
|
1024
|
+
buf += modeBuffer.substring(lastIndex, match.index);
|
|
1025
|
+
const word = language.case_insensitive ? match[0].toLowerCase() : match[0];
|
|
1026
|
+
const data = keywordData(top, word);
|
|
1027
|
+
if (data) {
|
|
1028
|
+
const [kind, keywordRelevance] = data;
|
|
1029
|
+
emitter.addText(buf);
|
|
1030
|
+
buf = "";
|
|
1031
|
+
keywordHits[word] = (keywordHits[word] || 0) + 1;
|
|
1032
|
+
if (keywordHits[word] <= MAX_KEYWORD_HITS)
|
|
1033
|
+
relevance += keywordRelevance;
|
|
1034
|
+
if (kind.startsWith("_")) {
|
|
1035
|
+
buf += match[0];
|
|
1036
|
+
} else {
|
|
1037
|
+
const cssClass = language.classNameAliases[kind] || kind;
|
|
1038
|
+
emitter.addKeyword(match[0], cssClass);
|
|
724
1039
|
}
|
|
725
|
-
} else
|
|
726
|
-
|
|
727
|
-
|
|
1040
|
+
} else {
|
|
1041
|
+
buf += match[0];
|
|
1042
|
+
}
|
|
1043
|
+
lastIndex = top.keywordPatternRe.lastIndex;
|
|
1044
|
+
match = top.keywordPatternRe.exec(modeBuffer);
|
|
728
1045
|
}
|
|
729
|
-
|
|
1046
|
+
buf += modeBuffer.substring(lastIndex);
|
|
1047
|
+
emitter.addText(buf);
|
|
730
1048
|
}
|
|
731
|
-
function
|
|
732
|
-
if (
|
|
1049
|
+
function processSubLanguage() {
|
|
1050
|
+
if (modeBuffer === "")
|
|
733
1051
|
return;
|
|
734
|
-
let
|
|
735
|
-
if (typeof
|
|
736
|
-
if (!
|
|
737
|
-
|
|
1052
|
+
let result2 = null;
|
|
1053
|
+
if (typeof top.subLanguage === "string") {
|
|
1054
|
+
if (!languages[top.subLanguage]) {
|
|
1055
|
+
emitter.addText(modeBuffer);
|
|
738
1056
|
return;
|
|
739
1057
|
}
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
1058
|
+
result2 = _highlight(top.subLanguage, modeBuffer, true, continuations[top.subLanguage]);
|
|
1059
|
+
continuations[top.subLanguage] = /** @type {CompiledMode} */
|
|
1060
|
+
result2._top;
|
|
1061
|
+
} else {
|
|
1062
|
+
result2 = highlightAuto(modeBuffer, top.subLanguage.length ? top.subLanguage : null);
|
|
1063
|
+
}
|
|
1064
|
+
if (top.relevance > 0) {
|
|
1065
|
+
relevance += result2.relevance;
|
|
1066
|
+
}
|
|
1067
|
+
emitter.addSublanguage(result2._emitter, result2.language);
|
|
745
1068
|
}
|
|
746
|
-
function
|
|
747
|
-
|
|
1069
|
+
function processBuffer() {
|
|
1070
|
+
if (top.subLanguage != null) {
|
|
1071
|
+
processSubLanguage();
|
|
1072
|
+
} else {
|
|
1073
|
+
processKeywords();
|
|
1074
|
+
}
|
|
1075
|
+
modeBuffer = "";
|
|
748
1076
|
}
|
|
749
|
-
function
|
|
750
|
-
let
|
|
751
|
-
const
|
|
752
|
-
|
|
753
|
-
if (!
|
|
754
|
-
|
|
1077
|
+
function emitMultiClass(scope, match) {
|
|
1078
|
+
let i = 1;
|
|
1079
|
+
const max = match.length - 1;
|
|
1080
|
+
while (i <= max) {
|
|
1081
|
+
if (!scope._emit[i]) {
|
|
1082
|
+
i++;
|
|
755
1083
|
continue;
|
|
756
1084
|
}
|
|
757
|
-
const
|
|
758
|
-
|
|
1085
|
+
const klass = language.classNameAliases[scope[i]] || scope[i];
|
|
1086
|
+
const text = match[i];
|
|
1087
|
+
if (klass) {
|
|
1088
|
+
emitter.addKeyword(text, klass);
|
|
1089
|
+
} else {
|
|
1090
|
+
modeBuffer = text;
|
|
1091
|
+
processKeywords();
|
|
1092
|
+
modeBuffer = "";
|
|
1093
|
+
}
|
|
1094
|
+
i++;
|
|
759
1095
|
}
|
|
760
1096
|
}
|
|
761
|
-
function
|
|
762
|
-
|
|
1097
|
+
function startNewMode(mode, match) {
|
|
1098
|
+
if (mode.scope && typeof mode.scope === "string") {
|
|
1099
|
+
emitter.openNode(language.classNameAliases[mode.scope] || mode.scope);
|
|
1100
|
+
}
|
|
1101
|
+
if (mode.beginScope) {
|
|
1102
|
+
if (mode.beginScope._wrap) {
|
|
1103
|
+
emitter.addKeyword(modeBuffer, language.classNameAliases[mode.beginScope._wrap] || mode.beginScope._wrap);
|
|
1104
|
+
modeBuffer = "";
|
|
1105
|
+
} else if (mode.beginScope._multi) {
|
|
1106
|
+
emitMultiClass(mode.beginScope, match);
|
|
1107
|
+
modeBuffer = "";
|
|
1108
|
+
}
|
|
1109
|
+
}
|
|
1110
|
+
top = Object.create(mode, { parent: { value: top } });
|
|
1111
|
+
return top;
|
|
763
1112
|
}
|
|
764
|
-
function
|
|
765
|
-
let
|
|
766
|
-
if (
|
|
767
|
-
if (
|
|
768
|
-
const
|
|
769
|
-
|
|
1113
|
+
function endOfMode(mode, match, matchPlusRemainder) {
|
|
1114
|
+
let matched = startsWith(mode.endRe, matchPlusRemainder);
|
|
1115
|
+
if (matched) {
|
|
1116
|
+
if (mode["on:end"]) {
|
|
1117
|
+
const resp = new Response(mode);
|
|
1118
|
+
mode["on:end"](match, resp);
|
|
1119
|
+
if (resp.isMatchIgnored)
|
|
1120
|
+
matched = false;
|
|
770
1121
|
}
|
|
771
|
-
if (
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
1122
|
+
if (matched) {
|
|
1123
|
+
while (mode.endsParent && mode.parent) {
|
|
1124
|
+
mode = mode.parent;
|
|
1125
|
+
}
|
|
1126
|
+
return mode;
|
|
775
1127
|
}
|
|
776
1128
|
}
|
|
777
|
-
if (
|
|
778
|
-
return
|
|
1129
|
+
if (mode.endsWithParent) {
|
|
1130
|
+
return endOfMode(mode.parent, match, matchPlusRemainder);
|
|
1131
|
+
}
|
|
779
1132
|
}
|
|
780
|
-
function
|
|
781
|
-
|
|
1133
|
+
function doIgnore(lexeme) {
|
|
1134
|
+
if (top.matcher.regexIndex === 0) {
|
|
1135
|
+
modeBuffer += lexeme[0];
|
|
1136
|
+
return 1;
|
|
1137
|
+
} else {
|
|
1138
|
+
resumeScanAtSamePosition = true;
|
|
1139
|
+
return 0;
|
|
1140
|
+
}
|
|
782
1141
|
}
|
|
783
|
-
function
|
|
784
|
-
const
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
1142
|
+
function doBeginMatch(match) {
|
|
1143
|
+
const lexeme = match[0];
|
|
1144
|
+
const newMode = match.rule;
|
|
1145
|
+
const resp = new Response(newMode);
|
|
1146
|
+
const beforeCallbacks = [newMode.__beforeBegin, newMode["on:begin"]];
|
|
1147
|
+
for (const cb of beforeCallbacks) {
|
|
1148
|
+
if (!cb)
|
|
1149
|
+
continue;
|
|
1150
|
+
cb(match, resp);
|
|
1151
|
+
if (resp.isMatchIgnored)
|
|
1152
|
+
return doIgnore(lexeme);
|
|
1153
|
+
}
|
|
1154
|
+
if (newMode.skip) {
|
|
1155
|
+
modeBuffer += lexeme;
|
|
1156
|
+
} else {
|
|
1157
|
+
if (newMode.excludeBegin) {
|
|
1158
|
+
modeBuffer += lexeme;
|
|
1159
|
+
}
|
|
1160
|
+
processBuffer();
|
|
1161
|
+
if (!newMode.returnBegin && !newMode.excludeBegin) {
|
|
1162
|
+
modeBuffer = lexeme;
|
|
1163
|
+
}
|
|
1164
|
+
}
|
|
1165
|
+
startNewMode(newMode, match);
|
|
1166
|
+
return newMode.returnBegin ? 0 : lexeme.length;
|
|
789
1167
|
}
|
|
790
|
-
function
|
|
791
|
-
const
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
1168
|
+
function doEndMatch(match) {
|
|
1169
|
+
const lexeme = match[0];
|
|
1170
|
+
const matchPlusRemainder = codeToHighlight.substring(match.index);
|
|
1171
|
+
const endMode = endOfMode(top, match, matchPlusRemainder);
|
|
1172
|
+
if (!endMode) {
|
|
1173
|
+
return NO_MATCH;
|
|
1174
|
+
}
|
|
1175
|
+
const origin = top;
|
|
1176
|
+
if (top.endScope && top.endScope._wrap) {
|
|
1177
|
+
processBuffer();
|
|
1178
|
+
emitter.addKeyword(lexeme, top.endScope._wrap);
|
|
1179
|
+
} else if (top.endScope && top.endScope._multi) {
|
|
1180
|
+
processBuffer();
|
|
1181
|
+
emitMultiClass(top.endScope, match);
|
|
1182
|
+
} else if (origin.skip) {
|
|
1183
|
+
modeBuffer += lexeme;
|
|
1184
|
+
} else {
|
|
1185
|
+
if (!(origin.returnEnd || origin.excludeEnd)) {
|
|
1186
|
+
modeBuffer += lexeme;
|
|
1187
|
+
}
|
|
1188
|
+
processBuffer();
|
|
1189
|
+
if (origin.excludeEnd) {
|
|
1190
|
+
modeBuffer = lexeme;
|
|
1191
|
+
}
|
|
1192
|
+
}
|
|
1193
|
+
do {
|
|
1194
|
+
if (top.scope) {
|
|
1195
|
+
emitter.closeNode();
|
|
1196
|
+
}
|
|
1197
|
+
if (!top.skip && !top.subLanguage) {
|
|
1198
|
+
relevance += top.relevance;
|
|
1199
|
+
}
|
|
1200
|
+
top = top.parent;
|
|
1201
|
+
} while (top !== endMode.parent);
|
|
1202
|
+
if (endMode.starts) {
|
|
1203
|
+
startNewMode(endMode.starts, match);
|
|
1204
|
+
}
|
|
1205
|
+
return origin.returnEnd ? 0 : lexeme.length;
|
|
800
1206
|
}
|
|
801
|
-
function
|
|
802
|
-
const
|
|
803
|
-
for (let
|
|
804
|
-
|
|
805
|
-
|
|
1207
|
+
function processContinuations() {
|
|
1208
|
+
const list = [];
|
|
1209
|
+
for (let current = top; current !== language; current = current.parent) {
|
|
1210
|
+
if (current.scope) {
|
|
1211
|
+
list.unshift(current.scope);
|
|
1212
|
+
}
|
|
1213
|
+
}
|
|
1214
|
+
list.forEach((item) => emitter.openNode(item));
|
|
806
1215
|
}
|
|
807
|
-
let
|
|
808
|
-
function
|
|
809
|
-
const
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
1216
|
+
let lastMatch = {};
|
|
1217
|
+
function processLexeme(textBeforeMatch, match) {
|
|
1218
|
+
const lexeme = match && match[0];
|
|
1219
|
+
modeBuffer += textBeforeMatch;
|
|
1220
|
+
if (lexeme == null) {
|
|
1221
|
+
processBuffer();
|
|
1222
|
+
return 0;
|
|
1223
|
+
}
|
|
1224
|
+
if (lastMatch.type === "begin" && match.type === "end" && lastMatch.index === match.index && lexeme === "") {
|
|
1225
|
+
modeBuffer += codeToHighlight.slice(match.index, match.index + 1);
|
|
1226
|
+
if (!SAFE_MODE) {
|
|
1227
|
+
const err = new Error(`0 width match regex (${languageName})`);
|
|
1228
|
+
err.languageName = languageName;
|
|
1229
|
+
err.badRule = lastMatch.rule;
|
|
1230
|
+
throw err;
|
|
816
1231
|
}
|
|
817
1232
|
return 1;
|
|
818
1233
|
}
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
1234
|
+
lastMatch = match;
|
|
1235
|
+
if (match.type === "begin") {
|
|
1236
|
+
return doBeginMatch(match);
|
|
1237
|
+
} else if (match.type === "illegal" && !ignoreIllegals) {
|
|
1238
|
+
const err = new Error('Illegal lexeme "' + lexeme + '" for mode "' + (top.scope || "<unnamed>") + '"');
|
|
1239
|
+
err.mode = top;
|
|
1240
|
+
throw err;
|
|
1241
|
+
} else if (match.type === "end") {
|
|
1242
|
+
const processed = doEndMatch(match);
|
|
1243
|
+
if (processed !== NO_MATCH) {
|
|
1244
|
+
return processed;
|
|
1245
|
+
}
|
|
828
1246
|
}
|
|
829
|
-
if (
|
|
1247
|
+
if (match.type === "illegal" && lexeme === "") {
|
|
830
1248
|
return 1;
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
1249
|
+
}
|
|
1250
|
+
if (iterations > 1e5 && iterations > match.index * 3) {
|
|
1251
|
+
const err = new Error("potential infinite loop, way more iterations than matches");
|
|
1252
|
+
throw err;
|
|
1253
|
+
}
|
|
1254
|
+
modeBuffer += lexeme;
|
|
1255
|
+
return lexeme.length;
|
|
1256
|
+
}
|
|
1257
|
+
const language = getLanguage(languageName);
|
|
1258
|
+
if (!language) {
|
|
1259
|
+
error(LANGUAGE_NOT_FOUND.replace("{}", languageName));
|
|
1260
|
+
throw new Error('Unknown language: "' + languageName + '"');
|
|
834
1261
|
}
|
|
835
|
-
const
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
const
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
let
|
|
1262
|
+
const md = compileLanguage(language);
|
|
1263
|
+
let result = "";
|
|
1264
|
+
let top = continuation || md;
|
|
1265
|
+
const continuations = {};
|
|
1266
|
+
const emitter = new options.__emitter(options);
|
|
1267
|
+
processContinuations();
|
|
1268
|
+
let modeBuffer = "";
|
|
1269
|
+
let relevance = 0;
|
|
1270
|
+
let index = 0;
|
|
1271
|
+
let iterations = 0;
|
|
1272
|
+
let resumeScanAtSamePosition = false;
|
|
843
1273
|
try {
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
if (
|
|
1274
|
+
top.matcher.considerAll();
|
|
1275
|
+
for (; ; ) {
|
|
1276
|
+
iterations++;
|
|
1277
|
+
if (resumeScanAtSamePosition) {
|
|
1278
|
+
resumeScanAtSamePosition = false;
|
|
1279
|
+
} else {
|
|
1280
|
+
top.matcher.considerAll();
|
|
1281
|
+
}
|
|
1282
|
+
top.matcher.lastIndex = index;
|
|
1283
|
+
const match = top.matcher.exec(codeToHighlight);
|
|
1284
|
+
if (!match)
|
|
848
1285
|
break;
|
|
849
|
-
const
|
|
850
|
-
|
|
1286
|
+
const beforeMatch = codeToHighlight.substring(index, match.index);
|
|
1287
|
+
const processedCount = processLexeme(beforeMatch, match);
|
|
1288
|
+
index = match.index + processedCount;
|
|
851
1289
|
}
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
1290
|
+
processLexeme(codeToHighlight.substring(index));
|
|
1291
|
+
emitter.closeAllNodes();
|
|
1292
|
+
emitter.finalize();
|
|
1293
|
+
result = emitter.toHTML();
|
|
1294
|
+
return {
|
|
1295
|
+
language: languageName,
|
|
1296
|
+
value: result,
|
|
1297
|
+
relevance,
|
|
1298
|
+
illegal: false,
|
|
1299
|
+
_emitter: emitter,
|
|
1300
|
+
_top: top
|
|
859
1301
|
};
|
|
860
|
-
} catch (
|
|
861
|
-
if (
|
|
1302
|
+
} catch (err) {
|
|
1303
|
+
if (err.message && err.message.includes("Illegal")) {
|
|
862
1304
|
return {
|
|
863
|
-
language:
|
|
864
|
-
value:
|
|
865
|
-
illegal:
|
|
1305
|
+
language: languageName,
|
|
1306
|
+
value: escape(codeToHighlight),
|
|
1307
|
+
illegal: true,
|
|
866
1308
|
relevance: 0,
|
|
867
1309
|
_illegalBy: {
|
|
868
|
-
message:
|
|
869
|
-
index
|
|
870
|
-
context:
|
|
871
|
-
mode:
|
|
872
|
-
resultSoFar:
|
|
1310
|
+
message: err.message,
|
|
1311
|
+
index,
|
|
1312
|
+
context: codeToHighlight.slice(index - 100, index + 100),
|
|
1313
|
+
mode: err.mode,
|
|
1314
|
+
resultSoFar: result
|
|
873
1315
|
},
|
|
874
|
-
_emitter:
|
|
1316
|
+
_emitter: emitter
|
|
875
1317
|
};
|
|
876
|
-
if (
|
|
1318
|
+
} else if (SAFE_MODE) {
|
|
877
1319
|
return {
|
|
878
|
-
language:
|
|
879
|
-
value:
|
|
880
|
-
illegal:
|
|
1320
|
+
language: languageName,
|
|
1321
|
+
value: escape(codeToHighlight),
|
|
1322
|
+
illegal: false,
|
|
881
1323
|
relevance: 0,
|
|
882
|
-
errorRaised:
|
|
883
|
-
_emitter:
|
|
884
|
-
_top:
|
|
1324
|
+
errorRaised: err,
|
|
1325
|
+
_emitter: emitter,
|
|
1326
|
+
_top: top
|
|
885
1327
|
};
|
|
886
|
-
|
|
1328
|
+
} else {
|
|
1329
|
+
throw err;
|
|
1330
|
+
}
|
|
887
1331
|
}
|
|
888
1332
|
}
|
|
889
|
-
function
|
|
890
|
-
const
|
|
891
|
-
value:
|
|
892
|
-
illegal:
|
|
1333
|
+
function justTextHighlightResult(code) {
|
|
1334
|
+
const result = {
|
|
1335
|
+
value: escape(code),
|
|
1336
|
+
illegal: false,
|
|
893
1337
|
relevance: 0,
|
|
894
|
-
_top:
|
|
895
|
-
_emitter: new
|
|
1338
|
+
_top: PLAINTEXT_LANGUAGE,
|
|
1339
|
+
_emitter: new options.__emitter(options)
|
|
896
1340
|
};
|
|
897
|
-
|
|
1341
|
+
result._emitter.addText(code);
|
|
1342
|
+
return result;
|
|
898
1343
|
}
|
|
899
|
-
function
|
|
900
|
-
|
|
901
|
-
const
|
|
902
|
-
|
|
1344
|
+
function highlightAuto(code, languageSubset) {
|
|
1345
|
+
languageSubset = languageSubset || options.languages || Object.keys(languages);
|
|
1346
|
+
const plaintext = justTextHighlightResult(code);
|
|
1347
|
+
const results = languageSubset.filter(getLanguage).filter(autoDetection).map(
|
|
1348
|
+
(name) => _highlight(name, code, false)
|
|
903
1349
|
);
|
|
904
|
-
|
|
905
|
-
const
|
|
906
|
-
if (
|
|
907
|
-
return
|
|
908
|
-
if (
|
|
909
|
-
if (
|
|
1350
|
+
results.unshift(plaintext);
|
|
1351
|
+
const sorted = results.sort((a, b) => {
|
|
1352
|
+
if (a.relevance !== b.relevance)
|
|
1353
|
+
return b.relevance - a.relevance;
|
|
1354
|
+
if (a.language && b.language) {
|
|
1355
|
+
if (getLanguage(a.language).supersetOf === b.language) {
|
|
910
1356
|
return 1;
|
|
911
|
-
if (
|
|
1357
|
+
} else if (getLanguage(b.language).supersetOf === a.language) {
|
|
912
1358
|
return -1;
|
|
1359
|
+
}
|
|
913
1360
|
}
|
|
914
1361
|
return 0;
|
|
915
|
-
})
|
|
916
|
-
|
|
1362
|
+
});
|
|
1363
|
+
const [best, secondBest] = sorted;
|
|
1364
|
+
const result = best;
|
|
1365
|
+
result.secondBest = secondBest;
|
|
1366
|
+
return result;
|
|
917
1367
|
}
|
|
918
|
-
function
|
|
919
|
-
const
|
|
920
|
-
|
|
1368
|
+
function updateClassName(element, currentLang, resultLang) {
|
|
1369
|
+
const language = currentLang && aliases[currentLang] || resultLang;
|
|
1370
|
+
element.classList.add("hljs");
|
|
1371
|
+
element.classList.add(`language-${language}`);
|
|
921
1372
|
}
|
|
922
|
-
function
|
|
923
|
-
let
|
|
924
|
-
const
|
|
925
|
-
if (
|
|
1373
|
+
function highlightElement(element) {
|
|
1374
|
+
let node = null;
|
|
1375
|
+
const language = blockLanguage(element);
|
|
1376
|
+
if (shouldNotHighlight(language))
|
|
926
1377
|
return;
|
|
927
|
-
|
|
1378
|
+
fire(
|
|
928
1379
|
"before:highlightElement",
|
|
929
|
-
{ el:
|
|
930
|
-
)
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
1380
|
+
{ el: element, language }
|
|
1381
|
+
);
|
|
1382
|
+
if (element.children.length > 0) {
|
|
1383
|
+
if (!options.ignoreUnescapedHTML) {
|
|
1384
|
+
console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk.");
|
|
1385
|
+
console.warn("https://github.com/highlightjs/highlight.js/wiki/security");
|
|
1386
|
+
console.warn("The element with unescaped HTML:");
|
|
1387
|
+
console.warn(element);
|
|
1388
|
+
}
|
|
1389
|
+
if (options.throwUnescapedHTML) {
|
|
1390
|
+
const err = new HTMLInjectionError(
|
|
1391
|
+
"One of your code blocks includes unescaped HTML.",
|
|
1392
|
+
element.innerHTML
|
|
1393
|
+
);
|
|
1394
|
+
throw err;
|
|
1395
|
+
}
|
|
1396
|
+
}
|
|
1397
|
+
node = element;
|
|
1398
|
+
const text = node.textContent;
|
|
1399
|
+
const result = language ? highlight2(text, { language, ignoreIllegals: true }) : highlightAuto(text);
|
|
1400
|
+
element.innerHTML = result.value;
|
|
1401
|
+
updateClassName(element, language, result.language);
|
|
1402
|
+
element.result = {
|
|
1403
|
+
language: result.language,
|
|
939
1404
|
// TODO: remove with version 11.0
|
|
940
|
-
re:
|
|
941
|
-
relevance:
|
|
942
|
-
}
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
1405
|
+
re: result.relevance,
|
|
1406
|
+
relevance: result.relevance
|
|
1407
|
+
};
|
|
1408
|
+
if (result.secondBest) {
|
|
1409
|
+
element.secondBest = {
|
|
1410
|
+
language: result.secondBest.language,
|
|
1411
|
+
relevance: result.secondBest.relevance
|
|
1412
|
+
};
|
|
1413
|
+
}
|
|
1414
|
+
fire("after:highlightElement", { el: element, result, text });
|
|
1415
|
+
}
|
|
1416
|
+
function configure(userOptions) {
|
|
1417
|
+
options = inherit(options, userOptions);
|
|
1418
|
+
}
|
|
1419
|
+
const initHighlighting = () => {
|
|
1420
|
+
highlightAll();
|
|
1421
|
+
deprecated("10.6.0", "initHighlighting() deprecated. Use highlightAll() now.");
|
|
952
1422
|
};
|
|
953
|
-
function
|
|
954
|
-
|
|
1423
|
+
function initHighlightingOnLoad() {
|
|
1424
|
+
highlightAll();
|
|
1425
|
+
deprecated("10.6.0", "initHighlightingOnLoad() deprecated. Use highlightAll() now.");
|
|
955
1426
|
}
|
|
956
|
-
let
|
|
957
|
-
function
|
|
1427
|
+
let wantsHighlight = false;
|
|
1428
|
+
function highlightAll() {
|
|
958
1429
|
if (document.readyState === "loading") {
|
|
959
|
-
|
|
1430
|
+
wantsHighlight = true;
|
|
960
1431
|
return;
|
|
961
1432
|
}
|
|
962
|
-
document.querySelectorAll(
|
|
1433
|
+
const blocks = document.querySelectorAll(options.cssSelector);
|
|
1434
|
+
blocks.forEach(highlightElement);
|
|
1435
|
+
}
|
|
1436
|
+
function boot() {
|
|
1437
|
+
if (wantsHighlight)
|
|
1438
|
+
highlightAll();
|
|
963
1439
|
}
|
|
964
|
-
|
|
965
|
-
|
|
1440
|
+
if (typeof window !== "undefined" && window.addEventListener) {
|
|
1441
|
+
window.addEventListener("DOMContentLoaded", boot, false);
|
|
966
1442
|
}
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
let h = null;
|
|
1443
|
+
function registerLanguage(languageName, languageDefinition) {
|
|
1444
|
+
let lang = null;
|
|
970
1445
|
try {
|
|
971
|
-
|
|
972
|
-
} catch (
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
1446
|
+
lang = languageDefinition(hljs);
|
|
1447
|
+
} catch (error$1) {
|
|
1448
|
+
error("Language definition for '{}' could not be registered.".replace("{}", languageName));
|
|
1449
|
+
if (!SAFE_MODE) {
|
|
1450
|
+
throw error$1;
|
|
1451
|
+
} else {
|
|
1452
|
+
error(error$1);
|
|
1453
|
+
}
|
|
1454
|
+
lang = PLAINTEXT_LANGUAGE;
|
|
1455
|
+
}
|
|
1456
|
+
if (!lang.name)
|
|
1457
|
+
lang.name = languageName;
|
|
1458
|
+
languages[languageName] = lang;
|
|
1459
|
+
lang.rawDefinition = languageDefinition.bind(null, hljs);
|
|
1460
|
+
if (lang.aliases) {
|
|
1461
|
+
registerAliases(lang.aliases, { languageName });
|
|
978
1462
|
}
|
|
979
|
-
h.name || (h.name = n), t[n] = h, h.rawDefinition = a.bind(null, e), h.aliases && ae(h.aliases, { languageName: n });
|
|
980
1463
|
}
|
|
981
|
-
function
|
|
982
|
-
delete
|
|
983
|
-
for (const
|
|
984
|
-
|
|
1464
|
+
function unregisterLanguage(languageName) {
|
|
1465
|
+
delete languages[languageName];
|
|
1466
|
+
for (const alias of Object.keys(aliases)) {
|
|
1467
|
+
if (aliases[alias] === languageName) {
|
|
1468
|
+
delete aliases[alias];
|
|
1469
|
+
}
|
|
1470
|
+
}
|
|
985
1471
|
}
|
|
986
|
-
function
|
|
987
|
-
return Object.keys(
|
|
1472
|
+
function listLanguages() {
|
|
1473
|
+
return Object.keys(languages);
|
|
988
1474
|
}
|
|
989
|
-
function
|
|
990
|
-
|
|
1475
|
+
function getLanguage(name) {
|
|
1476
|
+
name = (name || "").toLowerCase();
|
|
1477
|
+
return languages[name] || languages[aliases[name]];
|
|
991
1478
|
}
|
|
992
|
-
function
|
|
993
|
-
typeof
|
|
994
|
-
|
|
1479
|
+
function registerAliases(aliasList, { languageName }) {
|
|
1480
|
+
if (typeof aliasList === "string") {
|
|
1481
|
+
aliasList = [aliasList];
|
|
1482
|
+
}
|
|
1483
|
+
aliasList.forEach((alias) => {
|
|
1484
|
+
aliases[alias.toLowerCase()] = languageName;
|
|
995
1485
|
});
|
|
996
1486
|
}
|
|
997
|
-
function
|
|
998
|
-
const
|
|
999
|
-
return
|
|
1487
|
+
function autoDetection(name) {
|
|
1488
|
+
const lang = getLanguage(name);
|
|
1489
|
+
return lang && !lang.disableAutodetect;
|
|
1000
1490
|
}
|
|
1001
|
-
function
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1491
|
+
function upgradePluginAPI(plugin) {
|
|
1492
|
+
if (plugin["before:highlightBlock"] && !plugin["before:highlightElement"]) {
|
|
1493
|
+
plugin["before:highlightElement"] = (data) => {
|
|
1494
|
+
plugin["before:highlightBlock"](
|
|
1495
|
+
Object.assign({ block: data.el }, data)
|
|
1496
|
+
);
|
|
1497
|
+
};
|
|
1498
|
+
}
|
|
1499
|
+
if (plugin["after:highlightBlock"] && !plugin["after:highlightElement"]) {
|
|
1500
|
+
plugin["after:highlightElement"] = (data) => {
|
|
1501
|
+
plugin["after:highlightBlock"](
|
|
1502
|
+
Object.assign({ block: data.el }, data)
|
|
1503
|
+
);
|
|
1504
|
+
};
|
|
1505
|
+
}
|
|
1011
1506
|
}
|
|
1012
|
-
function
|
|
1013
|
-
|
|
1507
|
+
function addPlugin(plugin) {
|
|
1508
|
+
upgradePluginAPI(plugin);
|
|
1509
|
+
plugins.push(plugin);
|
|
1014
1510
|
}
|
|
1015
|
-
function
|
|
1016
|
-
const
|
|
1017
|
-
|
|
1018
|
-
|
|
1511
|
+
function fire(event, args) {
|
|
1512
|
+
const cb = event;
|
|
1513
|
+
plugins.forEach(function(plugin) {
|
|
1514
|
+
if (plugin[cb]) {
|
|
1515
|
+
plugin[cb](args);
|
|
1516
|
+
}
|
|
1019
1517
|
});
|
|
1020
1518
|
}
|
|
1021
|
-
function
|
|
1022
|
-
|
|
1519
|
+
function deprecateHighlightBlock(el) {
|
|
1520
|
+
deprecated("10.7.0", "highlightBlock will be removed entirely in v12.0");
|
|
1521
|
+
deprecated("10.7.0", "Please use highlightElement now.");
|
|
1522
|
+
return highlightElement(el);
|
|
1023
1523
|
}
|
|
1024
|
-
Object.assign(
|
|
1025
|
-
highlight:
|
|
1026
|
-
highlightAuto
|
|
1027
|
-
highlightAll
|
|
1028
|
-
highlightElement
|
|
1524
|
+
Object.assign(hljs, {
|
|
1525
|
+
highlight: highlight2,
|
|
1526
|
+
highlightAuto,
|
|
1527
|
+
highlightAll,
|
|
1528
|
+
highlightElement,
|
|
1029
1529
|
// TODO: Remove with v12 API
|
|
1030
|
-
highlightBlock:
|
|
1031
|
-
configure
|
|
1032
|
-
initHighlighting
|
|
1033
|
-
initHighlightingOnLoad
|
|
1034
|
-
registerLanguage
|
|
1035
|
-
unregisterLanguage
|
|
1036
|
-
listLanguages
|
|
1037
|
-
getLanguage
|
|
1038
|
-
registerAliases
|
|
1039
|
-
autoDetection
|
|
1040
|
-
inherit
|
|
1041
|
-
addPlugin
|
|
1042
|
-
})
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1530
|
+
highlightBlock: deprecateHighlightBlock,
|
|
1531
|
+
configure,
|
|
1532
|
+
initHighlighting,
|
|
1533
|
+
initHighlightingOnLoad,
|
|
1534
|
+
registerLanguage,
|
|
1535
|
+
unregisterLanguage,
|
|
1536
|
+
listLanguages,
|
|
1537
|
+
getLanguage,
|
|
1538
|
+
registerAliases,
|
|
1539
|
+
autoDetection,
|
|
1540
|
+
inherit,
|
|
1541
|
+
addPlugin
|
|
1542
|
+
});
|
|
1543
|
+
hljs.debugMode = function() {
|
|
1544
|
+
SAFE_MODE = false;
|
|
1545
|
+
};
|
|
1546
|
+
hljs.safeMode = function() {
|
|
1547
|
+
SAFE_MODE = true;
|
|
1548
|
+
};
|
|
1549
|
+
hljs.versionString = version;
|
|
1550
|
+
hljs.regex = {
|
|
1551
|
+
concat,
|
|
1552
|
+
lookahead,
|
|
1553
|
+
either,
|
|
1554
|
+
optional,
|
|
1555
|
+
anyNumberOfTimes
|
|
1052
1556
|
};
|
|
1053
|
-
for (const
|
|
1054
|
-
typeof
|
|
1055
|
-
|
|
1557
|
+
for (const key in MODES) {
|
|
1558
|
+
if (typeof MODES[key] === "object") {
|
|
1559
|
+
deepFreezeEs6.exports(MODES[key]);
|
|
1560
|
+
}
|
|
1561
|
+
}
|
|
1562
|
+
Object.assign(hljs, MODES);
|
|
1563
|
+
return hljs;
|
|
1056
1564
|
};
|
|
1057
|
-
var
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1565
|
+
var highlight = HLJS({});
|
|
1566
|
+
var core = highlight;
|
|
1567
|
+
highlight.HighlightJS = highlight;
|
|
1568
|
+
highlight.default = highlight;
|
|
1569
|
+
const HighlightJS = core;
|
|
1061
1570
|
export {
|
|
1062
|
-
|
|
1063
|
-
|
|
1571
|
+
core as c,
|
|
1572
|
+
HighlightJS as default
|
|
1064
1573
|
};
|