build pagelinks here
build here, not via moin wrappers, as all links are absolute we can build proper links
This commit is contained in:
parent
51ed0143c6
commit
3c561c29ba
1 changed files with 5 additions and 7 deletions
|
@ -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:
|
||||||
|
@ -73,7 +71,7 @@ class Formatter(FormatterBase):
|
||||||
return ']]'
|
return ']]'
|
||||||
|
|
||||||
def url(self, on, url='', css=None, **kw):
|
def url(self, on, url='', css=None, **kw):
|
||||||
return ('[[%s|' % (self._escape(url)), ']]') [not on]
|
return ('[[%s|' % (self._escape(url)), ']]')[not on]
|
||||||
|
|
||||||
def attachment_link(self, url, text, **kw):
|
def attachment_link(self, url, text, **kw):
|
||||||
return '{{%s|%s}}' % (url, text)
|
return '{{%s|%s}}' % (url, text)
|
||||||
|
|
Loading…
Reference in a new issue