trying new encode

This commit is contained in:
hkgnp 2022-03-02 21:55:41 +08:00
parent 51a3aa357e
commit 158c1f0a2a
2 changed files with 4 additions and 4 deletions

View File

@ -5,7 +5,7 @@
"icon": "./icon.svg"
},
"name": "logseq-mermaid-plugin",
"version": "1.1.0",
"version": "1.1.1",
"description": "",
"main": "dist/index.html",
"targets": {
@ -20,7 +20,6 @@
"license": "MIT",
"dependencies": {
"@logseq/libs": "^0.0.1-alpha.34",
"buffer": "^6.0.3",
"js-base64": "^3.7.2"
},
"devDependencies": {

View File

@ -1,4 +1,4 @@
import { Base64 } from 'js-base64';
import { toBase64 } from 'js-base64';
export const renderMermaid = async (type, payload, colour, mermaidUUID) => {
await logseq.Editor.editBlock(payload.uuid);
@ -19,7 +19,8 @@ export const renderMermaid = async (type, payload, colour, mermaidUUID) => {
toDecode = toDecode.replace('\n', ' ');
// const jsonString = btoa(toDecode);
const jsonString = Base64.encode(toDecode, true);
const jsonString = toBase64(toDecode, true);
console.log(jsonString);
const renderBlock = async (str: string) => {
await logseq.Editor.updateBlock(