From 2ae419239239fd18d3fd02b7337f21bfa5b2a5e5 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Sun, 14 May 2023 09:29:18 +0800 Subject: [PATCH] :art: --- app/src/protyle/index.ts | 26 +++++++++++++------------- app/src/util/assets.ts | 2 +- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/app/src/protyle/index.ts b/app/src/protyle/index.ts index 282a80b10..b18eee06e 100644 --- a/app/src/protyle/index.ts +++ b/app/src/protyle/index.ts @@ -199,25 +199,25 @@ export class Protyle { fetchPost("/api/block/getDocInfo", { id: options.blockId }, (response) => { + let scrollObj; if (response.data.ial.scroll) { - let scrollObj; try { scrollObj = JSON.parse(response.data.ial.scroll.replace(/"/g, '"')); } catch (e) { scrollObj = undefined; } - if (scrollObj) { - getDocByScroll({ - protyle: this.protyle, - scrollAttr: scrollObj, - mergedOptions, - cb: () => { - this.afterOnGet(mergedOptions); - } - }); - } else { - this.getDoc(mergedOptions); - } + } + if (scrollObj) { + getDocByScroll({ + protyle: this.protyle, + scrollAttr: scrollObj, + mergedOptions, + cb: () => { + this.afterOnGet(mergedOptions); + } + }); + } else { + this.getDoc(mergedOptions); } }); } else { diff --git a/app/src/util/assets.ts b/app/src/util/assets.ts index e1f5591a8..a702a48ae 100644 --- a/app/src/util/assets.ts +++ b/app/src/util/assets.ts @@ -210,7 +210,7 @@ export const setInlineStyle = (set = true) => { .protyle-wysiwyg [data-node-id].li > .protyle-action ~ .h1, .protyle-wysiwyg [data-node-id].li > .protyle-action ~ .h2, .protyle-wysiwyg [data-node-id].li > .protyle-action ~ .h3, .protyle-wysiwyg [data-node-id].li > .protyle-action ~ .h4, .protyle-wysiwyg [data-node-id].li > .protyle-action ~ .h5, .protyle-wysiwyg [data-node-id].li > .protyle-action ~ .h6 {line-height:${height + 8}px;} .protyle-wysiwyg [data-node-id].li > .protyle-action:after {height: ${window.siyuan.config.editor.fontSize}px;width: ${window.siyuan.config.editor.fontSize}px;margin:-${window.siyuan.config.editor.fontSize / 2}px 0 0 -${window.siyuan.config.editor.fontSize / 2}px} .protyle-wysiwyg [data-node-id].li > .protyle-action svg {height: ${Math.max(14, window.siyuan.config.editor.fontSize - 8)}px} -.protyle-wysiwyg [data-node-id].li:before {height: calc(100% - ${height + 8}px);top:${(height + 8) / 2}px} +.protyle-wysiwyg [data-node-id].li:before {height: calc(100% - ${height + 8}px);top:${(height + 8)}px} .protyle-wysiwyg [data-node-id] [spellcheck] {min-height:${height}px;} .protyle-wysiwyg [data-node-id] {${window.siyuan.config.editor.rtl ? " direction: rtl;" : ""}${window.siyuan.config.editor.justify ? " text-align: justify;" : ""}} .protyle-wysiwyg .li {min-height:${height + 8}px}