comparison src/tools/xml_tools.py @ 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 681fe91abcc0
children d17772b0fe22
comparison
equal deleted inserted replaced
1749:d047535e3ed5 1750:6fd0881fe1fc
1353 tmp.addRawXml(raw_xml) 1353 tmp.addRawXml(raw_xml)
1354 parser.parse(tmp.toXml().encode('utf-8')) 1354 parser.parse(tmp.toXml().encode('utf-8'))
1355 return self.result.firstChildElement() 1355 return self.result.firstChildElement()
1356 1356
1357 1357
1358 def expandNewLinesToXHTML(text):
1359 """Replace two or more "\n" with "\n<br />\n".
1360
1361 @param text(unicode)
1362 @return unicode
1363 """
1364 return re.sub(r"\n{2,}", "\n<br />\n", text)
1365
1366
1367 def decapsulateDomishContent(elt): 1358 def decapsulateDomishContent(elt):
1368 """Return the inner content of a domish.Element. 1359 """Return the inner content of a domish.Element.
1369 1360
1370 @param elt (domish.Element) 1361 @param elt (domish.Element)
1371 @return unicode 1362 @return unicode