diff options
author | mathieui <mathieui@mathieui.net> | 2011-05-11 14:33:22 +0200 |
---|---|---|
committer | mathieui <mathieui@mathieui.net> | 2011-05-11 14:33:22 +0200 |
commit | c631673cf315dcaadb0c2a76a9e0d62dc840766b (patch) | |
tree | f0d2c031055ffc8ba56349725e257d7b5a79369a /src/xhtml.py | |
parent | 4a007eb42b8a44ce0ae2195d88962a7b1eebffc5 (diff) | |
download | poezio-c631673cf315dcaadb0c2a76a9e0d62dc840766b.tar.gz poezio-c631673cf315dcaadb0c2a76a9e0d62dc840766b.tar.bz2 poezio-c631673cf315dcaadb0c2a76a9e0d62dc840766b.tar.xz poezio-c631673cf315dcaadb0c2a76a9e0d62dc840766b.zip |
should fix #2161, and enable xhtml-im while in debug
Diffstat (limited to 'src/xhtml.py')
-rw-r--r-- | src/xhtml.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/xhtml.py b/src/xhtml.py index 954db374..237ed444 100644 --- a/src/xhtml.py +++ b/src/xhtml.py @@ -133,9 +133,12 @@ def poezio_colors_to_html(string): if 'strong' not in opened_elements: opened_elements.append('strong') res += '<strong>' - elif attr_char.isdigit(): + elif attr_char.isnumeric(): number = int(attr_char) if number in number_to_color_names: + if 'strong' in opened_elements: + res += '</strong>' + opened_elements.remove('strong') if 'span' in opened_elements: res += '</span>' else: @@ -212,7 +215,7 @@ def poezio_colors_to_xhtml(string): if 'strong' not in open_elements: res += '<strong>' open_elements.append('strong') - elif attr_char.isdigit(): + elif attr_char.isnumeric(): self._win.attron(common.curses_color_pair(int(attr_char))) next_attr_char = string.find('\x19') |