diff --git a/src/plugins/plugin_xep_0071.py b/src/plugins/plugin_xep_0071.py index 5f6a78d0..45a307dd 100644 --- a/src/plugins/plugin_xep_0071.py +++ b/src/plugins/plugin_xep_0071.py @@ -22,6 +22,7 @@ from sat.core import exceptions 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 @@ class XEP_0071(object): 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 diff --git a/src/plugins/plugin_xep_0277.py b/src/plugins/plugin_xep_0277.py index 069ce695..56f71ec6 100755 --- a/src/plugins/plugin_xep_0277.py +++ b/src/plugins/plugin_xep_0277.py @@ -180,6 +180,7 @@ class XEP_0277(object): key = check_conflict(u'{}_xhtml'.format(elem.name)) data = data_elt.toXml() microblog_data[key] = yield self.host.plugins["TEXT-SYNTAXES"].clean_xhtml(data) + microblog_data[key] = xml_tools.expandNewLinesToXHTML(microblog_data[key]) else: key = check_conflict(elem.name) microblog_data[key] = unicode(elem) @@ -368,6 +369,7 @@ class XEP_0277(object): raise failure.Failure(exceptions.DataError(_("Can't have xhtml and rich content at the same time"))) else: # clean the XHTML input converted = yield synt.clean_xhtml(data[attr]) + converted = xml_tools.expandNewLinesToXHTML(converted) xml_content = u'