changeset 3975:d8771735a6db

fix 'inline tags replaced by span tag with firefox rich text editor Midas issue'
author Byeongweon [tasyblue@gmail.com]
date Tue, 22 Jul 2008 23:40:38 +0900
parents 0347889df050
children 5a2a710367cb
files MoinMoin/converter/text_html_text_moin_wiki.py
diffstat 1 files changed, 25 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/converter/text_html_text_moin_wiki.py	Mon Jul 21 15:57:56 2008 +0900
+++ b/MoinMoin/converter/text_html_text_moin_wiki.py	Tue Jul 22 23:40:38 2008 +0900
@@ -815,12 +815,34 @@
         self.text.append(command)
 
     def process_span(self, node):
-        # ignore span tags - just descend
-        is_strike = node.getAttribute("class") == "strike"
+        # process span tag for firefox3
+        # see this : http://dev.fckeditor.net/ticket/2210
+
+        node_style = node.getAttribute("style")        
+      
+        is_strike = node.getAttribute("class") == "strike"
+        is_strike = is_strike or node_style.find("line-through") > -1
+        is_strong = node_style.find("bold") > -1
+        is_italic = node_style.find("italic") > -1
+        is_underline = node_style.find("underline") > -1
+        
+        
         if is_strike:
-            self.text.append("--(")
+            self.text.append("--(")
+        if is_strong:
+            self.text.append("'''")
+        if is_italic:
+            self.text.append("''")
+        if is_underline:
+            self.text.append("__")
         for i in node.childNodes:
             self.process_inline(i)
+        if is_underline:
+            self.text.append("__")
+        if is_italic:
+            self.text.append("''")
+        if is_strong:
+            self.text.append("'''")
         if is_strike:
             self.text.append(")--")