Skip to content

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

:bug: fix https://github.com/siyuan-note/siyuan/issues/6132

Vanessa92a1af3b7f0f
diff --git a/app/src/protyle/util/selection.ts b/app/src/protyle/util/selection.ts
index 3901b33981..8a4745541a 100644
--- a/app/src/protyle/util/selection.ts
+++ b/app/src/protyle/util/selection.ts
@@ -305,6 +305,10 @@ export const setFirstNodeRange = (editElement: Element, range: Range) => {
}
let firstChild = editElement.firstChild as HTMLElement;
while (firstChild && firstChild.nodeType !== 3 && !firstChild.classList.contains("render-node")) {
+ if (firstChild.classList.contains("img")) { // https://ld246.com/article/1665360254842
+ range.setStartBefore(firstChild);
+ return range;
+ }
firstChild = firstChild.firstChild as HTMLElement;
}
if (!firstChild) {