changeset 3984:f57069f6b187

fix indent problem on gui editor. p tag with left-margin style can indent
author Byeongweon [tasyblue@gmail.com]
date Mon, 28 Jul 2008 03:53:05 +0900
parents 45d71759f13b
children 491cf04e8c88
files MoinMoin/converter/text_html_text_moin_wiki.py
diffstat 1 files changed, 10 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/converter/text_html_text_moin_wiki.py	Mon Jul 28 01:34:03 2008 +0900
+++ b/MoinMoin/converter/text_html_text_moin_wiki.py	Mon Jul 28 03:53:05 2008 +0900
@@ -869,7 +869,16 @@
             length = 4
         self.text.extend([self.new_line, "-" * length, self.new_line])
 
-    def process_p(self, node):
+    def process_p(self, node):
+        # process indent
+        node_style = node.getAttribute("style")
+        match = re.match(r"margin-left:\s*(\d+)px", node_style)
+        if match:
+            left_margin = int(match.group(1))
+            indent_depth = int(left_margin / 40)
+            if indent_depth > 0:
+                self.text.append(' . ')
+            
         self.process_paragraph_item(node)
         self.text.append("\n\n") # do not use self.new_line here!