From c253825a42d9a3d28a82e5ba97b3f007055ce454 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 22 Nov 2020 21:16:44 +0530 Subject: [PATCH] ensure replaced msg is detected as html Doesnt get so detected with some search expressions --- src/calibre/gui2/tweak_book/search.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/calibre/gui2/tweak_book/search.py b/src/calibre/gui2/tweak_book/search.py index a6dc173ba2..c8136e5fa7 100644 --- a/src/calibre/gui2/tweak_book/search.py +++ b/src/calibre/gui2/tweak_book/search.py @@ -1484,13 +1484,13 @@ def run_search( msg = _('Performed the replacement at {num} occurrences of {query}') else: msg = _('Found {num} occurrences of {query}') - msg = msg.format(num=count, query=errfind) + msg = msg.format(num=count, query=prepare_string_for_xml(errfind)) det_msg = '' if count_map is not None and count > 0 and len(count_map) > 1: for k in sorted(count_map): det_msg += _('{0}: {1} occurrences').format(k, count_map[k]) + '\n' if show_diff and count > 0: - d = MessageBox(MessageBox.INFO, _('Searching done'), prepare_string_for_xml(msg), parent=gui_parent, show_copy_button=False, det_msg=det_msg) + d = MessageBox(MessageBox.INFO, _('Searching done'), '

'+msg, parent=gui_parent, show_copy_button=False, det_msg=det_msg) d.diffb = b = d.bb.addButton(_('See what &changed'), d.bb.AcceptRole) d.show_changes = False b.setIcon(QIcon(I('diff.png'))), b.clicked.connect(d.accept)