fix: build action

This commit is contained in:
hmol233
2021-09-11 18:37:02 +08:00
parent db3c7540e5
commit e95da031d1
6 changed files with 21 additions and 13 deletions
-12
View File
@@ -131,16 +131,4 @@ export default defineUserConfig<DefaultThemeOptions>({
md.use(require("markdown-it-footnote"));
},
bundler: isProduction ? "@vuepress/webpack" : "@vuepress/vite",
bundlerConfig: {
chainWebpack: (config) => {
config.module
.rule("webp")
.test(/\.(webp)(\?.*)?$/)
.use("file-loader")
.loader("file-loader")
.options({
name: `assets/img/[name].[hash:8].[ext]`,
});
},
},
});
+2 -1
View File
@@ -8,13 +8,14 @@ const MermaidPlugin: PluginSimple = function (md) {
md.renderer.rules.fence = (...args) => {
const [tokens, idx] = args;
const { info } = tokens[idx];
if (info.trim(" ") === "mermaid") {
if (info.trim() === "mermaid") {
const token = tokens[idx];
const key = `mermaid_${hash(idx)}`;
let { content } = token;
content = content.replaceAll(";\n", ";");
content = content.replaceAll("\n\n", ";");
content = content.replaceAll("\n", ";");
content = content.replaceAll('"', "'");
return `<Mermaid identifier="${key}" graph="${content}"></Mermaid>`;
}
const rawCode = fence(...args);