From 3351e3b4ddf7e5c7cc076ff71b2bb0f44399c0c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?poljar=20=28Damir=20Jeli=C4=87=29?= Date: Thu, 25 Jan 2018 12:32:31 +0100 Subject: [PATCH] Fix italic and underline parsing on the weechat input line. --- weechat-matrix.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/weechat-matrix.py b/weechat-matrix.py index c6ea4df..856bfdd 100644 --- a/weechat-matrix.py +++ b/weechat-matrix.py @@ -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="") elif name == "fgcolor" and value: - return "{underline_on}{text}{underline_off}".format( - underline_on="".format(color=value), + return "{color_on}{text}{color_off}".format( + color_on="".format(color=value), text=string, - underline_off="") + color_off="") return string