1.1 --- a/xmlparser.py Sat Jan 10 15:11:34 2015 +0100
1.2 +++ b/xmlparser.py Mon Feb 02 15:18:19 2015 +0100
1.3 @@ -139,9 +139,10 @@
1.4
1.5 "Handle content from Confluence 4 page revisions."
1.6
1.7 - def __init__(self, out):
1.8 + def __init__(self, out, is_comment_page=False):
1.9 Parser.__init__(self)
1.10 self.out = out
1.11 + self.is_comment_page = is_comment_page
1.12
1.13 # Link target and label information.
1.14
1.15 @@ -302,6 +303,8 @@
1.16 prefix = link_target_prefixes.get(attrname)
1.17 if prefix:
1.18 target_details.insert(0, prefix)
1.19 + if self.is_comment_page:
1.20 + target_details.insert(0, prefix)
1.21
1.22 # Make a link based on the details.
1.23
1.24 @@ -511,7 +514,7 @@
1.25 def normalise(self, text, name):
1.26 return normalise_regexp.sub(self.get_replacement(name), text)
1.27
1.28 -def parse(s, out):
1.29 +def parse(s, out, is_comment_page=False):
1.30
1.31 "Parse the content in the string 's', writing a translation to 'out'."
1.32
1.33 @@ -530,7 +533,7 @@
1.34
1.35 f = StringIO(s.encode("utf-8"))
1.36 try:
1.37 - parser = ConfluenceXMLParser(out)
1.38 + parser = ConfluenceXMLParser(out, is_comment_page)
1.39 parser.parse(f)
1.40 finally:
1.41 f.close()