Fix italic and underline parsing on the weechat input line.

This commit is contained in:
poljar (Damir Jelić) 2018-01-25 12:32:31 +01:00
parent 43c42b3c17
commit 3351e3b4dd

View file

@ -773,7 +773,7 @@ def parse_input_line(line):
attributes = Default_format_attributes.copy()
i = i + 1
# Italic
elif line[i] == "0\x1D":
elif line[i] == "\x1D":
if text:
substrings.append(FormattedString(text, attributes.copy()))
text = ""
@ -781,7 +781,7 @@ def parse_input_line(line):
i = i + 1
# Underline
elif line[i] == "0\x1F":
elif line[i] == "\x1F":
if text:
substrings.append(FormattedString(text, attributes.copy()))
text = ""
@ -889,10 +889,10 @@ def formatted_to_html(strings):
text=string,
quote_off="</blockquote>")
elif name == "fgcolor" and value:
return "{underline_on}{text}{underline_off}".format(
underline_on="<font color={color}>".format(color=value),
return "{color_on}{text}{color_off}".format(
color_on="<font color={color}>".format(color=value),
text=string,
underline_off="</font>")
color_off="</font>")
return string