qutebrowser/tests/unit
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
..
browser Allow downloading from PDF.js 2018-09-10 13:15:39 +02:00
commands Wait until runner is finished in test_custom_env 2018-03-19 11:43:08 +01:00
completion Don't highlight html escapes in completion. 2018-09-15 14:06:28 -04:00
config Fix pylint issues with config cache 2018-09-06 16:43:10 +02:00
javascript Handle UTF-8 byte order marks in Greasemonkey scripts 2018-09-12 23:54:32 +02:00
keyinput Recognize "Command"/"Cmd" in keybindings 2018-08-28 18:57:47 +02:00
mainwindow Use config_stub.val instead of config_stub.set_obj in tests 2018-09-02 14:42:47 +02:00
misc Clean up workaround for sqlite opening errors 2018-09-12 16:06:57 +02:00
scripts Update copyright years 2018-02-05 12:19:50 +01:00
utils Add utils.guess_mimetype 2018-09-09 18:35:09 +02:00
test_app.py Update copyright years 2018-02-05 12:19:50 +01:00