From 02c2c529bd9ac49087a2588b2ffcf6c84d3c9622 Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Tue, 23 Aug 2022 23:51:41 +0800 Subject: [PATCH] =?UTF-8?q?:bug:=20=E5=AF=BC=E5=87=BA=E9=A2=84=E8=A7=88?= =?UTF-8?q?=E6=A8=A1=E5=BC=8F=E7=82=B9=E5=87=BB=E5=9D=97=E5=BC=95=E8=BD=AC?= =?UTF-8?q?=E6=8D=A2=E5=90=8E=E7=9A=84=E8=84=9A=E6=B3=A8=E8=B7=B3=E8=BD=AC?= =?UTF-8?q?=E4=B8=8D=E6=AD=A3=E7=A1=AE=20Fix=20https://github.com/siyuan-n?= =?UTF-8?q?ote/siyuan/issues/5700?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/protyle/preview/index.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/src/protyle/preview/index.ts b/app/src/protyle/preview/index.ts index 059dcad1d..9af7f2ac6 100644 --- a/app/src/protyle/preview/index.ts +++ b/app/src/protyle/preview/index.ts @@ -37,6 +37,14 @@ export class Preview { previewElement.addEventListener("click", (event: MouseEvent & { target: HTMLElement }) => { if (event.target.tagName === "A") { const linkAddress = event.target.getAttribute("href"); + if (linkAddress.startsWith("#")) { + // 导出预览模式点击块引转换后的脚注跳转不正确 https://github.com/siyuan-note/siyuan/issues/5700 + // 对于超链接锚点不做任何处理 + event.stopPropagation(); + event.preventDefault(); + return + } + if (isMobile()) { openByMobile(linkAddress); event.stopPropagation();