changeset 1628:79679aa664a3

formatter: fix empty pagename Page object generation
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sat, 21 Oct 2006 01:50:39 +0200
parents 82e8a6a2eb1b
children 2efb597c14d1
files MoinMoin/formatter/text_html.py
diffstat 1 files changed, 8 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/formatter/text_html.py	Sat Oct 21 01:20:39 2006 +0200
+++ b/MoinMoin/formatter/text_html.py	Sat Oct 21 01:50:39 2006 +0200
@@ -511,16 +511,14 @@
         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 on:
-                if '#' in wikitail:
-                    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 self.pagelink(on, wikiutil.AbsPageName(self.request, self.page.page_name, wikitail), **kw)
-                except:
-                    return self.pagelink(on, wikitail, **kw)
-            else:
-                return self.pagelink(0)
+            if '#' in wikitail:
+                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!
+                pagename = wikiutil.AbsPageName(self.request, self.page.page_name, wikitail)
+            except:
+                pagename = wikitail
+            return self.pagelink(on, pagename, **kw)
         else: # return InterWiki hyperlink
             if on:
                 href = wikiutil.join_wiki(wikiurl, wikitail)