mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-03 23:38:49 +01:00
🚨
This commit is contained in:
parent
c01ba53c9b
commit
86f658b352
2 changed files with 10 additions and 10 deletions
|
|
@ -43,8 +43,8 @@ const listEnter = (protyle: IProtyle, blockElement: HTMLElement, range: Range) =
|
|||
return true;
|
||||
}
|
||||
// https://github.com/siyuan-note/siyuan/issues/8935
|
||||
const wbrElement = document.createElement("wbr")
|
||||
range.insertNode(wbrElement)
|
||||
const wbrElement = document.createElement("wbr");
|
||||
range.insertNode(wbrElement);
|
||||
const html = listItemElement.parentElement.outerHTML;
|
||||
wbrElement.remove();
|
||||
let newElement = genListItemElement(listItemElement, -1, true);
|
||||
|
|
|
|||
|
|
@ -1553,19 +1553,19 @@ export class WYSIWYG {
|
|||
if ((event.key === "ArrowLeft" || event.key === "ArrowRight" ||
|
||||
event.key === "Alt" || event.key === "Shift") && // 选中后 alt+shift+arrowRight 会导致光标和选中块不一致
|
||||
nodeElement && !nodeElement.classList.contains("protyle-wysiwyg--select")) {
|
||||
const selectElements = Array.from(protyle.wysiwyg.element.querySelectorAll(".protyle-wysiwyg--select"))
|
||||
let containRange = false
|
||||
const selectElements = Array.from(protyle.wysiwyg.element.querySelectorAll(".protyle-wysiwyg--select"));
|
||||
let containRange = false;
|
||||
selectElements.find(item => {
|
||||
if (item.contains(range.startContainer)) {
|
||||
containRange = true
|
||||
return true
|
||||
containRange = true;
|
||||
return true;
|
||||
}
|
||||
})
|
||||
});
|
||||
if (!containRange && selectElements.length > 0) {
|
||||
selectElements.forEach(item => {
|
||||
item.classList.remove("protyle-wysiwyg--select")
|
||||
})
|
||||
nodeElement.classList.add("protyle-wysiwyg--select")
|
||||
item.classList.remove("protyle-wysiwyg--select");
|
||||
});
|
||||
nodeElement.classList.add("protyle-wysiwyg--select");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue