changeset 1058:91e8f75b006b

Fixed handling of anchors in the rst parser.
author Alexander Schremmer <alex AT alexanderweb DOT de>
date Tue, 25 Jul 2006 22:58:54 +0200
parents 61142a50c41b
children 0d32e92fbfe1
files MoinMoin/parser/text_rst.py docs/CHANGES
diffstat 2 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/parser/text_rst.py	Tue Jul 25 00:55:19 2006 +0200
+++ b/MoinMoin/parser/text_rst.py	Tue Jul 25 22:58:54 2006 +0200
@@ -381,8 +381,13 @@
                     node['classes'].append(prefix)
             else:
                 # Default case - make a link to a wiki page.
-                page = Page(self.request, refuri)
-                node['refuri'] = page.url(self.request)
+                pagename = refuri
+                anchor = ''
+                if refuri.find('#') != -1:
+                    pagename, anchor = refuri.split('#', 1)
+                    anchor = '#' + anchor
+                page = MoinMoin.Page.Page(self.request, pagename)
+                node['refuri'] = page.url(self.request) + anchor
                 if not page.exists():
                     node['classes'].append('nonexistent')
         html4css1.HTMLTranslator.visit_reference(self, node)
--- a/docs/CHANGES	Tue Jul 25 00:55:19 2006 +0200
+++ b/docs/CHANGES	Tue Jul 25 22:58:54 2006 +0200
@@ -186,6 +186,7 @@
     * Added a (less broken) MoinMoin.support.difflib, details see there.
     * BadContent and LocalBadContent now get noindex,nofollow robots header,
       same as POSTs.
+    * Fixed handling of anchors in wiki links for the Restructured text parser.
 
   Other changes:
     * we use (again) the same browser compatibility check as FCKeditor uses