🐛 导出预览模式点击块引转换后的脚注跳转不正确 Fix https://github.com/siyuan-note/siyuan/issues/5700

This commit is contained in:
Liang Ding 2022-08-23 23:51:41 +08:00
parent 6e754ef190
commit 02c2c529bd
No known key found for this signature in database
GPG key ID: 136F30F901A2231D

View file

@ -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();