comparison MoinMoin/converter/text_html_text_moin_wiki.py @ 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 2bbf611f4f2c
children 167c6efea1de
comparison
equal deleted inserted replaced
2781:5507fdc7fe87 2782:4c7a5994fe34
1230 elif src and src.startswith("http") and wikiutil.isPicture(src): # matches http: and https: ! 1230 elif src and src.startswith("http") and wikiutil.isPicture(src): # matches http: and https: !
1231 self.text.extend([self.white_space, "{{%s}}" % src, self.white_space]) 1231 self.text.extend([self.white_space, "{{%s}}" % src, self.white_space])
1232 else: 1232 else:
1233 raise ConvertError("Strange image src: '%s' alt == '%r'" % (src, alt)) 1233 raise ConvertError("Strange image src: '%s' alt == '%r'" % (src, alt))
1234 1234
1235 def process_object(self, node):
1236 data = None
1237 if node.attributes.has_key("data"):
1238 data = wikiutil.url_unquote(node.attributes.get("data").nodeValue)
1239
1240 text = self.node_list_text_only(node.childNodes)
1241 text = text.replace("\n", " ").lstrip()
1242
1243 if data:
1244 if text:
1245 text = '|' + text
1246 self.text.append("{{%s%s}}" % (data, text))
1247 # TODO: for target PAGES, use some code from process_a to get the pagename from URL
1248 # TODO: roundtrip attachment: correctly
1249 # TODO: handle object's content better?
1250
1235 1251
1236 def parse(request, text): 1252 def parse(request, text):
1237 text = u'<?xml version="1.0"?>%s%s' % (dtd, text) 1253 text = u'<?xml version="1.0"?>%s%s' % (dtd, text)
1238 text = text.encode(config.charset) 1254 text = text.encode(config.charset)
1239 try: 1255 try: