mirror of
https://github.com/appdev/siyuan-unlock.git
synced 2026-03-10 10:47:43 +08:00
This commit is contained in:
parent
c9e30e31af
commit
ef5d7d5755
@ -737,15 +737,17 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
|
||||
}
|
||||
const imgSelectElement = protyle.wysiwyg.element.querySelector(".img--select");
|
||||
if (imgSelectElement) {
|
||||
imgSelectElement.insertAdjacentHTML("afterend", "<wbr>");
|
||||
imgSelectElement.classList.remove("img--select");
|
||||
const oldHTML = nodeElement.outerHTML;
|
||||
imgSelectElement.remove();
|
||||
updateTransaction(protyle, nodeElement.getAttribute("data-node-id"), nodeElement.outerHTML, oldHTML);
|
||||
focusByWbr(nodeElement, range);
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
return;
|
||||
if (nodeElement.contains(imgSelectElement)) {
|
||||
imgSelectElement.insertAdjacentHTML("afterend", "<wbr>");
|
||||
const oldHTML = nodeElement.outerHTML;
|
||||
imgSelectElement.remove();
|
||||
updateTransaction(protyle, nodeElement.getAttribute("data-node-id"), nodeElement.outerHTML, oldHTML);
|
||||
focusByWbr(nodeElement, range);
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
return;
|
||||
}
|
||||
} else if (selectText === "") {
|
||||
const editElement = getContenteditableElement(nodeElement);
|
||||
if (!editElement) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user