mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-21 14:34:06 +01:00
This commit is contained in:
parent
92feafcd46
commit
90432f818a
1 changed files with 5 additions and 6 deletions
|
|
@ -1483,18 +1483,17 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
|
|||
}
|
||||
|
||||
if (matchHotKey("⌘X", event) && selectText === "") {
|
||||
const selectElements = Array.from(protyle.wysiwyg.element.querySelectorAll(".protyle-wysiwyg--select"));
|
||||
if (selectElements.length === 0) {
|
||||
nodeElement.classList.add("protyle-wysiwyg--select");
|
||||
selectElements.push(nodeElement);
|
||||
}
|
||||
let html = "";
|
||||
nodeElement.classList.add("protyle-wysiwyg--select");
|
||||
const selectElements = protyle.wysiwyg.element.querySelectorAll(".protyle-wysiwyg--select");
|
||||
selectElements.forEach(item => {
|
||||
html += removeEmbed(item);
|
||||
});
|
||||
writeText(protyle.lute.BlockDOM2StdMd(html).trimEnd());
|
||||
const nextElement = getNextBlock(selectElements[selectElements.length - 1]);
|
||||
removeBlock(protyle, nodeElement, range);
|
||||
if (nextElement) {
|
||||
focusBlock(nextElement);
|
||||
}
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue