# HG changeset patch # User souliane # Date 1450207759 -3600 # Node ID 6fd0881fe1fc1a302c78efc060d9e889cd8c6b43 # Parent d047535e3ed5a80d855158ec4f221adc12d112db tools, plugins XEP-0071, XEP-0277: remove recently added expandNewLinesToXHTML, just leave it to the convertors diff -r d047535e3ed5 -r 6fd0881fe1fc src/plugins/plugin_xep_0071.py --- a/src/plugins/plugin_xep_0071.py Tue Dec 15 20:05:27 2015 +0100 +++ b/src/plugins/plugin_xep_0071.py Tue Dec 15 20:29:19 2015 +0100 @@ -119,7 +119,6 @@ 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 -r d047535e3ed5 -r 6fd0881fe1fc src/plugins/plugin_xep_0277.py --- a/src/plugins/plugin_xep_0277.py Tue Dec 15 20:05:27 2015 +0100 +++ b/src/plugins/plugin_xep_0277.py Tue Dec 15 20:29:19 2015 +0100 @@ -372,7 +372,6 @@ 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'
{converted}
'.format( ns=NS_XHTML, diff -r d047535e3ed5 -r 6fd0881fe1fc src/tools/xml_tools.py --- a/src/tools/xml_tools.py Tue Dec 15 20:05:27 2015 +0100 +++ b/src/tools/xml_tools.py Tue Dec 15 20:29:19 2015 +0100 @@ -1355,15 +1355,6 @@ return self.result.firstChildElement() -def expandNewLinesToXHTML(text): - """Replace two or more "\n" with "\n
\n". - - @param text(unicode) - @return unicode - """ - return re.sub(r"\n{2,}", "\n
\n", text) - - def decapsulateDomishContent(elt): """Return the inner content of a domish.Element.