From 493a60faefbee6762b96600e6025ea15dc050c51 Mon Sep 17 00:00:00 2001 From: melyux <10296053+melyux@users.noreply.github.com> Date: Sun, 6 Aug 2023 09:19:19 -0700 Subject: [PATCH] Exporter: Replace newlines with commas in HTML, Readwise (#10788) Resolves #10755. --- plugins/exporter.koplugin/target/readwise.lua | 2 +- plugins/exporter.koplugin/template/note.tpl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/exporter.koplugin/target/readwise.lua b/plugins/exporter.koplugin/target/readwise.lua index 77c7992a3..fd2f7e2ff 100644 --- a/plugins/exporter.koplugin/target/readwise.lua +++ b/plugins/exporter.koplugin/target/readwise.lua @@ -101,7 +101,7 @@ function ReadwiseExporter:createHighlights(booknotes) local highlight = { text = clipping.text, title = booknotes.title, - author = booknotes.author ~= "" and booknotes.author or nil, -- optional author + author = booknotes.author ~= "" and booknotes.author:gsub("\n", ", ") or nil, -- optional author source_type = "koreader", category = "books", note = clipping.note, diff --git a/plugins/exporter.koplugin/template/note.tpl b/plugins/exporter.koplugin/template/note.tpl index 60b1e770e..64d444c90 100644 --- a/plugins/exporter.koplugin/template/note.tpl +++ b/plugins/exporter.koplugin/template/note.tpl @@ -58,7 +58,7 @@
#{ for _, booknotes in ipairs(clippings) do }#

#{= htmlescape(booknotes.title) }#

-
#{= htmlescape(booknotes.author) }#
+
#{= htmlescape(booknotes.author:gsub("\n", ", ")) }#
#{ for _, chapter in ipairs(booknotes.chapters) do }# #{ if chapter.title then }#
#{= htmlescape(chapter.title) }#