changeset 147:22bf3aa88bc7

fixed MoinMoinBugs/BracketURLwithAnchorParsedAndLinkedWrong imported from: moin--main--1.5--patch-149
author Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
date Fri, 28 Oct 2005 06:34:52 +0000
parents 27c541f45422
children 4a64816584ae
files MoinMoin/parser/wiki.py
diffstat 1 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/parser/wiki.py	Thu Oct 27 15:51:44 2005 +0000
+++ b/MoinMoin/parser/wiki.py	Fri Oct 28 06:34:52 2005 +0000
@@ -338,7 +338,14 @@
             text = word
         if word.startswith(wikiutil.CHILD_PREFIX):
             word = self.formatter.page.page_name + '/' + word[wikiutil.CHILD_PREFIX_LEN:]
-        return (self.formatter.pagelink(1, word) +
+
+        # handle anchors
+        parts = word.split("#", 1)
+        anchor = ""
+        if len(parts)==2:
+            word, anchor = parts
+            
+        return (self.formatter.pagelink(1, word, anchor=anchor) +
                 self.formatter.text(text) +
                 self.formatter.pagelink(0, word))