diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js index f73a861600b6e81a9ba4057b51b865869e507b04..1627f721613dab139a7020ef01b922c011505a0c 100644 --- a/docs/.vuepress/config.js +++ b/docs/.vuepress/config.js @@ -1,5 +1,6 @@ const path = require('path'); const { slugify } = require('@vuepress/shared-utils') +const highlight = require('@vuepress/markdown/lib/highlight') const translatePlugin = require('./markdown/translate') const headerPlugin = require('./markdown/header') const createSidebar = require('./markdown/createSidebar') @@ -73,6 +74,14 @@ const config = { }, extractHeaders: ['h1', 'h2', 'h3', 'h4'], chainMarkdown (config) { + const extensionMap = { + uts: 'ts' + } + config.options.highlight((str, lang) => { + const extension = extensionMap[lang] + return highlight(str, extension || lang) + }) + config .plugin('translate') .use(translatePlugin) diff --git a/package.json b/package.json index 427288028e236bfdff7d2d0729486dd4861ceb68..21e8eb542deae389dde7e396d960bfa6fbc567cc 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "markdown-it-raw-table": "^1.0.0", "markdown-it-task-lists": "^2.1.1", "vuepress-plugin-named-chunks": "^1.1.4", - "vuepress-theme-uni-app-test": "^1.3.22" + "vuepress-theme-uni-app-test": "^1.3.23" }, "dependencies": { "@docsearch/js": "^3.1.0", diff --git a/yarn.lock b/yarn.lock index 5493f6ff2fe525142e2d12ad7bf883f9f687e8f2..7db23529d081864dd5883c9f405d95d3946a687f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9407,10 +9407,10 @@ vuepress-plugin-zooming@^1.1.8: dependencies: zooming "^2.1.1" -vuepress-theme-uni-app-test@^1.3.22: - version "1.3.22" - resolved "https://registry.npmmirror.com/vuepress-theme-uni-app-test/-/vuepress-theme-uni-app-test-1.3.22.tgz#28e858c8cb52ba0c629974d7403e0f55d289b958" - integrity sha512-wdkg9aPH9ia0GidIKB0g3BU66DK6hS30bOKKpT9oNnps+uIDk33Pl7FaUhxDr5TE+yFyWkCbXu+cmDJtYaM8lw== +vuepress-theme-uni-app-test@^1.3.23: + version "1.3.23" + resolved "https://registry.npmmirror.com/vuepress-theme-uni-app-test/-/vuepress-theme-uni-app-test-1.3.23.tgz#1668a56d85d3569eed6ca06a38ff5de60ca07638" + integrity sha512-yXNxC6/drMAOn5Ih5Jb13dAs1upFsM6f0id84WFgy5e7oOQ2Mq5GO6Z85wWKORvG9V1qv/kTJKdVK7kGr/xLmA== dependencies: "@vuepress/plugin-back-to-top" "^1.9.5" "@vuepress/theme-default" "^1.8.2"