mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-24 07:54:07 +01:00
This commit is contained in:
parent
69b0d90dcd
commit
d47d5ade8e
5 changed files with 6 additions and 34 deletions
|
|
@ -339,20 +339,12 @@ const editKeydown = (app: App, event: KeyboardEvent) => {
|
|||
selectsElement.forEach(item => {
|
||||
// 不能使用 [contenteditable="true"], 否则嵌入块无法复制
|
||||
item.querySelectorAll("[spellcheck]").forEach(editItem => {
|
||||
const cloneNode = editItem.cloneNode(true) as HTMLElement;
|
||||
cloneNode.querySelectorAll('[data-type="backslash"]').forEach(slashItem => {
|
||||
slashItem.firstElementChild.remove();
|
||||
});
|
||||
html += cloneNode.textContent + "\n";
|
||||
html += editItem.textContent + "\n";
|
||||
});
|
||||
});
|
||||
copyPlainText(html.trimEnd());
|
||||
} else {
|
||||
const cloneContents = range.cloneContents();
|
||||
cloneContents.querySelectorAll('[data-type="backslash"]').forEach(item => {
|
||||
item.firstElementChild.remove();
|
||||
});
|
||||
writeText(cloneContents.textContent);
|
||||
writeText(range.toString());
|
||||
}
|
||||
event.preventDefault();
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue