comparison MoinMoin/formatter/__init__.py @ 2761:3a6a25169f55

use rsplit for splitting off anchor
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sat, 25 Aug 2007 17:42:25 +0200
parents 907b9e60c232
children c9dd12befda7
comparison
equal deleted inserted replaced
2760:d373e273cd7b 2761:3a6a25169f55
9 """ 9 """
10 import re 10 import re
11 11
12 from MoinMoin.util import pysupport 12 from MoinMoin.util import pysupport
13 from MoinMoin import wikiutil 13 from MoinMoin import wikiutil
14 from MoinMoin.support.python_compatibility import rsplit
14 15
15 modules = pysupport.getPackageModules(__file__) 16 modules = pysupport.getPackageModules(__file__)
16 17
17 18
18 class FormatterBase: 19 class FormatterBase:
100 also the text_html formatter. 101 also the text_html formatter.
101 """ 102 """
102 wikitag, wikiurl, wikitail, wikitag_bad = wikiutil.resolve_interwiki(self.request, interwiki, pagename) 103 wikitag, wikiurl, wikitail, wikitag_bad = wikiutil.resolve_interwiki(self.request, interwiki, pagename)
103 if wikitag == 'Self' or wikitag == self.request.cfg.interwikiname: 104 if wikitag == 'Self' or wikitag == self.request.cfg.interwikiname:
104 if '#' in wikitail: 105 if '#' in wikitail:
105 wikitail, kw['anchor'] = wikitail.split('#', 1) 106 wikitail, kw['anchor'] = rsplit(wikitail, '#', 1)
106 wikitail = wikiutil.url_unquote(wikitail) 107 wikitail = wikiutil.url_unquote(wikitail)
107 return self.pagelink(on, wikitail, **kw) 108 return self.pagelink(on, wikitail, **kw)
108 return '' 109 return ''
109 110
110 def url(self, on, url=None, css=None, **kw): 111 def url(self, on, url=None, css=None, **kw):