changeset 2782:4c7a5994fe34

gui editor converter: convert <object>, needs more work
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Tue, 28 Aug 2007 14:40:29 +0200
parents 5507fdc7fe87
children aec29d51f04b
files MoinMoin/converter/text_html_text_moin_wiki.py
diffstat 1 files changed, 16 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/converter/text_html_text_moin_wiki.py	Tue Aug 28 14:15:07 2007 +0200
+++ b/MoinMoin/converter/text_html_text_moin_wiki.py	Tue Aug 28 14:40:29 2007 +0200
@@ -1232,6 +1232,22 @@
         else:
             raise ConvertError("Strange image src: '%s' alt == '%r'" % (src, alt))
 
+    def process_object(self, node):
+        data = None
+        if node.attributes.has_key("data"):
+            data = wikiutil.url_unquote(node.attributes.get("data").nodeValue)
+
+        text = self.node_list_text_only(node.childNodes)
+        text = text.replace("\n", " ").lstrip()
+
+        if data:
+            if text:
+                text = '|' + text
+            self.text.append("{{%s%s}}" % (data, text))
+        # TODO: for target PAGES, use some code from process_a to get the pagename from URL
+        # TODO: roundtrip attachment: correctly
+        # TODO: handle object's content better?
+
 
 def parse(request, text):
     text = u'<?xml version="1.0"?>%s%s' % (dtd, text)