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
+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);