View Single Post
Old 06-19-2024, 09:20 AM   #11
Actaeus
Junior Member
Actaeus began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Jun 2024
Device: Kobo Clara 2
Registered just to post this solution.

Jabbergeist's solution works, but it has changed a little bit due to the way calibre has also.

A working solution for Calibre 7.xx that works in the FOOTER TEMPLATE is:

Quote:
program:

#Load Comments
comments = field('comments');

#Eliminate first 8 and last 10 to kill DIV and P text then kill all remaining HTML Tags
comments = substr(comments, 21, -22);
comments = re(comments, '<[^>]*>', '');

# Show at most two authors, on separate lines.
authors = field('authors');
num = count(authors, ' &amp; ');
authors = sublist(authors, 0, 2, ' &amp; ');
authors = list_re(authors, ' &amp; ', '(.+)', '<b>\1');
authors = re(authors, ' &amp; ', '<br>');
authors = re(authors, '&amp;&amp;', '&amp;');

# Combine Comments and Authors
comments & '<br><br>' & authors
Actaeus is offline   Reply With Quote