summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Bruhin <git@the-compiler.org>2017-10-16 12:27:13 +0200
committerFlorian Bruhin <git@the-compiler.org>2017-10-16 12:27:45 +0200
commitddfa82345cc34e7608211c1d5ecda5192d45509e (patch)
treeccbad88eb0cf0c119494907f939e6bd4d1f3d0e3
parent45c75d5e04b2640aa720b959e74b8913c5fc78e5 (diff)
downloadqutebrowser-ddfa82345cc34e7608211c1d5ecda5192d45509e.tar.gz
qutebrowser-ddfa82345cc34e7608211c1d5ecda5192d45509e.zip
Fix HTML escaping in completion
(cherry picked from commit e766fe14fcde6769f50e02f822b0d788266acc3f)
-rw-r--r--doc/changelog.asciidoc1
-rw-r--r--qutebrowser/completion/completiondelegate.py3
2 files changed, 3 insertions, 1 deletions
diff --git a/doc/changelog.asciidoc b/doc/changelog.asciidoc
index 1ce5e8feb..61235cee2 100644
--- a/doc/changelog.asciidoc
+++ b/doc/changelog.asciidoc
@@ -24,6 +24,7 @@ Fixes
- 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 `<back>` 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'<span class="highlight">\g<0></span>'
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)