This commit is contained in:
Vanessa 2024-04-25 15:56:06 +08:00
parent 882883a9cc
commit 4ca684ca8a
4 changed files with 6 additions and 6 deletions

View file

@ -280,7 +280,7 @@ class="fn__flex-1 fn__flex${["url", "text", "number", "email", "phone", "block"]
if (document.querySelector(".av__panel .b3-form__upload") && files && files.length > 0) {
uploadFiles(protyle, files);
}
})
});
element.addEventListener("click", (event) => {
let target = event.target as HTMLElement;
const blockElement = hasClosestBlock(target);
@ -302,7 +302,7 @@ class="fn__flex-1 fn__flex${["url", "text", "number", "email", "phone", "block"]
} else if (type === "mAsset") {
element.querySelectorAll('.custom-attr__avvalue[data-type="mAsset"]').forEach(item => {
item.removeAttribute("data-active");
})
});
target.setAttribute("data-active", "true");
target.focus();
popTextCell(protyle, [target], "mAsset");

View file

@ -191,7 +191,7 @@ export const pasteText = (protyle: IProtyle, textPlain: string, nodeElement: Ele
} else if (isFileAnnotation(textPlain)) {
textPlain = textPlain.replace(/".+">>$/, `"${range.toString()}">>`);
} else {
const linkDest = protyle.lute.GetLinkDest(textPlain)
const linkDest = protyle.lute.GetLinkDest(textPlain);
if (linkDest) {
textPlain = `[${range.toString()}](${linkDest})`;
}
@ -448,7 +448,7 @@ export const paste = async (protyle: IProtyle, event: (ClipboardEvent | DragEven
return;
} else {
// https://github.com/siyuan-note/siyuan/issues/8475
const linkDest = protyle.lute.GetLinkDest(textPlain)
const linkDest = protyle.lute.GetLinkDest(textPlain);
if (linkDest) {
protyle.toolbar.setInlineMark(protyle, "a", "range", {
type: "a",