changeset 96:5b9e216fa00d

fixed [:page:text] or [wiki:Self:page text] links updating the pagelinks cache imported from: moin--main--1.5--patch-98
author Thomas Waldmann <tw@waldmann-edv.de>
date Sat, 08 Oct 2005 15:37:24 +0000
parents a560e3ddc902
children 539cfd9a40b2
files MoinMoin/parser/wiki.py docs/CHANGES
diffstat 2 files changed, 15 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/parser/wiki.py	Sat Oct 08 14:38:31 2005 +0000
+++ b/MoinMoin/parser/wiki.py	Sat Oct 08 15:37:24 2005 +0000
@@ -155,7 +155,16 @@
         else:
             url, text = url_and_text
 
-        url = url[5:] # remove "wiki:"
+        # keep track of whether this is a self-reference, so links
+        # are always shown even the page doesn't exist.
+        is_self_reference = 0
+        url2 = url.lower()
+        if url2.startswith('wiki:self:'):
+            url = url[10:] # remove "wiki:self:"
+            is_self_reference = 1
+        elif url2.startswith('wiki:'):
+            url = url[5:] # remove "wiki:"
+           
         tag, tail = wikiutil.split_wiki(url)
         if text is None:
             if tag:
@@ -163,11 +172,9 @@
             else:
                 text = url
                 url = ""
-        elif url.startswith(wikiutil.CHILD_PREFIX):
-            # fancy link to subpage [wiki:/SubPage text]
-            return self._word_repl(url, text)
-        elif Page(self.request, url).exists():
-            # fancy link to local page [wiki:LocalPage text]
+        elif (url.startswith(wikiutil.CHILD_PREFIX) or # fancy link to subpage [wiki:/SubPage text]
+              is_self_reference or # [wiki:Self:LocalPage text] or [:LocalPage:text]
+              Page(self.request, url).exists()): # fancy link to local page [wiki:LocalPage text]
             return self._word_repl(url, text)
 
         wikitag, wikiurl, wikitail, wikitag_bad = wikiutil.resolve_wiki(self.request, url)
--- a/docs/CHANGES	Sat Oct 08 14:38:31 2005 +0000
+++ b/docs/CHANGES	Sat Oct 08 15:37:24 2005 +0000
@@ -234,6 +234,8 @@
     * Fix chart action, returns a page with error message when chart
       can not be created.
     * Fixed formatter usage in the ShowSmileys macro.
+    * Fixed updating pagelinks cache for [:page:text] or [wiki:Self:page text],
+      fixes display of LocalSiteMap and rendering of such links.
     
     
 Version 1.4: