This commit is contained in:
Vanessa 2022-09-26 20:56:22 +08:00
parent a8560b365b
commit 8f73915322
2 changed files with 7 additions and 5 deletions

View file

@ -129,7 +129,7 @@ class Protyle {
}
}
// update ref
this.protyle.wysiwyg.element.querySelectorAll(`[data-type="~block-ref"][data-id="${data.data.id}"]`).forEach(item => {
this.protyle.wysiwyg.element.querySelectorAll(`[data-type~="block-ref"][data-id="${data.data.id}"]`).forEach(item => {
if (item.getAttribute("data-subtype") === "d") {
item.textContent = data.data.title;
}

View file

@ -578,15 +578,17 @@ export class Toolbar {
protyle.toolbar.showRender(protyle, newNodes[0] as HTMLElement, undefined, html);
return;
}
}
if (type === "inline-memo") {
} else if (type === "inline-memo") {
protyle.toolbar.showRender(protyle, newNodes[0] as HTMLElement, newNodes as Element[], html);
return;
}
if (type === "a") {
} else if (type === "block-ref") {
this.range.collapse(false);
} else if (type === "a") {
const aElement = newNodes[0] as HTMLElement
if (aElement.textContent.replace(Constants.ZWSP, "") === "" || !aElement.getAttribute("data-href")) {
linkMenu(protyle, aElement, aElement.getAttribute("data-href") ? true : false);
} else {
this.range.collapse(false);
}
}
nodeElement.setAttribute("updated", dayjs().format("YYYYMMDDHHmmss"));