diff options
author | Florent Le Coz <louiz@louiz.org> | 2011-09-23 23:01:13 +0200 |
---|---|---|
committer | Florent Le Coz <louiz@louiz.org> | 2011-09-23 23:01:13 +0200 |
commit | 1ff421075def58b31f06f32a481ab4d6f4c67fa8 (patch) | |
tree | 6d0a1e1fa4549b8f86313a1f7d8ce7091fc3b526 | |
parent | a9d2cf8ff237e164e187c9e48745641e7db6deb8 (diff) | |
download | poezio-1ff421075def58b31f06f32a481ab4d6f4c67fa8.tar.gz poezio-1ff421075def58b31f06f32a481ab4d6f4c67fa8.tar.bz2 poezio-1ff421075def58b31f06f32a481ab4d6f4c67fa8.tar.xz poezio-1ff421075def58b31f06f32a481ab4d6f4c67fa8.zip |
Do not remove trailing spaces in an XHTML-IM element’s text.
-rw-r--r-- | src/xhtml.py | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/src/xhtml.py b/src/xhtml.py index 949044b1..d25500f0 100644 --- a/src/xhtml.py +++ b/src/xhtml.py @@ -174,10 +174,6 @@ colors = { log = logging.getLogger(__name__) -shell_colors_re = re.compile(r'(\[(?:\d+;)*(?:\d+m))') -start_indent_re = re.compile(r'\[0;30m\[0;37m ') -newline_indent_re = re.compile('\n\[0;37m ') - def get_body_from_message_stanza(message): """ Returns a string with xhtml markups converted to @@ -190,7 +186,6 @@ def get_body_from_message_stanza(message): return xhtml_to_poezio_colors(xhtml_body) return message['body'] - def xhtml_to_poezio_colors(text): def parse_css(css): def get_color(value): @@ -289,7 +284,7 @@ def xhtml_to_poezio_colors(text): if (elem.text and elem.tag != '{http://www.w3.org/1999/xhtml}a' and elem.tag != '{http://www.w3.org/1999/xhtml}br' and elem.tag != '{http://www.w3.org/1999/xhtml}img'): - message += elem.text.strip() + message += elem.text.replace('\n', '') if ('style' in elem.attrib and elem.tag != '{http://www.w3.org/1999/xhtml}br' and elem.tag != '{http://www.w3.org/1999/xhtml}em' |