changeset 4037:e5a5b2797a6a

fix image resize by gui editor doesn't applied problem
author Byeongweon [tasyblue@gmail.com]
date Thu, 21 Aug 2008 16:34:39 +0900
parents 24ef81d2b5f0
children 5467ef800d48
files MoinMoin/converter/text_html_text_moin_wiki.py
diffstat 1 files changed, 11 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/converter/text_html_text_moin_wiki.py	Tue Aug 19 19:00:33 2008 +0200
+++ b/MoinMoin/converter/text_html_text_moin_wiki.py	Thu Aug 21 16:34:39 2008 +0900
@@ -1306,6 +1306,7 @@
 
     def _process_img(self, node):
         attrs = get_attrs(node)
+        print attrs
 
         title = attrs.pop('title', '')
         if title.startswith("smiley:"):
@@ -1380,7 +1381,16 @@
     """ get the attributes of <node> into an easy-to-use dict """
     attrs = {}
     for attr_name in node.attributes.keys():
-        attrs[attr_name] = node.attributes.get(attr_name).nodeValue
+        # get attributes of style element
+        if attr_name == "style":
+            for style_element in node.attributes.get(attr_name).nodeValue.split(';'):
+                if style_element.strip() != '':
+                    style_elements = style_element.split(':')
+                    if len(style_elements) == 2:
+                        attrs[style_elements[0].strip()] = style_elements[1].strip()
+        # get attributes without style element
+        else:
+            attrs[attr_name] = node.attributes.get(attr_name).nodeValue
     return attrs