mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 23:20: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.classList.remove("protyle-wysiwyg--select", "protyle-wysiwyg--hl");
|
||||||
element.removeAttribute(Constants.CUSTOM_RIFF_DECKS);
|
element.removeAttribute(Constants.CUSTOM_RIFF_DECKS);
|
||||||
element.removeAttribute("refcount");
|
element.removeAttribute("refcount");
|
||||||
element.querySelector(".protyle-attr--av")?.remove();
|
|
||||||
element.querySelector(".protyle-attr--refcount")?.remove();
|
element.querySelector(".protyle-attr--refcount")?.remove();
|
||||||
|
element.querySelector(".protyle-attr--av")?.remove();
|
||||||
element.removeAttribute("custom-avs");
|
element.removeAttribute("custom-avs");
|
||||||
element.getAttributeNames().forEach(attr => {
|
element.getAttributeNames().forEach(attr => {
|
||||||
if (attr.startsWith("custom-sy-av-s-text-")) {
|
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) {
|
if (previousElement.length === 0 && isUndo && protyle.wysiwyg.element.childElementCount === 0) {
|
||||||
// https://github.com/siyuan-note/siyuan/issues/15396 操作后撤销
|
// https://github.com/siyuan-note/siyuan/issues/15396 操作后撤销
|
||||||
protyle.wysiwyg.element.innerHTML = operation.data;
|
protyle.wysiwyg.element.innerHTML = operation.data;
|
||||||
|
cursorElements.push(protyle.wysiwyg.element.firstElementChild);
|
||||||
} else if (previousElement.length === 0 && protyle.options.backlinkData && isUndo && getSelection().rangeCount > 0) {
|
} else if (previousElement.length === 0 && protyle.options.backlinkData && isUndo && getSelection().rangeCount > 0) {
|
||||||
// 反链面板删除超级块中的最后一个段落块后撤销
|
// 反链面板删除超级块中的最后一个段落块后撤销
|
||||||
const blockElement = hasClosestBlock(getSelection().getRangeAt(0).startContainer);
|
const blockElement = hasClosestBlock(getSelection().getRangeAt(0).startContainer);
|
||||||
|
|
@ -856,6 +857,14 @@ export const onTransaction = (protyle: IProtyle, operation: IOperation, isUndo:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
cursorElements.forEach(item => {
|
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);
|
processRender(item);
|
||||||
highlightRender(item);
|
highlightRender(item);
|
||||||
avRender(item, protyle);
|
avRender(item, protyle);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue