This commit is contained in:
Vanessa 2023-08-09 22:56:56 +08:00
parent 0f8e2969ee
commit 0d62b16da9

View File

@ -1641,12 +1641,12 @@ export class WYSIWYG {
// 需放在嵌入块之前否则嵌入块内的引用、链接、pdf 双链无法点击打开 https://ld246.com/article/1630479789513 // 需放在嵌入块之前否则嵌入块内的引用、链接、pdf 双链无法点击打开 https://ld246.com/article/1630479789513
const blockRefElement = hasClosestByAttribute(event.target, "data-type", "block-ref"); const blockRefElement = hasClosestByAttribute(event.target, "data-type", "block-ref");
const aElement = hasClosestByAttribute(event.target, "data-type", "a") || hasClosestByAttribute(event.target, "data-type", "url"); const aElement = hasClosestByAttribute(event.target, "data-type", "a") || hasClosestByAttribute(event.target, "data-type", "url");
let aLink = "" let aLink = "";
if (aElement) { if (aElement) {
if (aElement.classList.contains("av__celltext")) { if (aElement.classList.contains("av__celltext")) {
aLink = aElement.textContent.trim() aLink = aElement.textContent.trim();
} else { } else {
aLink = aElement.getAttribute("data-href") aLink = aElement.getAttribute("data-href");
} }
} }
if (blockRefElement || aLink.startsWith("siyuan://blocks/")) { if (blockRefElement || aLink.startsWith("siyuan://blocks/")) {