add code highlighting

This commit is contained in:
Dwsy 2023-02-15 11:07:21 +08:00 committed by Redon
parent 79dd6c5e18
commit 8dab963628
9 changed files with 88 additions and 95 deletions

2
.env
View File

@ -1,2 +1,2 @@
# Glob API URL
VITE_GLOB_API_URL='http://localhost:3002'
VITE_GLOB_API_URL='http://20.222.29.173:3002'

11
1.js Normal file
View File

@ -0,0 +1,11 @@
// String containing code snippets
let str = "let x = 10; console.log(x);"
// Create regex pattern
let regexp = /^(?:\s{4}|\t).+/gm
// Test if any code snippets were detected
if (str.match(regexp)) {
// Code snippet was detected, do something with it
console.log(str)
}

View File

@ -22,6 +22,7 @@
"common:prepare": "husky install"
},
"dependencies": {
"highlight.js": "^11.7.0",
"naive-ui": "^2.34.3",
"pinia": "^2.0.30",
"vue": "^3.2.47",

View File

@ -1,4 +1,4 @@
lockfileVersion: 5.4
lockfileVersion: 5.3
specifiers:
'@antfu/eslint-config': ^0.35.2
@ -12,6 +12,7 @@ specifiers:
axios: ^1.3.2
crypto-js: ^4.1.1
eslint: ^8.34.0
highlight.js: ^11.7.0
husky: ^8.0.3
lint-staged: ^13.1.1
naive-ui: ^2.34.3
@ -27,13 +28,14 @@ specifiers:
vue-tsc: ^1.0.24
dependencies:
highlight.js: 11.7.0
naive-ui: 2.34.3_vue@3.2.47
pinia: 2.0.30_hmuptsblhheur2tugfgucj7gc4
pinia: 2.0.30_typescript@4.9.5+vue@3.2.47
vue: 3.2.47
vue-router: 4.1.6_vue@3.2.47
devDependencies:
'@antfu/eslint-config': 0.35.2_7kw3g6rralp5ps6mg3uyzz6azm
'@antfu/eslint-config': 0.35.2_eslint@8.34.0+typescript@4.9.5
'@commitlint/cli': 17.4.3
'@commitlint/config-conventional': 17.4.3
'@iconify/vue': 4.1.0_vue@3.2.47
@ -49,93 +51,85 @@ devDependencies:
npm-run-all: 4.1.5
postcss: 8.4.21
rimraf: 4.1.2
tailwindcss: 3.2.6_postcss@8.4.21
tailwindcss: 3.2.6
typescript: 4.9.5
vite: 4.1.1_@types+node@18.13.0
vue-tsc: 1.0.24_typescript@4.9.5
packages:
/@antfu/eslint-config-basic/0.35.2_6ike4423xm2xnh233ikrbff5m4:
/@antfu/eslint-config-basic/0.35.2_b676bbf5f101a168ab75b3e568fc2dcd:
resolution: {integrity: sha512-2k7Ovkd8U/q0sgfjuT9KzAUV0q187yGxP7JzD2D4YifuJwL5Bh3JC49KpCv9PXMTeRUMJX2y/kOtGYPetocOug==}
peerDependencies:
eslint: '>=7.4.0'
dependencies:
eslint: 8.34.0
eslint-plugin-antfu: 0.35.2_7kw3g6rralp5ps6mg3uyzz6azm
eslint-plugin-antfu: 0.35.2_eslint@8.34.0+typescript@4.9.5
eslint-plugin-eslint-comments: 3.2.0_eslint@8.34.0
eslint-plugin-html: 7.1.0
eslint-plugin-import: 2.27.5_62tsymtiqxebhmxuag4hg3gx2m
eslint-plugin-import: 2.27.5_eslint@8.34.0
eslint-plugin-jsonc: 2.6.0_eslint@8.34.0
eslint-plugin-markdown: 3.0.0_eslint@8.34.0
eslint-plugin-n: 15.6.1_eslint@8.34.0
eslint-plugin-no-only-tests: 3.1.0
eslint-plugin-promise: 6.1.1_eslint@8.34.0
eslint-plugin-unicorn: 45.0.2_eslint@8.34.0
eslint-plugin-unused-imports: 2.0.0_b5d7vn5fvb66hlq4xz6bd5gdxm
eslint-plugin-unused-imports: 2.0.0_0f47fab7a5a87de3ae1cbe7c11f4c3bb
eslint-plugin-yml: 1.5.0_eslint@8.34.0
jsonc-eslint-parser: 2.1.0
yaml-eslint-parser: 1.1.0
transitivePeerDependencies:
- '@typescript-eslint/eslint-plugin'
- '@typescript-eslint/parser'
- eslint-import-resolver-typescript
- eslint-import-resolver-webpack
- supports-color
- typescript
dev: true
/@antfu/eslint-config-ts/0.35.2_7kw3g6rralp5ps6mg3uyzz6azm:
/@antfu/eslint-config-ts/0.35.2_eslint@8.34.0+typescript@4.9.5:
resolution: {integrity: sha512-GiJtTCQ83L/vMkJlWWg2l0buH/LIOXl5szrsqtr8/Hl6ssjAMXnug8sDZMCqCIZtztzQCewBPx8ufp/MpzA2cQ==}
peerDependencies:
eslint: '>=7.4.0'
typescript: '>=3.9'
dependencies:
'@antfu/eslint-config-basic': 0.35.2_6ike4423xm2xnh233ikrbff5m4
'@typescript-eslint/eslint-plugin': 5.51.0_z4swst3wuuqk4hlme4ajzslgh4
'@typescript-eslint/parser': 5.51.0_7kw3g6rralp5ps6mg3uyzz6azm
'@antfu/eslint-config-basic': 0.35.2_b676bbf5f101a168ab75b3e568fc2dcd
'@typescript-eslint/eslint-plugin': 5.51.0_cf25694f76a520ae1d6c27009cc9663f
'@typescript-eslint/parser': 5.51.0_eslint@8.34.0+typescript@4.9.5
eslint: 8.34.0
eslint-plugin-jest: 27.2.1_wz3lx5pragqwrk3vwpswr7bnzu
eslint-plugin-jest: 27.2.1_b676bbf5f101a168ab75b3e568fc2dcd
typescript: 4.9.5
transitivePeerDependencies:
- eslint-import-resolver-typescript
- eslint-import-resolver-webpack
- jest
- supports-color
dev: true
/@antfu/eslint-config-vue/0.35.2_6ike4423xm2xnh233ikrbff5m4:
/@antfu/eslint-config-vue/0.35.2_b676bbf5f101a168ab75b3e568fc2dcd:
resolution: {integrity: sha512-98k9D+n0bgr/9OqedAEOsflIWbXz4D92pejXqkUAtnRnB2Nq5dWrrFMJ59oJwTDKnEslpwANlgIXM11qdiTF0Q==}
peerDependencies:
eslint: '>=7.4.0'
dependencies:
'@antfu/eslint-config-basic': 0.35.2_6ike4423xm2xnh233ikrbff5m4
'@antfu/eslint-config-ts': 0.35.2_7kw3g6rralp5ps6mg3uyzz6azm
'@antfu/eslint-config-basic': 0.35.2_b676bbf5f101a168ab75b3e568fc2dcd
'@antfu/eslint-config-ts': 0.35.2_eslint@8.34.0+typescript@4.9.5
eslint: 8.34.0
eslint-plugin-vue: 9.9.0_eslint@8.34.0
local-pkg: 0.4.3
transitivePeerDependencies:
- '@typescript-eslint/eslint-plugin'
- '@typescript-eslint/parser'
- eslint-import-resolver-typescript
- eslint-import-resolver-webpack
- jest
- supports-color
- typescript
dev: true
/@antfu/eslint-config/0.35.2_7kw3g6rralp5ps6mg3uyzz6azm:
/@antfu/eslint-config/0.35.2_eslint@8.34.0+typescript@4.9.5:
resolution: {integrity: sha512-bbm7Yh7VgNI9ZaYs/L1oSTQwPMIdvlRtqxPfaBLpYdEvnsOuT4yX84TO0YaZ4RFjE4jqxQCSE/eioxydmWnl4w==}
peerDependencies:
eslint: '>=7.4.0'
dependencies:
'@antfu/eslint-config-vue': 0.35.2_6ike4423xm2xnh233ikrbff5m4
'@typescript-eslint/eslint-plugin': 5.51.0_z4swst3wuuqk4hlme4ajzslgh4
'@typescript-eslint/parser': 5.51.0_7kw3g6rralp5ps6mg3uyzz6azm
'@antfu/eslint-config-vue': 0.35.2_b676bbf5f101a168ab75b3e568fc2dcd
'@typescript-eslint/eslint-plugin': 5.51.0_cf25694f76a520ae1d6c27009cc9663f
'@typescript-eslint/parser': 5.51.0_eslint@8.34.0+typescript@4.9.5
eslint: 8.34.0
eslint-plugin-eslint-comments: 3.2.0_eslint@8.34.0
eslint-plugin-html: 7.1.0
eslint-plugin-import: 2.27.5_62tsymtiqxebhmxuag4hg3gx2m
eslint-plugin-import: 2.27.5_eslint@8.34.0
eslint-plugin-jsonc: 2.6.0_eslint@8.34.0
eslint-plugin-n: 15.6.1_eslint@8.34.0
eslint-plugin-promise: 6.1.1_eslint@8.34.0
@ -145,8 +139,6 @@ packages:
jsonc-eslint-parser: 2.1.0
yaml-eslint-parser: 1.1.0
transitivePeerDependencies:
- eslint-import-resolver-typescript
- eslint-import-resolver-webpack
- jest
- supports-color
- typescript
@ -280,12 +272,12 @@ packages:
'@types/node': 18.13.0
chalk: 4.1.2
cosmiconfig: 8.0.0
cosmiconfig-typescript-loader: 4.3.0_p7cp6dsfhdrlk7mvuxd3wodbsu
cosmiconfig-typescript-loader: 4.3.0_7fc4ff0e4538e2b57d95a5c7bb386195
lodash.isplainobject: 4.0.6
lodash.merge: 4.6.2
lodash.uniq: 4.5.0
resolve-from: 5.0.0
ts-node: 10.9.1_4bewfcp2iebiwuold25d6rgcsy
ts-node: 10.9.1_e0496289fa41028b51cb1eba3f44c296
typescript: 4.9.5
transitivePeerDependencies:
- '@swc/core'
@ -753,7 +745,7 @@ packages:
resolution: {integrity: sha512-PBjIUxZHOuj0R15/xuwJYjFi+KZdNFrehocChv4g5hu6aFroHue8m0lBP0POdK2nKzbw0cgV1mws8+V/JAcEkQ==}
dev: true
/@typescript-eslint/eslint-plugin/5.51.0_z4swst3wuuqk4hlme4ajzslgh4:
/@typescript-eslint/eslint-plugin/5.51.0_cf25694f76a520ae1d6c27009cc9663f:
resolution: {integrity: sha512-wcAwhEWm1RgNd7dxD/o+nnLW8oH+6RK1OGnmbmkj/GGoDPV1WWMVP0FXYQBivKHdwM1pwii3bt//RC62EriIUQ==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
peerDependencies:
@ -764,10 +756,10 @@ packages:
typescript:
optional: true
dependencies:
'@typescript-eslint/parser': 5.51.0_7kw3g6rralp5ps6mg3uyzz6azm
'@typescript-eslint/parser': 5.51.0_eslint@8.34.0+typescript@4.9.5
'@typescript-eslint/scope-manager': 5.51.0
'@typescript-eslint/type-utils': 5.51.0_7kw3g6rralp5ps6mg3uyzz6azm
'@typescript-eslint/utils': 5.51.0_7kw3g6rralp5ps6mg3uyzz6azm
'@typescript-eslint/type-utils': 5.51.0_eslint@8.34.0+typescript@4.9.5
'@typescript-eslint/utils': 5.51.0_eslint@8.34.0+typescript@4.9.5
debug: 4.3.4
eslint: 8.34.0
grapheme-splitter: 1.0.4
@ -781,7 +773,7 @@ packages:
- supports-color
dev: true
/@typescript-eslint/parser/5.51.0_7kw3g6rralp5ps6mg3uyzz6azm:
/@typescript-eslint/parser/5.51.0_eslint@8.34.0+typescript@4.9.5:
resolution: {integrity: sha512-fEV0R9gGmfpDeRzJXn+fGQKcl0inIeYobmmUWijZh9zA7bxJ8clPhV9up2ZQzATxAiFAECqPQyMDB4o4B81AaA==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
peerDependencies:
@ -809,7 +801,7 @@ packages:
'@typescript-eslint/visitor-keys': 5.51.0
dev: true
/@typescript-eslint/type-utils/5.51.0_7kw3g6rralp5ps6mg3uyzz6azm:
/@typescript-eslint/type-utils/5.51.0_eslint@8.34.0+typescript@4.9.5:
resolution: {integrity: sha512-QHC5KKyfV8sNSyHqfNa0UbTbJ6caB8uhcx2hYcWVvJAZYJRBo5HyyZfzMdRx8nvS+GyMg56fugMzzWnojREuQQ==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
peerDependencies:
@ -820,7 +812,7 @@ packages:
optional: true
dependencies:
'@typescript-eslint/typescript-estree': 5.51.0_typescript@4.9.5
'@typescript-eslint/utils': 5.51.0_7kw3g6rralp5ps6mg3uyzz6azm
'@typescript-eslint/utils': 5.51.0_eslint@8.34.0+typescript@4.9.5
debug: 4.3.4
eslint: 8.34.0
tsutils: 3.21.0_typescript@4.9.5
@ -855,7 +847,7 @@ packages:
- supports-color
dev: true
/@typescript-eslint/utils/5.51.0_7kw3g6rralp5ps6mg3uyzz6azm:
/@typescript-eslint/utils/5.51.0_eslint@8.34.0+typescript@4.9.5:
resolution: {integrity: sha512-76qs+5KWcaatmwtwsDJvBk4H76RJQBFe+Gext0EfJdC3Vd2kpY2Pf//OHHzHp84Ciw0/rYoGTDnIAr3uWhhJYw==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
peerDependencies:
@ -990,6 +982,7 @@ packages:
dependencies:
'@vue/reactivity': 3.2.47
'@vue/shared': 3.2.47
dev: false
/@vue/runtime-dom/3.2.47:
resolution: {integrity: sha512-ArXrFTjS6TsDei4qwNvgrdmHtD930KgSKGhS5M+j8QxXrDJYLqYw4RRcDy1bz1m1wMmb6j+zGLifdVHtkXA7gA==}
@ -997,6 +990,7 @@ packages:
'@vue/runtime-core': 3.2.47
'@vue/shared': 3.2.47
csstype: 2.6.21
dev: false
/@vue/server-renderer/3.2.47_vue@3.2.47:
resolution: {integrity: sha512-dN9gc1i8EvmP9RCzvneONXsKfBRgqFeFZLurmHOveL7oH6HiFXJw5OGu294n1nHc/HMgTy6LulU/tv5/A7f/LA==}
@ -1006,6 +1000,7 @@ packages:
'@vue/compiler-ssr': 3.2.47
'@vue/shared': 3.2.47
vue: 3.2.47
dev: false
/@vue/shared/3.2.47:
resolution: {integrity: sha512-BHGyyGN3Q97EZx0taMQ+OLNuZcW3d37ZEVmEAyeoA9ERdGvm9Irc/0Fua8SNyOtV1w6BS4q25wbMzJujO9HIfQ==}
@ -1480,15 +1475,15 @@ packages:
engines: {node: '>=10'}
hasBin: true
dependencies:
JSONStream: 1.3.5
is-text-path: 1.0.1
JSONStream: 1.3.5
lodash: 4.17.21
meow: 8.1.2
split2: 3.2.2
through2: 4.0.2
dev: true
/cosmiconfig-typescript-loader/4.3.0_p7cp6dsfhdrlk7mvuxd3wodbsu:
/cosmiconfig-typescript-loader/4.3.0_7fc4ff0e4538e2b57d95a5c7bb386195:
resolution: {integrity: sha512-NTxV1MFfZDLPiBMjxbHRwSh5LaLcPMwNdCutmnHJCKoVnlvldPWlllonKwrsRJ5pYZBIBGRWWU2tfvzxgeSW5Q==}
engines: {node: '>=12', npm: '>=6'}
peerDependencies:
@ -1499,7 +1494,7 @@ packages:
dependencies:
'@types/node': 18.13.0
cosmiconfig: 8.0.0
ts-node: 10.9.1_4bewfcp2iebiwuold25d6rgcsy
ts-node: 10.9.1_e0496289fa41028b51cb1eba3f44c296
typescript: 4.9.5
dev: true
@ -1556,6 +1551,7 @@ packages:
/csstype/2.6.21:
resolution: {integrity: sha512-Z1PhmomIfypOpoMjRQB70jfvy/wxT50qW08YXO5lMIJkrdq4yOTR+AW7FqutScmB9NkLwxo+jU+kZLbofZZq/w==}
dev: false
/csstype/3.0.11:
resolution: {integrity: sha512-sa6P2wJ+CAbgyy4KFssIb/JNMLxFvKF1pCYCSXS8ZMuqZnMsrxqI2E5sPyoTpxoPU/gVZMzr2zjOfg8GIZOMsw==}
@ -1585,11 +1581,6 @@ packages:
/debug/3.2.7:
resolution: {integrity: sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==}
peerDependencies:
supports-color: '*'
peerDependenciesMeta:
supports-color:
optional: true
dependencies:
ms: 2.1.3
dev: true
@ -1859,43 +1850,25 @@ packages:
debug: 3.2.7
is-core-module: 2.11.0
resolve: 1.22.1
transitivePeerDependencies:
- supports-color
dev: true
/eslint-module-utils/2.7.4_ithmlgmaospkvl4p7n7pyp3rgq:
/eslint-module-utils/2.7.4_eslint@8.34.0:
resolution: {integrity: sha512-j4GT+rqzCoRKHwURX7pddtIPGySnX9Si/cgMI5ztrcqOPtk5dDEeZ34CQVPphnqkJytlc97Vuk05Um2mJ3gEQA==}
engines: {node: '>=4'}
peerDependencies:
'@typescript-eslint/parser': '*'
eslint: '*'
eslint-import-resolver-node: '*'
eslint-import-resolver-typescript: '*'
eslint-import-resolver-webpack: '*'
peerDependenciesMeta:
'@typescript-eslint/parser':
optional: true
eslint:
optional: true
eslint-import-resolver-node:
optional: true
eslint-import-resolver-typescript:
optional: true
eslint-import-resolver-webpack:
optional: true
dependencies:
'@typescript-eslint/parser': 5.51.0_7kw3g6rralp5ps6mg3uyzz6azm
debug: 3.2.7
eslint: 8.34.0
eslint-import-resolver-node: 0.3.7
transitivePeerDependencies:
- supports-color
dev: true
/eslint-plugin-antfu/0.35.2_7kw3g6rralp5ps6mg3uyzz6azm:
/eslint-plugin-antfu/0.35.2_eslint@8.34.0+typescript@4.9.5:
resolution: {integrity: sha512-Q6FOcOakafU49PDRlq7jkrWmlTJ4u3AW7aGX+FqeQNaMgjXq0RzPGvS0Vyp7q/XDRLLoe0BjbGkamTeZXg8waw==}
dependencies:
'@typescript-eslint/utils': 5.51.0_7kw3g6rralp5ps6mg3uyzz6azm
'@typescript-eslint/utils': 5.51.0_eslint@8.34.0+typescript@4.9.5
transitivePeerDependencies:
- eslint
- supports-color
@ -1930,17 +1903,12 @@ packages:
htmlparser2: 8.0.1
dev: true
/eslint-plugin-import/2.27.5_62tsymtiqxebhmxuag4hg3gx2m:
/eslint-plugin-import/2.27.5_eslint@8.34.0:
resolution: {integrity: sha512-LmEt3GVofgiGuiE+ORpnvP+kAm3h6MLZJ4Q5HCyHADofsb4VzXFsRiWj3c0OFiV+3DWFh0qg3v9gcPlfc3zRow==}
engines: {node: '>=4'}
peerDependencies:
'@typescript-eslint/parser': '*'
eslint: ^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8
peerDependenciesMeta:
'@typescript-eslint/parser':
optional: true
dependencies:
'@typescript-eslint/parser': 5.51.0_7kw3g6rralp5ps6mg3uyzz6azm
array-includes: 3.1.6
array.prototype.flat: 1.3.1
array.prototype.flatmap: 1.3.1
@ -1948,7 +1916,7 @@ packages:
doctrine: 2.1.0
eslint: 8.34.0
eslint-import-resolver-node: 0.3.7
eslint-module-utils: 2.7.4_ithmlgmaospkvl4p7n7pyp3rgq
eslint-module-utils: 2.7.4_eslint@8.34.0
has: 1.0.3
is-core-module: 2.11.0
is-glob: 4.0.3
@ -1957,13 +1925,9 @@ packages:
resolve: 1.22.1
semver: 6.3.0
tsconfig-paths: 3.14.1
transitivePeerDependencies:
- eslint-import-resolver-typescript
- eslint-import-resolver-webpack
- supports-color
dev: true
/eslint-plugin-jest/27.2.1_wz3lx5pragqwrk3vwpswr7bnzu:
/eslint-plugin-jest/27.2.1_b676bbf5f101a168ab75b3e568fc2dcd:
resolution: {integrity: sha512-l067Uxx7ZT8cO9NJuf+eJHvt6bqJyz2Z29wykyEdz/OtmcELQl2MQGQLX8J94O1cSJWAwUSEvCjwjA7KEK3Hmg==}
engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
peerDependencies:
@ -1976,8 +1940,8 @@ packages:
jest:
optional: true
dependencies:
'@typescript-eslint/eslint-plugin': 5.51.0_z4swst3wuuqk4hlme4ajzslgh4
'@typescript-eslint/utils': 5.51.0_7kw3g6rralp5ps6mg3uyzz6azm
'@typescript-eslint/eslint-plugin': 5.51.0_cf25694f76a520ae1d6c27009cc9663f
'@typescript-eslint/utils': 5.51.0_eslint@8.34.0+typescript@4.9.5
eslint: 8.34.0
transitivePeerDependencies:
- supports-color
@ -2064,7 +2028,7 @@ packages:
strip-indent: 3.0.0
dev: true
/eslint-plugin-unused-imports/2.0.0_b5d7vn5fvb66hlq4xz6bd5gdxm:
/eslint-plugin-unused-imports/2.0.0_0f47fab7a5a87de3ae1cbe7c11f4c3bb:
resolution: {integrity: sha512-3APeS/tQlTrFa167ThtP0Zm0vctjr4M44HMpeg1P4bK6wItarumq0Ma82xorMKdFsWpphQBlRPzw/pxiVELX1A==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
peerDependencies:
@ -2074,7 +2038,7 @@ packages:
'@typescript-eslint/eslint-plugin':
optional: true
dependencies:
'@typescript-eslint/eslint-plugin': 5.51.0_z4swst3wuuqk4hlme4ajzslgh4
'@typescript-eslint/eslint-plugin': 5.51.0_cf25694f76a520ae1d6c27009cc9663f
eslint: 8.34.0
eslint-rule-composer: 0.3.0
dev: true
@ -3581,7 +3545,7 @@ packages:
engines: {node: '>=4'}
dev: true
/pinia/2.0.30_hmuptsblhheur2tugfgucj7gc4:
/pinia/2.0.30_typescript@4.9.5+vue@3.2.47:
resolution: {integrity: sha512-q6DUmxWwe/mQgg+55QQjykpKC+aGeGdaJV3niminl19V08dE+LRTvSEuqi6/NLSGCKHI49KGL6tMNEOssFiMyA==}
peerDependencies:
'@vue/composition-api': ^1.4.0
@ -4141,12 +4105,10 @@ packages:
engines: {node: '>= 0.4'}
dev: true
/tailwindcss/3.2.6_postcss@8.4.21:
/tailwindcss/3.2.6:
resolution: {integrity: sha512-BfgQWZrtqowOQMC2bwaSNe7xcIjdDEgixWGYOd6AL0CbKHJlvhfdbINeAW76l1sO+1ov/MJ93ODJ9yluRituIw==}
engines: {node: '>=12.13.0'}
hasBin: true
peerDependencies:
postcss: ^8.0.9
dependencies:
arg: 5.0.2
chokidar: 3.5.3
@ -4214,7 +4176,7 @@ packages:
engines: {node: '>=8'}
dev: true
/ts-node/10.9.1_4bewfcp2iebiwuold25d6rgcsy:
/ts-node/10.9.1_e0496289fa41028b51cb1eba3f44c296:
resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==}
hasBin: true
peerDependencies:
@ -4316,6 +4278,7 @@ packages:
resolution: {integrity: sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==}
engines: {node: '>=4.2.0'}
hasBin: true
dev: true
/unbox-primitive/1.0.2:
resolution: {integrity: sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==}
@ -4489,6 +4452,7 @@ packages:
'@vue/runtime-dom': 3.2.47
'@vue/server-renderer': 3.2.47_vue@3.2.47
'@vue/shared': 3.2.47
dev: false
/vueuc/0.4.51_vue@3.2.47:
resolution: {integrity: sha512-pLiMChM4f+W8czlIClGvGBYo656lc2Y0/mXFSCydcSmnCR1izlKPGMgiYBGjbY9FDkFG8a2HEVz7t0DNzBWbDw==}

View File

@ -9,7 +9,10 @@ defineProps<Props>()
<template>
<div class="p-2 mt-2 rounded-md" :class="[reversal ? 'bg-[#d2f9d1]' : 'bg-[#f4f6f8]']">
<span class="leading-relaxed whitespace-pre-wrap" :class="[{ 'text-red-500': error }]">
<span v-if="!reversal" class="leading-relaxed whitespace-pre-wrap" :class="[{ 'text-red-500': error }]" v-hljs>
<slot />
</span>
<span v-else class="leading-relaxed whitespace-pre-wrap" :class="[{ 'text-red-500': error }]">
<slot />
</span>
</div>

View File

@ -3,7 +3,8 @@ import App from './App.vue'
import { setupAssets } from '@/plugins'
import { setupStore } from '@/store'
import { setupRouter } from '@/router'
import hljs from 'highlight.js'
import "highlight.js/styles/xcode.css"
async function bootstrap() {
const app = createApp(App)
setupAssets()
@ -12,6 +13,15 @@ async function bootstrap() {
await setupRouter(app)
let regexp = /^(?:\s{4}|\t).+/gm
app.directive('hljs', {
mounted: (el: HTMLElement) => {
if (el.textContent?.indexOf(" = ") != -1 || el.textContent.match(regexp)) {
hljs.highlightBlock(el)
}
}
})
app.mount('#app')
}

0
src/plugins/Vhljs.ts Normal file
View File

View File

@ -7,3 +7,7 @@ body,
#app {
height: 100%;
}
.hljs{
background-color: #fff0!important;
}

View File

@ -2,7 +2,7 @@ import axios, { type AxiosResponse } from 'axios'
const service = axios.create({
baseURL: import.meta.env.VITE_GLOB_API_URL,
timeout: 10 * 1000,
timeout: 60 * 1000,
})
service.interceptors.request.use(