1.1 --- a/TO_DO.txt Wed Apr 10 00:59:29 2013 +0200
1.2 +++ b/TO_DO.txt Wed Apr 10 16:22:38 2013 +0200
1.3 @@ -33,17 +33,8 @@
1.4
1.5 wiki.list.org link recognition
1.6
1.7 - Null links in XHTML (Section 6.1: How do I get my password?)
1.8 -
1.9 - Improperly terminated links: http://WEBSERVER/mailman/listinfo/LISTNAME)<<BR>>
1.10 -
1.11 Table formatting in section 9.1 (also incorrect in the Confluence markup version)
1.12
1.13 -COM/Mailman consulting services (4489296)
1.14 -
1.15 - Improperly terminated link: http://www.linagora.com<<BR>>
1.16 - Need to separate URLs from surrounding text
1.17 -
1.18 Make redirect pages so that COM redirects to COM/Home, and so on.
1.19
1.20 Comment ownership and presentation.
2.1 --- a/xmlparser.py Wed Apr 10 00:59:29 2013 +0200
2.2 +++ b/xmlparser.py Wed Apr 10 16:22:38 2013 +0200
2.3 @@ -58,6 +58,7 @@
2.4 "ul" : "%s",
2.5 "ac:link" : "[[%s%s|%s]]",
2.6 "ac:image" : "{{%s%s|%s}}",
2.7 + "a" : "[[%s|%s]]",
2.8 }
2.9
2.10 for tag, translation in blocktypes.items():
2.11 @@ -258,6 +259,13 @@
2.12 self.label = text
2.13 text = ""
2.14
2.15 + # For conventional links, remember the href attribute as the target.
2.16 +
2.17 + elif name == "a":
2.18 + self.target = self.attributes[-1].get("href")
2.19 + self.label = text
2.20 + text = ""
2.21 +
2.22 # Discard macro state.
2.23
2.24 elif name == "ac:macro":
2.25 @@ -301,9 +309,9 @@
2.26 else:
2.27 conversion = "%s%%s%s" % (opening, closing)
2.28
2.29 - # Handle the common case.
2.30 + # Handle the common case and simpler special cases.
2.31
2.32 - else:
2.33 + if not conversion:
2.34 conversion = tags.get(name)
2.35
2.36 # Attempt to convert the text.
2.37 @@ -316,6 +324,10 @@
2.38 text = conversion % (prefix, anchor or self.target, self.label or text or self.target)
2.39 self.target = self.target_type = self.label = None
2.40
2.41 + elif name == "a":
2.42 + text = conversion % (self.target, self.label)
2.43 + self.target = self.target_type = self.label = None
2.44 +
2.45 # Handle the common case.
2.46
2.47 elif text and conversion: