changeset 1700:c54be3afb830

gui editor converter: indenting fixes, code simplification
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Thu, 21 Dec 2006 03:39:28 +0100
parents 7c58e8af1a97
children 3c6f59cafbbe
files MoinMoin/converter/text_html_text_moin_wiki.py
diffstat 1 files changed, 5 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/converter/text_html_text_moin_wiki.py	Thu Dec 07 21:35:43 2006 +0100
+++ b/MoinMoin/converter/text_html_text_moin_wiki.py	Thu Dec 21 03:39:28 2006 +0100
@@ -554,8 +554,8 @@
             #    self.text.append("\n")
 
     def process_br(self, node):
-            self.text.append(self.new_line) # without this, std multi-line text below some heading misses a whitespace
-                                            # when it gets merged to float text, like word word wordword word word
+        self.text.append(self.new_line) # without this, std multi-line text below some heading misses a whitespace
+                                        # when it gets merged to float text, like word word wordword word word
 
     def process_heading(self, node):
         text = self.node_list_text_only(node.childNodes).strip()
@@ -740,6 +740,7 @@
             self.text.append(node.data.strip('\n').replace('\n', ' '))
             return
 
+        # do we need to check for Node.ELEMENT_NODE and return (do nothing)?
         name = node.localName # can be None for DOM Comment nodes
         if name is None:
             return
@@ -781,10 +782,7 @@
 
         self.text.append(command)
         for i in node.childNodes:
-            if i.nodeType == Node.ELEMENT_NODE:
-                self.process_inline(i)
-            elif i.nodeType == Node.TEXT_NODE:
-                self.text.append(i.data.strip('\n').replace('\n', ' '))
+            self.process_inline(i)
         if command_close:
             command = command_close
         self.text.append(command)
@@ -1097,7 +1095,7 @@
             text = self.node_list_text_only(node.childNodes)
             text = text.replace("\n", " ").lstrip()
 
-             # interwiki link
+            # interwiki link
             if class_ == "interwiki":
                 wikitag, wikiurl, wikitail, err = wikiutil.resolve_wiki(
                     self.request, title + ":")