changeset 276:9b21b7907167

this should fix MoinMoinBugs/GuiEditorTypeErrorWhenSaving imported from: moin--main--1.5--patch-280
author Thomas Waldmann <tw@waldmann-edv.de>
date Sat, 03 Dec 2005 11:47:16 +0000
parents 8236b972ea7d
children 08778f685aaf
files MoinMoin/converter/text_html_text_x_moin.py
diffstat 1 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/converter/text_html_text_x_moin.py	Fri Dec 02 23:11:44 2005 +0000
+++ b/MoinMoin/converter/text_html_text_x_moin.py	Sat Dec 03 11:47:16 2005 +0000
@@ -502,7 +502,10 @@
                 i += 1
 
     def visit_element(self, node):
-        name = node.localName.lower()
+        name = node.localName
+        if name is None: # not sure this can happen here (DOM comment node), but just for the case
+            return
+        name = name.lower()
         func = getattr(self, "process_" + name,  None)
         if func:
             func(node)
@@ -673,7 +676,9 @@
             self.text.append(node.data.strip('\n'))
             return
 
-        name = node.localName
+        name = node.localName # can be None for DOM Comment nodes
+        if name is None:
+            return
         func = getattr(self, "process_" + name,  None)
         if func:
             func(node)