Skip to content

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

:art: Improve HTML clipping https://github.com/siyuan-note/siyuan/issues/13265

Daniel8689520ffa46
diff --git a/app/src/protyle/util/paste.ts b/app/src/protyle/util/paste.ts
index d6700eefb2..0b77d5c58b 100644
--- a/app/src/protyle/util/paste.ts
+++ b/app/src/protyle/util/paste.ts
@@ -452,9 +452,14 @@ export const paste = async (protyle: IProtyle, event: (ClipboardEvent | DragEven
)) {
isHTML = false;
} else {
- // 需注意 Edge 中的画选不应识别为图片 https://github.com/siyuan-note/siyuan/issues/7021
+ // 需注意 Edge 中的划选不应识别为图片 https://github.com/siyuan-note/siyuan/issues/7021
isHTML = true;
}
+
+ if (textPlain && "" !== textPlain.trim() && textHTML.startsWith("<span") && -1 < textHTML.indexOf("white-space: pre;")) {
+ // 豆包复制粘贴问题 https://github.com/siyuan-note/siyuan/issues/13265
+ isHTML = false;
+ }
}
if (isHTML) {
const tempElement = document.createElement("div");
diff --git a/kernel/go.mod b/kernel/go.mod
index 7c35d37414..b5487c5076 100644
--- a/kernel/go.mod
+++ b/kernel/go.mod
@@ -10,7 +10,7 @@ require (
github.com/88250/epub v0.0.0-20230830085737-c19055cd1f48
github.com/88250/go-humanize v0.0.0-20240424102817-4f78fac47ea7
github.com/88250/gulu v1.2.3-0.20240612035750-c9cf5f7a4d02
- github.com/88250/lute v1.7.7-0.20241123145043-7cfd2f597705
+ github.com/88250/lute v1.7.7-0.20241125163923-fc6e727a85b2
github.com/88250/pdfcpu v0.3.14-0.20230401044135-c7369a99720c
github.com/88250/vitess-sqlparser v0.0.0-20210205111146-56a2ded2aba1
github.com/ClarkThan/ahocorasick v0.0.0-20231011042242-30d1ef1347f4
diff --git a/kernel/go.sum b/kernel/go.sum
index fa86c7441f..ceacb28a34 100644
--- a/kernel/go.sum
+++ b/kernel/go.sum
@@ -14,8 +14,8 @@ github.com/88250/go-sqlite3 v1.14.13-0.20231214121541-e7f54c482950 h1:Pa5hMiBceT
github.com/88250/go-sqlite3 v1.14.13-0.20231214121541-e7f54c482950/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU=
github.com/88250/gulu v1.2.3-0.20240612035750-c9cf5f7a4d02 h1:3e5+yobj655pTeKOYMbJrnc1mE51ZkbXIxquTYZuYCY=
github.com/88250/gulu v1.2.3-0.20240612035750-c9cf5f7a4d02/go.mod h1:MUfzyfmbPrRDZLqxc7aPrVYveatTHRfoUa5TynPS0i8=
-github.com/88250/lute v1.7.7-0.20241123145043-7cfd2f597705 h1:3MMyy7v8OaGG2UuaYZs7vtdBcOwZzS1ehnSL/sP5gZ8=
-github.com/88250/lute v1.7.7-0.20241123145043-7cfd2f597705/go.mod h1:VDAzL8b+oCh+e3NAlmwwLzC53ten0rZlS8NboB7ljtk=
+github.com/88250/lute v1.7.7-0.20241125163923-fc6e727a85b2 h1:+zzhQPBE22DHiX4/QbnCoTgp3pVzvtZjJWL7lbTb2tE=
+github.com/88250/lute v1.7.7-0.20241125163923-fc6e727a85b2/go.mod h1:VDAzL8b+oCh+e3NAlmwwLzC53ten0rZlS8NboB7ljtk=
github.com/88250/pdfcpu v0.3.14-0.20230401044135-c7369a99720c h1:Dl/8S9iLyPMTElnWIBxmjaLiWrkI5P4a21ivwAn5pU0=
github.com/88250/pdfcpu v0.3.14-0.20230401044135-c7369a99720c/go.mod h1:S5YT38L/GCjVjmB4PB84PymA1qfopjEhfhTNQilLpv4=
github.com/88250/vitess-sqlparser v0.0.0-20210205111146-56a2ded2aba1 h1:48T899JQDwyyRu9yXHePYlPdHtpJfrJEUGBMH3SMBWY=