diff options
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> | 2014-02-22 01:11:57 +0100 |
---|---|---|
committer | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> | 2014-02-22 01:11:57 +0100 |
commit | a64dd02118630365cf55a4e8dd90429f1ef49a0f (patch) | |
tree | f4bfc1ea8e52cf6858a460080107a9944007eb54 /src/xhtml.py | |
parent | 9240bc396465817c6387de5392f6dc2d429a8bd7 (diff) | |
download | poezio-a64dd02118630365cf55a4e8dd90429f1ef49a0f.tar.gz poezio-a64dd02118630365cf55a4e8dd90429f1ef49a0f.tar.bz2 poezio-a64dd02118630365cf55a4e8dd90429f1ef49a0f.tar.xz poezio-a64dd02118630365cf55a4e8dd90429f1ef49a0f.zip |
Remove the dependency on poezio from xhtml.py
Diffstat (limited to 'src/xhtml.py')
-rw-r--r-- | src/xhtml.py | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/xhtml.py b/src/xhtml.py index a1628574..85e764ba 100644 --- a/src/xhtml.py +++ b/src/xhtml.py @@ -20,9 +20,6 @@ from io import BytesIO from xml import sax from xml.sax import saxutils -from config import config -import logging - digits = '0123456789' # never trust the modules XHTML_NS = 'http://www.w3.org/1999/xhtml' @@ -184,13 +181,13 @@ xhtml_attr_re = re.compile(r'\x19-?\d[^}]*}|\x19[buaio]') xhtml_simple_attr_re = re.compile(r'\x19\d') -def get_body_from_message_stanza(message): +def get_body_from_message_stanza(message, use_xhtml=False): """ Returns a string with xhtml markups converted to poezio colors if there's an xhtml_im element, or the body (without any color) otherwise """ - if config.get('enable_xhtml_im', 'true') == 'true': + if use_xhtml: xhtml = message['html'].xml xhtml_body = xhtml.find('{http://www.w3.org/1999/xhtml}body') if xhtml_body: |