This commit is contained in:
parent
70c520ac15
commit
0fce368d10
2 changed files with 19 additions and 1 deletions
|
@ -360,6 +360,18 @@ const renderPDF = (id: string) => {
|
|||
item.style.zoom = item.parentElement.clientWidth / item.clientWidth;
|
||||
}
|
||||
})
|
||||
previewElement.addEventListener("click", (event) => {
|
||||
if (event.target.tagName === "A") {
|
||||
const linkAddress = event.target.getAttribute("href");
|
||||
if (linkAddress.startsWith("#")) {
|
||||
// 导出预览模式点击块引转换后的脚注跳转不正确 https://github.com/siyuan-note/siyuan/issues/5700
|
||||
previewElement.querySelector(linkAddress).scrollIntoView();
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
return;
|
||||
}
|
||||
}
|
||||
});
|
||||
const actionElement = document.getElementById('action');
|
||||
actionElement.querySelector('.b3-button--cancel').addEventListener('click', () => {
|
||||
const {ipcRenderer} = require("electron");
|
||||
|
@ -386,6 +398,12 @@ const renderPDF = (id: string) => {
|
|||
id,
|
||||
tpl: html
|
||||
}, response => {
|
||||
if (response.code === 1) {
|
||||
hideMessage();
|
||||
showMessage(response.msg, undefined, "error");
|
||||
destroyWin(win);
|
||||
return;
|
||||
}
|
||||
win.loadURL(response.data.url);
|
||||
});
|
||||
};
|
||||
|
|
|
@ -39,7 +39,7 @@ export class Preview {
|
|||
const linkAddress = event.target.getAttribute("href");
|
||||
if (linkAddress.startsWith("#")) {
|
||||
// 导出预览模式点击块引转换后的脚注跳转不正确 https://github.com/siyuan-note/siyuan/issues/5700
|
||||
// 对于超链接锚点不做任何处理
|
||||
previewElement.querySelector(linkAddress).scrollIntoView();
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
return;
|
||||
|
|
Loading…
Add table
Reference in a new issue