1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-24 10:27:10 +02:00

Desktop: Regression: Fix exporting to HTML and PDF

This commit is contained in:
Laurent Cozic 2020-11-08 02:20:56 +00:00
parent f20b8c2dc6
commit 88a2f9c85c

View File

@ -99,11 +99,13 @@ export default class InteropService_Exporter_Html extends InteropService_Exporte
if (item.title) noteContent.push(`<div class="exported-note-title">${escapeHtml(item.title)}</div>`);
if (result.html) noteContent.push(result.html);
const libRootPath = dirname(dirname(__dirname));
// We need to export all the plugin assets too and refer them from the header
// The source path is a bit hard-coded but shouldn't change.
for (let i = 0; i < result.pluginAssets.length; i++) {
const asset = result.pluginAssets[i];
const filePath = `${dirname(dirname(dirname(__dirname)))}/gui/note-viewer/pluginAssets/${asset.name}`;
const filePath = `${libRootPath}/node_modules/@joplin/renderer/assets/${asset.name}`;
const destPath = `${dirname(noteFilePath)}/pluginAssets/${asset.name}`;
await shim.fsDriver().mkdir(dirname(destPath));
await shim.fsDriver().copy(filePath, destPath);