1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-01-23 18:53:36 +02:00

Desktop: Resolve #6254: <details> elements remain closed when exporting to PDF (#7515)

This commit is contained in:
Hitarth Thummar 2022-12-27 22:27:00 +05:30 committed by GitHub
parent 527a7da2ff
commit 8e2e7eccd9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -78,6 +78,8 @@ export default class InteropServiceHelper {
shim.setTimeout(async () => {
if (target === 'pdf') {
try {
// The below line "opens" all <details> tags before printing. This assures that the contents of the tag are visible in printed pdfs. Fixes https://github.com/laurent22/joplin/issues/6254.
win.webContents.executeJavaScript('document.querySelectorAll(\'details\').forEach(el=>el.setAttribute(\'open\',\'\'))');
const data = await win.webContents.printToPDF(options);
resolve(data);
} catch (error) {