mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-10 01:04:21 +01:00
This commit is contained in:
parent
372a9399b3
commit
e4849c5911
1 changed files with 3 additions and 0 deletions
|
|
@ -839,12 +839,15 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
|
|||
// 需使用 innerText,否则 br 无法传唤为 /n https://github.com/siyuan-note/siyuan/issues/12066
|
||||
// 段末反向删除 https://github.com/siyuan-note/insider/issues/274
|
||||
if (isEndOfBlock(range)) {
|
||||
const cloneRange = range.cloneRange();
|
||||
const nextElement = getNextBlock(getTopAloneElement(nodeElement));
|
||||
if (nextElement) {
|
||||
const nextRange = focusBlock(nextElement);
|
||||
if (nextRange) {
|
||||
const nextBlockElement = hasClosestBlock(nextRange.startContainer);
|
||||
if (nextBlockElement) {
|
||||
// 反向删除合并为一个块时,光标应保持在尾部 https://github.com/siyuan-note/siyuan/issues/14290#issuecomment-2849810529
|
||||
cloneRange.insertNode(document.createElement("wbr"));
|
||||
removeBlock(protyle, nextBlockElement, nextRange, "Delete");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue