diff --git a/src/tools/xml_tools.py b/src/tools/xml_tools.py index ac2bf35c..dafc2507 100644 --- a/src/tools/xml_tools.py +++ b/src/tools/xml_tools.py @@ -1354,13 +1354,12 @@ class ElementParser(object): def expandNewLinesToXHTML(text): - """If not present yet, add a
before all \n occurences. + """Replace two or more "\n" with "\n
\n". @param text(unicode) @return unicode """ - # if present, replace
(HTML),
and
at end of line with
(XHTML) - return re.sub(r"\n", "\n", text).replace("\n", "
\n") + return re.sub(r"\n{2,}", "\n
\n", text) def decapsulateDomishContent(elt):