changeset 1750:6fd0881fe1fc

tools, plugins XEP-0071, XEP-0277: remove recently added expandNewLinesToXHTML, just leave it to the convertors
author souliane <souliane@mailoo.org>
date Tue, 15 Dec 2015 20:29:19 +0100
parents d047535e3ed5
children 77870d2e2902
files src/plugins/plugin_xep_0071.py src/plugins/plugin_xep_0277.py src/tools/xml_tools.py
diffstat 3 files changed, 0 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- 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
 
--- 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'<div xmlns="{ns}">{converted}</div>'.format(
                                         ns=NS_XHTML,
--- 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<br />\n".
-
-    @param text(unicode)
-    @return unicode
-    """
-    return re.sub(r"\n{2,}", "\n<br />\n", text)
-
-
 def decapsulateDomishContent(elt):
     """Return the inner content of a domish.Element.