From 79960b2c865a98d1aa001d8f3e40251609820613 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Thu, 21 Jul 2022 22:41:30 +0800 Subject: [PATCH] :bug: fix https://github.com/siyuan-note/siyuan/issues/5488 --- app/src/protyle/wysiwyg/input.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/src/protyle/wysiwyg/input.ts b/app/src/protyle/wysiwyg/input.ts index d6c0a25ea..e64335650 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 = `
`; + html = `
`; 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) {