diff --git a/src/pyj/book_list/book_details.pyj b/src/pyj/book_list/book_details.pyj index 7609647b9a..e6578969f4 100644 --- a/src/pyj/book_list/book_details.pyj +++ b/src/pyj/book_list/book_details.pyj @@ -249,9 +249,10 @@ def render_metadata(mi, table, book_id): # {{{ ival = 1.0 ival = fmt_sidx(ival, use_roman=interface_data.use_roman_numerals_for_series_number) table.appendChild(E.tr(E.td(name + ':'), E.td())) - table.lastChild.lastChild.appendChild(E.span(ival, _(' of '), E.a( - href=href_for_search(field, val), - title=_('Click to see books with {0}: {1}').format(name, val), val))) + s = safe_set_inner_html(E.span(), _('{0} of {1}').format(ival, val)) + s.lastChild.setAttribute('href', href_for_search(field, val)) + s.lastChild.setAttribute('title', _('Click to see books with {0}: {1}').format(name, val)) + table.lastChild.lastChild.appendChild(s) def process_field(field, fm): name = fm.name or field diff --git a/src/pyj/book_list/details_list.pyj b/src/pyj/book_list/details_list.pyj index 9d86c5e159..b48f1343d4 100644 --- a/src/pyj/book_list/details_list.pyj +++ b/src/pyj/book_list/details_list.pyj @@ -7,7 +7,7 @@ from gettext import gettext as _ from dom import build_rule, clear, set_css, svgicon from session import get_interface_data -from utils import fmt_sidx, sandboxed_html +from utils import fmt_sidx, sandboxed_html, safe_set_inner_html DETAILS_LIST_CLASS = 'book-list-details-list' ITEM_CLASS = DETAILS_LIST_CLASS + '-item' @@ -85,7 +85,7 @@ def create_item(book_id, metadata, create_image, show_book_details): except Exception: ival = 1.0 ival = fmt_sidx(ival, use_roman=interface_data.use_roman_numerals_for_series_number) - extra_data.appendChild(E.span(ival, ' ' + _('of') + ' ', E.i(metadata.series))) + extra_data.appendChild(safe_set_inner_html(E.span(), _('{0} of {1}').format(ival, metadata.series))) right = E.div( class_='details-list-right', E.div(style='display:flex; justify-content: space-between; overflow: hidden', diff --git a/src/pyj/utils.pyj b/src/pyj/utils.pyj index dad3172d6d..e95a521c0e 100644 --- a/src/pyj/utils.pyj +++ b/src/pyj/utils.pyj @@ -215,7 +215,7 @@ def simple_markup(html): div.textContent = html html = div.innerHTML return html.replace(/\uffff(\/?[a-z1-6]+)\uffff/g, '<$1>') -simple_markup.allowed_tags = v"'b|i|br|h1|h2|h3|h4|h5|h6|div|em|strong|span'.split('|')" +simple_markup.allowed_tags = v"'a|b|i|br|h1|h2|h3|h4|h5|h6|div|em|strong|span'.split('|')" def safe_set_inner_html(elem, html):