qutebrowser/tests/unit/completion
Ryan Roden-Corrent 102c6b99dd
Don't highlight html escapes in completion.
Resolves #4199.

To avoid accidentally highlighting characters that were introduced by
html escaping the text before feeding it to setHtml, we can't just
escape the whole string before adding the highlighting. Instead, we need
to break the string up on the pattern, format and escape the individual
parts, then join them back together.

re.escape includes empty strings if there is a match at the start/end,
which ensures that matches always land on odd indices:

https://docs.python.org/3/library/re.html#re.split

> If there are capturing groups in the separator and it matches at the
> start of the string, the result will start with an empty string. The
> same holds for the end of the string
2018-09-15 14:06:28 -04:00
..
test_completer.py Remove the deprecated :tab-detach 2018-06-09 21:25:09 +02:00
test_completiondelegate.py Don't highlight html escapes in completion. 2018-09-15 14:06:28 -04:00
test_completionmodel.py Update copyright years 2018-02-05 12:19:50 +01:00
test_completionwidget.py Update copyright years 2018-02-05 12:19:50 +01:00
test_histcategory.py Rename history.exclude to completion.web_history.exclude 2018-09-02 14:42:47 +02:00
test_listcategory.py Update copyright years 2018-02-05 12:19:50 +01:00
test_models.py Use a shared web_history fixture 2018-09-06 20:08:32 +02:00