Render plain text comments in book file metadata as HTML

This commit is contained in:
Kovid Goyal 2020-08-21 07:22:55 +05:30
parent e3e588c901
commit 05ccd5c348
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -318,6 +318,9 @@ def render_metadata(mi, table, book_id, iframe_css): # {{{
add_row(name, val) add_row(name, val)
return return
val = E.span(val).outerHTML val = E.span(val).outerHTML
else:
if field is 'comments' and '<' not in val:
val = '\n'.join(['<p class="description">{}</p>'.format(x.pyreplace('\n', '<br>')) for x in val.split('\n\n')])
if hp is 'side': if hp is 'side':
add_row(name, val, is_html=True) add_row(name, val, is_html=True)
return return