From 8476ddd18ce312cfe079efc132ac8b54653e1a7a Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Thu, 11 Sep 2025 17:54:25 +0800 Subject: [PATCH 1/4] :art: Block ref elements retain their original styles when exported https://github.com/siyuan-note/siyuan/issues/15698 Signed-off-by: Daniel <845765@qq.com> --- kernel/model/export.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/kernel/model/export.go b/kernel/model/export.go index 3be19b389..31c8cb9e0 100644 --- a/kernel/model/export.go +++ b/kernel/model/export.go @@ -2271,11 +2271,11 @@ func exportTree(tree *parse.Tree, wysiwyg, keepFold, avHiddenCol bool, switch blockRefMode { case 2: // 锚文本块链 - blockRefLink := &ast.Node{Type: ast.NodeTextMark, TextMarkType: "a", TextMarkTextContent: linkText, TextMarkAHref: "siyuan://blocks/" + defID} + blockRefLink := &ast.Node{Type: ast.NodeTextMark, TextMarkTextContent: linkText, TextMarkAHref: "siyuan://blocks/" + defID} blockRefLink.KramdownIAL = n.KramdownIAL - if n.IsTextMarkType("inline-memo") { + if "block-ref" != n.TextMarkType { // 除了块引还有其他元素 https://github.com/siyuan-note/siyuan/issues/15698 + blockRefLink.TextMarkType = strings.TrimSpace(strings.ReplaceAll(n.TextMarkType, "block-ref", "a")) blockRefLink.TextMarkInlineMemoContent = n.TextMarkInlineMemoContent - blockRefLink.TextMarkType = "a inline-memo" } n.InsertBefore(blockRefLink) unlinks = append(unlinks, n) @@ -2291,11 +2291,11 @@ func exportTree(tree *parse.Tree, wysiwyg, keepFold, avHiddenCol bool, } } else { blockRefLink = &ast.Node{Type: ast.NodeText, Tokens: []byte(linkText)} - if n.IsTextMarkType("inline-memo") { + if "block-ref" != n.TextMarkType { blockRefLink.Type = ast.NodeTextMark - blockRefLink.TextMarkInlineMemoContent = n.TextMarkInlineMemoContent - blockRefLink.TextMarkType = "inline-memo" + blockRefLink.TextMarkType = strings.TrimSpace(strings.ReplaceAll(n.TextMarkType, "block-ref", "")) blockRefLink.TextMarkTextContent = linkText + blockRefLink.TextMarkInlineMemoContent = n.TextMarkInlineMemoContent } } n.InsertBefore(blockRefLink) @@ -2315,13 +2315,13 @@ func exportTree(tree *parse.Tree, wysiwyg, keepFold, avHiddenCol bool, } text := &ast.Node{Type: ast.NodeText, Tokens: []byte(linkText)} - n.InsertBefore(text) - if n.IsTextMarkType("inline-memo") { + if "block-ref" != n.TextMarkType { text.Type = ast.NodeTextMark - text.TextMarkType = "inline-memo" + text.TextMarkType = strings.TrimSpace(strings.ReplaceAll(n.TextMarkType, "block-ref", "")) text.TextMarkTextContent = linkText text.TextMarkInlineMemoContent = n.TextMarkInlineMemoContent } + n.InsertBefore(text) n.InsertBefore(&ast.Node{Type: ast.NodeFootnotesRef, Tokens: []byte("^" + refFoot.refNum), FootnotesRefId: refFoot.refNum, FootnotesRefLabel: []byte("^" + refFoot.refNum)}) unlinks = append(unlinks, n) } From deb9b933afd995c6a3f35f7bb30c57208bb14e10 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Thu, 11 Sep 2025 22:25:02 +0800 Subject: [PATCH 2/4] :art: https://github.com/siyuan-note/siyuan/issues/15762 --- app/src/mobile/dock/MobileFiles.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/src/mobile/dock/MobileFiles.ts b/app/src/mobile/dock/MobileFiles.ts index ec66ab429..5bc672843 100644 --- a/app/src/mobile/dock/MobileFiles.ts +++ b/app/src/mobile/dock/MobileFiles.ts @@ -402,6 +402,12 @@ export class MobileFiles extends Model { } else { sourceElement.remove(); } + } else { + const parentElement = this.element.querySelector(`ul[data-url="${data.fromNotebook}"] li[data-path="${pathPosix().dirname(data.fromPath)}.sy"]`) as HTMLElement; + if (parentElement && parentElement.getAttribute("data-count") === "1") { + parentElement.querySelector(".b3-list-item__toggle").classList.add("fn__hidden"); + parentElement.querySelector(".b3-list-item__arrow").classList.remove("b3-list-item__arrow--open"); + } } const newElement = this.element.querySelector(`[data-url="${data.toNotebook}"] li[data-path="${data.toPath}"]`) as HTMLElement; // 重新展开移动到的新文件夹 From 24285aae568375e71f8b9571ffcd7b2397ad7ce2 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Thu, 11 Sep 2025 22:27:51 +0800 Subject: [PATCH 3/4] :art: https://github.com/siyuan-note/siyuan/issues/15821 --- app/src/protyle/wysiwyg/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/protyle/wysiwyg/index.ts b/app/src/protyle/wysiwyg/index.ts index 8fc957f41..0bbc4baa3 100644 --- a/app/src/protyle/wysiwyg/index.ts +++ b/app/src/protyle/wysiwyg/index.ts @@ -1741,7 +1741,7 @@ export class WYSIWYG { } const range = getSelection().getRangeAt(0); if (this.element === range.startContainer || this.element.contains(range.startContainer)) { - protyle.toolbar.range = range; + protyle.toolbar.range = range.cloneRange(); } }); From fd83286438a53393d0580cb7237e7c64b169f029 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Thu, 11 Sep 2025 22:44:32 +0800 Subject: [PATCH 4/4] :art: https://github.com/siyuan-note/siyuan/issues/15821 --- app/src/layout/util.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/layout/util.ts b/app/src/layout/util.ts index 4d9c50ca4..f2c1ca878 100644 --- a/app/src/layout/util.ts +++ b/app/src/layout/util.ts @@ -750,7 +750,7 @@ export const newModelByInitData = (app: App, tab: Tab, json: any) => { rootId: json.rootId, blockId: json.blockId, mode: json.mode, - action: typeof json.action === "string" ? [json.action] : json.action, + action: typeof json.action === "string" ? [json.action, Constants.CB_GET_FOCUS] : json.action.concat(Constants.CB_GET_FOCUS), }); } return model;