minor refactor

This commit is contained in:
hkgnp 2022-02-13 03:17:50 +08:00
parent 5f87429c32
commit 2ed7e46063
2 changed files with 1 additions and 3 deletions

View File

@ -5,7 +5,7 @@
"icon": "./icon.svg" "icon": "./icon.svg"
}, },
"name": "logseq-mermaid-plugin", "name": "logseq-mermaid-plugin",
"version": "1.0.0", "version": "1.0.1",
"description": "", "description": "",
"main": "dist/index.html", "main": "dist/index.html",
"targets": { "targets": {

View File

@ -1,8 +1,6 @@
export const convert = (data: string) => { export const convert = (data: string) => {
const matchData = data.match(/```mermaid(.|\n)*?```/gm); const matchData = data.match(/```mermaid(.|\n)*?```/gm);
console.log(matchData[0]);
let toDecode = matchData[0]; let toDecode = matchData[0];
toDecode = toDecode.replace('```mermaid', '').replace('```', ''); toDecode = toDecode.replace('```mermaid', '').replace('```', '');
toDecode = toDecode.replace('\n', ' '); toDecode = toDecode.replace('\n', ' ');