build pagelinks here

build here, not via moin wrappers, as all links are absolute we can build proper links
This commit is contained in:
Elan Ruusamäe 2012-09-19 23:04:07 +02:00
parent 51ed0143c6
commit 3c561c29ba

View file

@ -33,8 +33,6 @@ class Formatter(FormatterBase):
self.list_depth = 0 self.list_depth = 0
self.list_type = ' ' self.list_type = ' '
# dokuwiki namespace spearator, ':' or '/', see 'useslash' config
self.ns_sep = '/';
def _escape(self, text, extra_mapping={"'": "'", '"': """}): def _escape(self, text, extra_mapping={"'": "'", '"': """}):
return saxutils.escape(text, extra_mapping) return saxutils.escape(text, extra_mapping)
@ -61,10 +59,10 @@ class Formatter(FormatterBase):
return '<html>' + markup + '</html>' return '<html>' + markup + '</html>'
def pagelink(self, on, pagename='', page=None, **kw): def pagelink(self, on, pagename='', page=None, **kw):
apply(FormatterBase.pagelink, (self, on, pagename, page), kw) if on:
if page is None: return '[[:' + ":".join(pagename.split("/")) + "|"
page = Page(self.request, pagename, formatter=self) else:
return page.link_to(self.request, on=on, **kw) return ']]'
def interwikilink(self, on, interwiki='', pagename='', **kw): def interwikilink(self, on, interwiki='', pagename='', **kw):
if on: if on: