mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-21 00:50:13 +01:00
This commit is contained in:
parent
5c97a0eb23
commit
33919b2583
1 changed files with 14 additions and 0 deletions
|
|
@ -175,10 +175,24 @@ export const insertHTML = (html: string, protyle: IProtyle, isBlock = false) =>
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (editableElement && editableElement.textContent === "") {
|
if (editableElement && editableElement.textContent === "") {
|
||||||
|
// 选中当前块所有内容粘贴再撤销会导致异常 https://ld246.com/article/1662542137636
|
||||||
|
doOperation.find((item, index) => {
|
||||||
|
if (item.id === id) {
|
||||||
|
doOperation.splice(index, 1);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
})
|
||||||
doOperation.push({
|
doOperation.push({
|
||||||
action: "delete",
|
action: "delete",
|
||||||
id
|
id
|
||||||
});
|
});
|
||||||
|
// 选中当前块所有内容粘贴再撤销会导致异常 https://ld246.com/article/1662542137636
|
||||||
|
undoOperation.find((item, index) => {
|
||||||
|
if (item.id === id && item.action === "update") {
|
||||||
|
undoOperation.splice(index, 1);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
});
|
||||||
undoOperation.push({
|
undoOperation.push({
|
||||||
action: "insert",
|
action: "insert",
|
||||||
data: oldHTML,
|
data: oldHTML,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue