mirror of
https://github.com/XTLS/Xray-docs-next.git
synced 2026-09-28 01:47:59 +03:00
fix: build action
This commit is contained in:
@@ -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]`,
|
||||
});
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user