changeset 4001:5bb18401738b

fix MoinMoinBugs/GuiEditorIndentStyledText bug
author Byeongweon [tasyblue@gmail.com]
date Fri, 08 Aug 2008 23:15:44 +0900
parents 2fabb1410e10
children ade975944b0d
files MoinMoin/converter/text_html_text_moin_wiki.py
diffstat 1 files changed, 9 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/converter/text_html_text_moin_wiki.py	Fri Aug 08 11:49:24 2008 +0900
+++ b/MoinMoin/converter/text_html_text_moin_wiki.py	Fri Aug 08 23:15:44 2008 +0900
@@ -859,6 +859,9 @@
             self.text.append(" */")
 
     def process_div(self, node):
+        # process indent
+        self._process_indent(node)
+
         # ignore div tags - just descend
         for i in node.childNodes:
             self.visit(i)
@@ -883,6 +886,12 @@
 
     def process_p(self, node):
         # process indent
+        self._process_indent(node)
+        self.process_paragraph_item(node)
+        self.text.append("\n\n") # do not use self.new_line here!
+
+    def _process_indent(self, node):
+        # process indent
         node_style = node.getAttribute("style")
         match = re.match(r"margin-left:\s*(\d+)px", node_style)
         if match:
@@ -891,9 +900,6 @@
             if indent_depth > 0:
                 self.text.append(' . ')
 
-        self.process_paragraph_item(node)
-        self.text.append("\n\n") # do not use self.new_line here!
-
     def process_paragraph_item(self, node):
         for i in node.childNodes:
             if i.nodeType == Node.ELEMENT_NODE: