trying new encode

This commit is contained in:
hkgnp 2022-03-02 22:17:59 +08:00
parent 158c1f0a2a
commit 6bd5f3a49f
3 changed files with 4 additions and 5 deletions

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{ {
"name": "logseq-mermaid-plugin", "name": "logseq-mermaid-plugin",
"version": "1.0.10", "version": "1.1.1",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "logseq-mermaid-plugin", "name": "logseq-mermaid-plugin",
"version": "1.0.10", "version": "1.1.1",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@logseq/libs": "^0.0.1-alpha.34", "@logseq/libs": "^0.0.1-alpha.34",

View File

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

View File

@ -18,9 +18,7 @@ export const renderMermaid = async (type, payload, colour, mermaidUUID) => {
toDecode = toDecode.replace('\n', ' '); toDecode = toDecode.replace('\n', ' ');
// const jsonString = btoa(toDecode);
const jsonString = toBase64(toDecode, true); const jsonString = toBase64(toDecode, true);
console.log(jsonString);
const renderBlock = async (str: string) => { const renderBlock = async (str: string) => {
await logseq.Editor.updateBlock( await logseq.Editor.updateBlock(