diff MoinMoin/formatter/text_html.py @ 569:6c572f52899f

fixed missing </a> formatter bug imported from: moin--main--1.5--patch-573
author Thomas Waldmann <tw@waldmann-edv.de>
date Sat, 15 Apr 2006 18:35:41 +0000
parents dde3d1b2a9d4
children da3a8a125fdb
line wrap: on
line diff
--- a/MoinMoin/formatter/text_html.py	Sat Apr 15 15:46:23 2006 +0000
+++ b/MoinMoin/formatter/text_html.py	Sat Apr 15 18:35:41 2006 +0000
@@ -502,26 +502,30 @@
         """
         @keyword title: override using the interwiki wikiname as title
         """
-        if not on:
-            return self.url(0)
         wikitag, wikiurl, wikitail, wikitag_bad = wikiutil.resolve_wiki(self.request, '%s:%s' % (interwiki, pagename))
         wikiurl = wikiutil.mapURL(self.request, wikiurl)
         if wikitag == 'Self': # for own wiki, do simple links
-            if wikitail.find('#') > -1:
-                wikitail, kw['anchor'] = wikitail.split('#', 1)
-            wikitail = wikiutil.url_unquote(wikitail)
-            try: # XXX this is the only place where we access self.page - do we need it? Crashes silently on actions!
-                return apply(self.pagelink, (on, wikiutil.AbsPageName(self.request, self.page.page_name, wikitail)), kw)
-            except:
-                return apply(self.pagelink, (on, wikitail), kw)
+            if on:
+                if wikitail.find('#') > -1:
+                    wikitail, kw['anchor'] = wikitail.split('#', 1)
+                wikitail = wikiutil.url_unquote(wikitail)
+                try: # XXX this is the only place where we access self.page - do we need it? Crashes silently on actions!
+                    return apply(self.pagelink, (on, wikiutil.AbsPageName(self.request, self.page.page_name, wikitail)), kw)
+                except:
+                    return apply(self.pagelink, (on, wikitail), kw)
+            else:
+                return self.pagelink(0)
         else: # return InterWiki hyperlink
-            href = wikiutil.join_wiki(wikiurl, wikitail)
-            if wikitag_bad:
-                html_class = 'badinterwiki'
+            if on:
+                href = wikiutil.join_wiki(wikiurl, wikitail)
+                if wikitag_bad:
+                    html_class = 'badinterwiki'
+                else:
+                    html_class = 'interwiki'
+                title = kw.get('title', wikitag)
+                return self.url(1, href, title=title, do_escape=1, css=html_class) # interwiki links with umlauts
             else:
-                html_class = 'interwiki'
-            title = kw.get('title', wikitag)
-            return self.url(1, href, title=title, do_escape=1, css=html_class) # interwiki links with umlauts
+                return self.url(0)
 
     def url(self, on, url=None, css=None, do_escape=0, **kw):
         """