Skip to content

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

:bug: Prevent block insertion below bottom backlinks https://github.com/siyuan-note/siyuan/issues/19898

Danielbf139f07d015
diff --git a/app/src/protyle/ui/initUI.ts b/app/src/protyle/ui/initUI.ts
index ab8dae4956..c2a63008df 100644
--- a/app/src/protyle/ui/initUI.ts
+++ b/app/src/protyle/ui/initUI.ts
@@ -160,6 +160,12 @@ export const initUI = (protyle: IProtyle) => {
}
}
const lastElement = protyle.wysiwyg.element.lastElementChild;
+ const backlinkElement = protyle.wysiwyg.element.nextElementSibling;
+ if (backlinkElement?.classList.contains("sy__backlink--bottom") &&
+ backlinkElement.getClientRects().length > 0 &&
+ event.clientY >= backlinkElement.getBoundingClientRect().top) {
+ return;
+ }
const lastRect = lastElement.getBoundingClientRect();
const range = document.createRange();
if (event.y > lastRect.bottom) {