1.1 --- a/xmlparser.py Sat Mar 02 19:56:23 2013 +0100
1.2 +++ b/xmlparser.py Sun Mar 03 00:42:13 2013 +0100
1.3 @@ -59,6 +59,7 @@
1.4 "ul" : "%s",
1.5 "ac:plain-text-body" : "{{{%s}}}",
1.6 "ac:link" : "[[%s%s|%s]]",
1.7 + "ac:image" : "{{%s%s|%s}}",
1.8 }
1.9
1.10 for tag, translation in blocktypes.items():
1.11 @@ -154,7 +155,7 @@
1.12 # Parser-related methods.
1.13
1.14 def handleElement(self, name):
1.15 - text = "".join(self.text[-1]).strip()
1.16 + text = "".join(self.text[-1])
1.17
1.18 # Handle state.
1.19
1.20 @@ -199,7 +200,7 @@
1.21 # Links require target information.
1.22 # NOTE: User links should support the intended user namespace prefix.
1.23
1.24 - if name == "ac:link":
1.25 + if name in ("ac:link", "ac:image"):
1.26 if self.target_type == "ri:attachment":
1.27 prefix = "attachment:"
1.28 elif self.target_type == "ri:user":
1.29 @@ -254,7 +255,7 @@
1.30 nodes.append("\n\n")
1.31 elif list_tags.has_key(parent):
1.32 nodes.append("\n")
1.33 - elif list_tags.has_key(name) and parent == "li":
1.34 + elif list_tags.has_key(name):
1.35 nodes.append("\n")
1.36 nodes.append(text)
1.37
1.38 @@ -269,7 +270,7 @@
1.39 # Whitespace normalisation.
1.40
1.41 def get_replacement(self, name):
1.42 - if name in ("html", "body") or list_tags.has_key(name):
1.43 + if name in ("html", "body", "table", "tbody", "tr") or list_tags.has_key(name):
1.44 return ""
1.45 else:
1.46 return " "