diff src/plugins/plugin_xep_0071.py @ 1732:cf11cfc87ef9

xml_tools, plugin XEP-0071, XEP-0277: add method expandNewLinesToXHTML: - \n in XHTML content should not be converted to <br /> by the frontend - save it directly in the Atom payload for better compatibility with other clients
author souliane <souliane@mailoo.org>
date Thu, 10 Dec 2015 14:00:21 +0100
parents 94901070478e
children 6fd0881fe1fc
line wrap: on
line diff
--- a/src/plugins/plugin_xep_0071.py	Thu Dec 10 10:44:04 2015 +0100
+++ b/src/plugins/plugin_xep_0071.py	Thu Dec 10 14:00:21 2015 +0100
@@ -22,6 +22,7 @@
 from sat.core.log import getLogger
 log = getLogger(__name__)
 
+from sat.tools import xml_tools
 from wokkel import disco, iwokkel
 from zope.interface import implements
 # from lxml import etree
@@ -118,6 +119,7 @@
                 raise exceptions.DataError(_("Can't have xhtml and rich content at the same time"))
         if xhtml:
             d = self.synt_plg.clean_xhtml(xhtml)
+            d.addCallback(xml_tools.expandNewLinesToXHTML)
         d.addCallback(syntax_converted)
         return d