diff --git a/package.json b/package.json index 92a0271..4785502 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,7 @@ "@vuepress/bundler-vite": "2.0.0-rc.8", "flowchart.ts": "^3.0.0", "katex": "^0.16.9", + "markdown-it-cjk-breaks": "^2.0.0", "mermaid": "^10.9.0" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 789b9c2..9c3351d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -14,6 +14,9 @@ dependencies: katex: specifier: ^0.16.9 version: 0.16.9 + markdown-it-cjk-breaks: + specifier: ^2.0.0 + version: 2.0.0 mermaid: specifier: ^10.9.0 version: 10.9.0 @@ -2223,6 +2226,12 @@ packages: '@types/markdown-it': 13.0.7 markdown-it: 14.1.0 + /markdown-it-cjk-breaks@2.0.0: + resolution: {integrity: sha512-hzgyuNzXuHoNJuPW+b4IXEtqaLeD4xNloqFVWG/wzT3O0npoDiwaEFY6JiglFjUh5//xvE0N21GU07NMxw4TiA==} + dependencies: + get-east-asian-width: 1.2.0 + dev: false + /markdown-it-emoji@3.0.0: resolution: {integrity: sha512-+rUD93bXHubA4arpEZO3q80so0qgoFJEKRkRbjKX8RTdca89v2kfyF+xR3i2sQTwql9tpPZPOQN5B+PunspXRg==} diff --git a/src/.vuepress/config.ts b/src/.vuepress/config.ts index f453d83..086617f 100644 --- a/src/.vuepress/config.ts +++ b/src/.vuepress/config.ts @@ -2,6 +2,7 @@ import { defineUserConfig } from "vuepress"; import { removePwaPlugin } from "@vuepress/plugin-remove-pwa"; import { viteBundler } from '@vuepress/bundler-vite' +import cjk_breaks_plugin from 'markdown-it-cjk-breaks'; import theme from "./theme"; @@ -19,8 +20,11 @@ export default defineUserConfig({ plugins: [ removePwaPlugin({}), ], + extendsMarkdown: (md) => { + md.use(cjk_breaks_plugin); + }, bundler: viteBundler({ viteOptions: {}, vuePluginOptions: {}, }), -}); \ No newline at end of file +}); diff --git a/src/.vuepress/theme.ts b/src/.vuepress/theme.ts index 957e532..12789ee 100644 --- a/src/.vuepress/theme.ts +++ b/src/.vuepress/theme.ts @@ -45,6 +45,7 @@ export default hopeTheme({ figure: true, flowchart: true, gfm: true, + breaks: false, imgLazyload: true, imgSize: true, include: true,