From 9a1a76605a3b21adffe5407973edecee1f3c38f7 Mon Sep 17 00:00:00 2001 From: zadam Date: Thu, 19 Mar 2020 09:42:41 +0100 Subject: [PATCH] fix OPML export of book notes, closes #919 --- src/services/export/opml.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/services/export/opml.js b/src/services/export/opml.js index e78408117..112cc54af 100644 --- a/src/services/export/opml.js +++ b/src/services/export/opml.js @@ -16,7 +16,7 @@ async function exportToOpml(taskContext, branch, version, res) { const branch = await repository.getBranch(branchId); const note = await branch.getNote(); - if (!note.isStringNote() || await note.hasOwnedLabel('excludeFromExport')) { + if (await note.hasOwnedLabel('excludeFromExport')) { return; } @@ -24,13 +24,13 @@ async function exportToOpml(taskContext, branch, version, res) { if (opmlVersion === 1) { const preparedTitle = escapeXmlAttribute(title); - const preparedContent = prepareText(await note.getContent()); + const preparedContent = note.isStringNote() ? prepareText(await note.getContent()) : ''; res.write(`\n`); } else if (opmlVersion === 2) { const preparedTitle = escapeXmlAttribute(title); - const preparedContent = escapeXmlAttribute(await note.getContent()); + const preparedContent = note.isStringNote() ? escapeXmlAttribute(await note.getContent()) : ''; res.write(`\n`); }