From 9889ef7fb23d7b19c32673ce4d7cff31027a7ff1 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Wed, 16 Apr 2025 18:58:31 +0800 Subject: [PATCH] :art: https://github.com/siyuan-note/siyuan/issues/14621 --- app/src/protyle/util/selection.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/protyle/util/selection.ts b/app/src/protyle/util/selection.ts index 75c056e9a..23086aa5c 100644 --- a/app/src/protyle/util/selection.ts +++ b/app/src/protyle/util/selection.ts @@ -644,7 +644,7 @@ export const focusBlock = (element: Element, parentElement?: HTMLElement, toStar } else { let focusHljs = false; // 定位到末尾 https://github.com/siyuan-note/siyuan/issues/5982 - if (cursorElement.parentElement.classList.contains("hljs")) { + if (element.getAttribute("data-type") === "NodeCodeBlock") { // 代码块末尾定位需在 /n 之前 https://github.com/siyuan-note/siyuan/issues/9141,https://github.com/siyuan-note/siyuan/issues/9189 let lastNode = cursorElement.lastChild; if (!lastNode) {