mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-15 19:48:06 +01:00
This commit is contained in:
parent
a5166bea39
commit
f5a36b9459
1 changed files with 9 additions and 7 deletions
|
|
@ -855,13 +855,15 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
|
|||
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");
|
||||
if (!nodeElement.classList.contains("code-block")) {
|
||||
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");
|
||||
}
|
||||
}
|
||||
}
|
||||
event.stopPropagation();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue