changeset 2908:0bc6871c65de

text_html_text_moin_wiki.process_inline: linebreaks as <<BR>> and not \n
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Sun, 28 Oct 2007 18:47:48 +0100
parents 1cf088f06286
children c39426a679b4
files MoinMoin/converter/text_html_text_moin_wiki.py
diffstat 1 files changed, 11 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/converter/text_html_text_moin_wiki.py	Sun Oct 28 09:38:35 2007 +0100
+++ b/MoinMoin/converter/text_html_text_moin_wiki.py	Sun Oct 28 18:47:48 2007 +0100
@@ -799,9 +799,17 @@
 
         self.text.append(command)
         for i in node.childNodes:
-            # formatted br is not wanted
-            if command and i.localName != 'br':
-                self.process_inline(i)
+            # lonly childnodes checked if they are only 'br'
+            if command and len(node.childNodes) == 1:
+                # formatted br alone is not wanted (who wants a bold br?)
+                if i.localName != 'br':
+                    self.process_inline(i)
+            else:
+                if i.localName == 'br':
+                    # dont make a real \n because that breaks tables
+                    self.text.append('<<BR>>')
+                else:
+                    self.process_inline(i)
         if command_close:
             command = command_close
         self.text.append(command)