Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art:

Vanessa2ae419239239
diff --git a/app/src/protyle/index.ts b/app/src/protyle/index.ts
index 282a80b10f..b18eee06ef 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 e1f5591a8b..a702a48aea 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}