koreader / koreader

An ebook reader application supporting PDF, DjVu, EPUB, FB2 and many more formats, running on Cervantes, Kindle, Kobo, PocketBook and Android devices
http://koreader.rocks/
GNU Affero General Public License v3.0
16.85k stars 1.26k forks source link

ExportHighlights: Author metadata concatenates multiple authors into one name ("John Mitchell William Black") #10755

Closed melyux closed 1 year ago

melyux commented 1 year ago

Issue

When exporting, the names of multiple authors on a book are concatenated with just a space (or not... maybe a newline?); this should be an ampersand or a comma, because it ends up like that in targets (like Readwise).

So you get "John Mitchell William Black" instead of "John Mitchell, William Black" or "John Mitchell & William Black". The comma one is probably simpler to implement when you have 3+ authors.

It may actually be a newline, not a space, because I just saw the exported thing display as "Tobias SmollettJohn P. ZomchickGeorge S. RousseauO M Brack, JrW. H. Keithley" with them all stuck together, but also displayed with spaces in between somewhere else. Either way, still not ideal

Steps to reproduce

Export highlights for a book with multiple authors. Look at what gets exported for the author.

Pinging @Mochitto perhaps? Thanks for making this even possible in the first place back in April.

hius07 commented 1 year ago

You mean export to html I guess.

The source authors are separated with "\n". json export leaves them as is. md export changes to commas.

melyux commented 1 year ago

I think both HTML and Readwise have the issue

Mochitto commented 1 year ago

Will look into it in the weekend ☺️💕

melyux commented 1 year ago

@Mochitto Any luck? I briefly tried myself but got lost in the weeds

hius07 commented 1 year ago

For html you can add booknotes.author:gsub("\n", ", ") to line 61 of note.tpl.

melyux commented 1 year ago

That seems to have done the trick. For readwise.lua, the same change would be on line 104.