comparison src/plugins/plugin_xep_0071.py @ 701:98b2400e17d6

plugin XEP-0071: XHTML2XHTML_IM don't return the <body> root tag anymore.
author Goffi <goffi@goffi.org>
date Wed, 13 Nov 2013 14:02:02 +0100
parents 7bb50096d225
children a25db3fe3959
comparison
equal deleted inserted replaced
700:ab9620029aa8 701:98b2400e17d6
158 #we need to remove the element and all descendants 158 #we need to remove the element and all descendants
159 debug(u"removing black listed tag: %s" % (elem.tag)) 159 debug(u"removing black listed tag: %s" % (elem.tag))
160 elem.drop_tree() 160 elem.drop_tree()
161 else: 161 else:
162 elem.drop_tag() 162 elem.drop_tag()
163 if len(body_elt) !=1:
164 root_elt = body_elt
165 body_elt.tag = "p"
166 else:
167 root_elt = body_elt[0]
163 168
164 return html.tostring(body_elt, encoding='unicode', method='xml') 169 return html.tostring(root_elt, encoding='unicode', method='xml')
165 170
166 class XEP_0071_handler(XMPPHandler): 171 class XEP_0071_handler(XMPPHandler):
167 implements(iwokkel.IDisco) 172 implements(iwokkel.IDisco)
168 173
169 def __init__(self, plugin_parent): 174 def __init__(self, plugin_parent):