webconfig: Hack tmux's reset sequence

This is quite ugly, but in lieu of putting in a proper ansi
parser (i.e. the output part of a terminal), since this is the only
such sequence we have seen until now, let's just match it.

Fixes #5312.

[ci skip]
This commit is contained in:
Fabian Homborg 2018-11-30 20:19:37 +01:00
parent 91a664b9fa
commit 60f8eda5c4

View file

@ -308,8 +308,9 @@ def ansi_to_html(val):
reg = re.compile("""
( # Capture
\x1b # Escape
[^m]+ # One or more non-'m's
[^m]* # Zero or more non-'m's
m # Literal m terminates the sequence
\x0f? # HACK: A ctrl-o - this is how tmux' sgr0 ends
) # End capture
""", re.VERBOSE)
separated = reg.split(val)