changeset 544:bdaea0dcf3b1

converter: fix table/row/cell style spaces imported from: moin--main--1.5--patch-548
author Thomas Waldmann <tw@waldmann-edv.de>
date Mon, 10 Apr 2006 05:38:31 +0000
parents 2d4d8f7edf1b
children 45a0c47d2749
files ChangeLog MoinMoin/converter/text_html_text_x_moin.py
diffstat 2 files changed, 18 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Mon Apr 10 05:26:33 2006 +0000
+++ b/ChangeLog	Mon Apr 10 05:38:31 2006 +0000
@@ -2,6 +2,20 @@
 # arch-tag: automatic-ChangeLog--arch@arch.thinkmo.de--2003-archives/moin--main--1.5
 #
 
+2006-04-10 06:38:31 GMT	Thomas Waldmann <tw@waldmann-edv.de>	patch-548
+
+    Summary:
+      converter: fix table/row/cell style spaces
+    Revision:
+      moin--main--1.5--patch-548
+
+    converter: fix table/row/cell style spaces
+    
+
+    modified files:
+     ChangeLog MoinMoin/converter/text_html_text_x_moin.py
+
+
 2006-04-10 06:26:33 GMT	Thomas Waldmann <tw@waldmann-edv.de>	patch-547
 
     Summary:
--- a/MoinMoin/converter/text_html_text_x_moin.py	Mon Apr 10 05:26:33 2006 +0000
+++ b/MoinMoin/converter/text_html_text_x_moin.py	Mon Apr 10 05:38:31 2006 +0000
@@ -868,7 +868,7 @@
             result.append('tablestyle="%s"' % node.getAttribute("style"))
         if node.hasAttribute("class"):
             result.append('tableclass="%s"' % node.getAttribute("class"))
-        return " ".join(result)
+        return " ".join(result).strip()
 
     def _row_style(self, node):
         result = []
@@ -884,11 +884,9 @@
                 result.append('rowbgcolor="%s"' % value)
         if node.hasAttribute("style"):
             result.append('rowstyle="%s"' % node.getAttribute("style"))
-        return "".join(result)
+        return " ".join(result).strip()
 
     def _cell_style(self, node):
-        align = ""
-
         if node.hasAttribute("rowspan"):
             rowspan = ("|%s" % node.getAttribute("rowspan"))
         else:
@@ -901,8 +899,8 @@
 
         spanning = rowspan or colspan > 1
         
+        align = ""
         result = []
-
         if  node.hasAttribute("bgcolor"):
             value = node.getAttribute("bgcolor")
             match = re.match(r"rgb\((\d+),\s*(\d+),\s*(\d+)\)", value)
@@ -941,9 +939,7 @@
         if align:
             result[0:0] = "%s" % align
         result.append(rowspan)
-        result = "".join(result)
-        #print result
-        return result
+        return " ".join(result).strip()
 
     def process_table(self, node, style=""):
         self.new_table = True