mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
This commit is contained in:
parent
186cc1465e
commit
a053b51a41
2 changed files with 10 additions and 1 deletions
|
|
@ -5,8 +5,8 @@ export const clearBlockElement = (element: Element) => {
|
|||
element.classList.remove("protyle-wysiwyg--select", "protyle-wysiwyg--hl");
|
||||
element.removeAttribute(Constants.CUSTOM_RIFF_DECKS);
|
||||
element.removeAttribute("refcount");
|
||||
element.querySelector(".protyle-attr--av")?.remove();
|
||||
element.querySelector(".protyle-attr--refcount")?.remove();
|
||||
element.querySelector(".protyle-attr--av")?.remove();
|
||||
element.removeAttribute("custom-avs");
|
||||
element.getAttributeNames().forEach(attr => {
|
||||
if (attr.startsWith("custom-sy-av-s-text-")) {
|
||||
|
|
|
|||
|
|
@ -784,6 +784,7 @@ export const onTransaction = (protyle: IProtyle, operation: IOperation, isUndo:
|
|||
if (previousElement.length === 0 && isUndo && protyle.wysiwyg.element.childElementCount === 0) {
|
||||
// https://github.com/siyuan-note/siyuan/issues/15396 操作后撤销
|
||||
protyle.wysiwyg.element.innerHTML = operation.data;
|
||||
cursorElements.push(protyle.wysiwyg.element.firstElementChild);
|
||||
} else if (previousElement.length === 0 && protyle.options.backlinkData && isUndo && getSelection().rangeCount > 0) {
|
||||
// 反链面板删除超级块中的最后一个段落块后撤销
|
||||
const blockElement = hasClosestBlock(getSelection().getRangeAt(0).startContainer);
|
||||
|
|
@ -856,6 +857,14 @@ export const onTransaction = (protyle: IProtyle, operation: IOperation, isUndo:
|
|||
return;
|
||||
}
|
||||
cursorElements.forEach(item => {
|
||||
// https://github.com/siyuan-note/siyuan/issues/16554
|
||||
item.querySelector(".protyle-attr--av")?.remove();
|
||||
item.removeAttribute("custom-avs");
|
||||
item.getAttributeNames().forEach(attr => {
|
||||
if (attr.startsWith("custom-sy-av-s-text-")) {
|
||||
item.removeAttribute(attr);
|
||||
}
|
||||
});
|
||||
processRender(item);
|
||||
highlightRender(item);
|
||||
avRender(item, protyle);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue