changeset 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 ab9620029aa8
children a25db3fe3959
files src/plugins/plugin_xep_0071.py
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/plugins/plugin_xep_0071.py	Wed Nov 13 14:01:13 2013 +0100
+++ b/src/plugins/plugin_xep_0071.py	Wed Nov 13 14:02:02 2013 +0100
@@ -160,8 +160,13 @@
                 elem.drop_tree()
             else:
                 elem.drop_tag()
+        if len(body_elt) !=1:
+            root_elt = body_elt
+            body_elt.tag = "p"
+        else:
+            root_elt = body_elt[0]
 
-        return html.tostring(body_elt, encoding='unicode', method='xml')
+        return html.tostring(root_elt, encoding='unicode', method='xml')
 
 class XEP_0071_handler(XMPPHandler):
     implements(iwokkel.IDisco)