Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
Vanessa 2022-08-24 09:48:04 +08:00
commit e8774ab643
4 changed files with 55 additions and 1 deletions

View file

@ -16,7 +16,7 @@ export const exportAsset = (src: string) => {
properties: ["showOverwriteConfirmation"],
}).then((result: SaveDialogReturnValue) => {
if (!result.canceled) {
fetchPost("/api/file/saveAs", {src, targe: result.filePath})
fetchPost("/api/file/copyFile", {src, dest: result.filePath})
}
});
}

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