E-book viewer: Fix a regression that caused non-HTML descriptions to not be displayed in the metadata page

This commit is contained in:
Kovid Goyal 2021-01-19 09:24:34 +05:30
parent 14051f4864
commit eae5ff6d88
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -328,7 +328,7 @@ def render_metadata(mi, table, book_id, iframe_css): # {{{
val = E.span(val).outerHTML val = E.span(val).outerHTML
else: else:
if field is 'comments' and '<' not in val: 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')]) val = '\n'.join(['<p class="description">{}</p>'.format(x.replace(/\n/g, '<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