From a64dd02118630365cf55a4e8dd90429f1ef49a0f Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Sat, 22 Feb 2014 01:11:57 +0100 Subject: Remove the dependency on poezio from xhtml.py --- src/xhtml.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src/xhtml.py') 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: -- cgit v1.2.3