From e766fe14fcde6769f50e02f822b0d788266acc3f Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 16 Oct 2017 12:27:13 +0200 Subject: [PATCH] Fix HTML escaping in completion --- doc/changelog.asciidoc | 1 + qutebrowser/completion/completiondelegate.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/changelog.asciidoc b/doc/changelog.asciidoc index 14a9379e7..3e2aeeb12 100644 --- a/doc/changelog.asciidoc +++ b/doc/changelog.asciidoc @@ -40,6 +40,7 @@ Fixed - Fixed workaround for black screens with Nvidia cards - Mark the content.notifications setting as QtWebKit only correctly - Handle a filesystem going read-only gracefully +- Fix wrong rendering of keys like `` in the completion v1.0.1 ------ diff --git a/qutebrowser/completion/completiondelegate.py b/qutebrowser/completion/completiondelegate.py index 8248b3745..6688a2dfa 100644 --- a/qutebrowser/completion/completiondelegate.py +++ b/qutebrowser/completion/completiondelegate.py @@ -202,7 +202,8 @@ class CompletionItemDelegate(QStyledItemDelegate): if index.column() in columns_to_filter and pattern: repl = r'\g<0>' text = re.sub(re.escape(pattern).replace(r'\ ', r'|'), - repl, self._opt.text, flags=re.IGNORECASE) + repl, html.escape(self._opt.text), + flags=re.IGNORECASE) self._doc.setHtml(text) else: self._doc.setPlainText(self._opt.text)