From 63a3d64e2f3ef8e377f20bdab88e705b3bb611c9 Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Thu, 13 Nov 2025 12:19:06 +0800 Subject: [PATCH 1/5] :art: Improve HTML underline style clipping https://github.com/siyuan-note/siyuan/issues/14804 Signed-off-by: Daniel <845765@qq.com> --- app/src/protyle/util/paste.ts | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/app/src/protyle/util/paste.ts b/app/src/protyle/util/paste.ts index 6c880f888..90b137da3 100644 --- a/app/src/protyle/util/paste.ts +++ b/app/src/protyle/util/paste.ts @@ -470,8 +470,21 @@ export const paste = async (protyle: IProtyle, event: (ClipboardEvent | DragEven isHTML = true; } + // 判断是否包含多个换行,包含多个换行则很有可能是纯文本(豆包复制粘贴问题,纯文本外面会包裹一个 HTML 标签,但内部是 Markdown 纯文本) + let containsNewlines = false; + const tempDiv = document.createElement("div"); + tempDiv.innerHTML = textHTML; + const walker = document.createTreeWalker(tempDiv, NodeFilter.SHOW_TEXT, null); + let node; + while (node = walker.nextNode()) { + if (node.nodeValue && (node.nodeValue.match(/\n/g) || []).length >= 2) { + containsNewlines = true; + break; + } + } + const textHTMLLowercase = textHTML.toLowerCase(); - if (textPlain && "" !== textPlain.trim() && (textHTML.startsWith(" textHTMLLowercase.indexOf("class=\"katex") && 0 > textHTMLLowercase.indexOf("class=\"math") && 0 > textHTMLLowercase.indexOf("") && 0 > textHTMLLowercase.indexOf("") && 0 > textHTMLLowercase.indexOf("") && 0 > textHTMLLowercase.indexOf("") && 0 > textHTMLLowercase.indexOf("") && @@ -488,9 +501,6 @@ export const paste = async (protyle: IProtyle, event: (ClipboardEvent | DragEven if (isHTML) { const tempElement = document.createElement("div"); tempElement.innerHTML = textHTML; - tempElement.querySelectorAll("[style]").forEach((e) => { - e.removeAttribute("style"); - }); // 移除空的 A 标签 tempElement.querySelectorAll("a").forEach((e) => { if (e.innerHTML.trim() === "") { From 3d3486e93ec460098501d5002b4556b898494bb0 Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Thu, 13 Nov 2025 12:27:26 +0800 Subject: [PATCH 2/5] :art: Supports converting relative path hyperlinks into document block references after importing Markdown https://github.com/siyuan-note/siyuan/issues/13817#issuecomment-3523687650 Signed-off-by: Daniel <845765@qq.com> --- kernel/model/import.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/model/import.go b/kernel/model/import.go index 039a77999..0b4983ffd 100644 --- a/kernel/model/import.go +++ b/kernel/model/import.go @@ -816,8 +816,8 @@ func ImportFromLocalPath(boxID, localPath string, toPath string) (err error) { return nil } - if !d.IsDir() && strings.Contains(filepath.ToSlash(currentPath), "/assets/") { - // assets 文件夹下的文件算作资源文件 + if !d.IsDir() && !strings.HasSuffix(currentPath, ".md") && !strings.HasSuffix(currentPath, ".markdown") { + // 非 Markdown 文件作为资源文件处理 https://github.com/siyuan-note/siyuan/issues/13817 existName := assetsDone[currentPath] var name string if "" == existName { From f9130aac59e3d7a40900b0a0d8980139e9d30782 Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Thu, 13 Nov 2025 12:50:13 +0800 Subject: [PATCH 3/5] :art: Support setting status bar message switch https://github.com/siyuan-note/siyuan/issues/16236 Signed-off-by: Daniel <845765@qq.com> --- app/src/config/appearance.ts | 19 +++++++++++++++++++ app/src/types/config.d.ts | 1 + kernel/task/queue.go | 3 +++ kernel/util/statusbar.go | 1 + 4 files changed, 24 insertions(+) diff --git a/app/src/config/appearance.ts b/app/src/config/appearance.ts index ab01e919d..b8ed1b9b6 100644 --- a/app/src/config/appearance.ts +++ b/app/src/config/appearance.ts @@ -201,6 +201,7 @@ export const appearance = { closeButtonBehavior: (appearance.element.querySelector("#closeButtonBehavior") as HTMLInputElement).checked ? 1 : 0, hideStatusBar: (appearance.element.querySelector("#hideStatusBar") as HTMLInputElement).checked, statusBar: { + msgTaskDatabaseIndexCommitDisabled: statusBar ? statusBar.msgTaskDatabaseIndexCommitDisabled : window.siyuan.config.appearance.statusBar.msgTaskDatabaseIndexCommitDisabled, msgTaskHistoryDatabaseIndexCommitDisabled: statusBar ? statusBar.msgTaskHistoryDatabaseIndexCommitDisabled : window.siyuan.config.appearance.statusBar.msgTaskAssetDatabaseIndexCommitDisabled, msgTaskAssetDatabaseIndexCommitDisabled: statusBar ? statusBar.msgTaskAssetDatabaseIndexCommitDisabled : window.siyuan.config.appearance.statusBar.msgTaskAssetDatabaseIndexCommitDisabled, } @@ -248,6 +249,13 @@ export const appearance = { title: window.siyuan.languages.appearance18, content: `
+