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