mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-22 09:30:14 +01:00
This commit is contained in:
parent
17d7b69c01
commit
5c79a0c387
2 changed files with 11 additions and 3 deletions
|
|
@ -766,8 +766,16 @@ export const exportMd = (id: string) => {
|
|||
keepFold: localData.keepFold,
|
||||
merge: localData.mergeSubdocs,
|
||||
}, async response => {
|
||||
const htmlElement = document.createElement("template");
|
||||
htmlElement.innerHTML = response.data.content;
|
||||
htmlElement.content.querySelectorAll("svg > use").forEach(item => {
|
||||
const symbolElement = document.querySelector(`symbol${item.getAttribute("xlink:href")}`);
|
||||
item.parentElement.setAttribute("viewBox", symbolElement.getAttribute("viewBox"));
|
||||
item.outerHTML = symbolElement.innerHTML;
|
||||
});
|
||||
response.data.content = htmlElement.innerHTML
|
||||
const html = await onExport(response, undefined, {type: "pdf", id});
|
||||
window.JSAndroid.exportPDF(html.replace('<use xlink:href="#iconDot"></use>', '<path d="M5.501 9.999c0 2.485 2.016 4.499 4.501 4.499s4.497-2.016 4.497-4.499c0-2.485-2.012-4.497-4.497-4.497s-4.501 2.012-4.501 4.497z"></path>'));
|
||||
window.JSAndroid.exportPDF(html);
|
||||
});
|
||||
}
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue