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/5488

Vanessa79960b2c865a
diff --git a/app/src/protyle/wysiwyg/input.ts b/app/src/protyle/wysiwyg/input.ts
index d6c0a25ea1..e643356500 100644
--- a/app/src/protyle/wysiwyg/input.ts
+++ b/app/src/protyle/wysiwyg/input.ts
@@ -79,12 +79,15 @@ export const input = async (protyle: IProtyle, blockElement: HTMLElement, range:
}
let html = blockElement.outerHTML;
let todoOldHTML = "";
+ let focusHR = false
if (editElement.textContent === "---" && !blockElement.classList.contains("code-block")) {
- html = `<div data-node-id="${id}" data-type="NodeThematicBreak" class="hr"><div><wbr></div></div>`;
+ html = `<div data-node-id="${id}" data-type="NodeThematicBreak" class="hr"><div></div></div>`;
const nextBlockElement = getNextBlock(editElement);
if (nextBlockElement) {
if (!isNotEditBlock(nextBlockElement)) {
focusBlock(nextBlockElement);
+ } else {
+ focusHR = true;
}
} else {
html += genEmptyBlock(false, true);
@@ -166,6 +169,8 @@ export const input = async (protyle: IProtyle, blockElement: HTMLElement, range:
blockRender(protyle, realElement);
protyle.toolbar.showRender(protyle, realElement);
hideElements(["hint"], protyle);
+ } else if (realType === "NodeThematicBreak" && focusHR) {
+ focusBlock(blockElement);
} else {
mathRender(realElement);
if (index === tempElement.content.childElementCount - 1) {