diff MoinMoin/parser/text_rst.py @ 4493:af211e2f132c

moved anchor parsing from formatter to parsers, fixed anchor parsing for interwiki links, reduce code duplication by new wikiutil.split_anchor()
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 18 Jan 2009 12:54:18 +0100
parents 951ed1df8ec3
children b631aca46a48
line wrap: on
line diff
--- a/MoinMoin/parser/text_rst.py	Fri Jan 16 12:55:57 2009 +0100
+++ b/MoinMoin/parser/text_rst.py	Sun Jan 18 12:54:18 2009 +0100
@@ -20,7 +20,6 @@
 from MoinMoin.Page import Page
 from MoinMoin.action import AttachFile
 from MoinMoin import wikiutil
-from MoinMoin.support.python_compatibility import rsplit
 
 Dependencies = [] # this parser just depends on the raw text
 
@@ -400,10 +399,7 @@
                     node['classes'].append(prefix)
             else:
                 # Default case - make a link to a wiki page.
-                pagename = refuri
-                anchor = ''
-                if '#' in refuri:
-                    pagename, anchor = rsplit(refuri, '#', 1)
+                pagename, anchor = wikiutil.split_anchor(refuri)
                 page = Page(self.request, wikiutil.AbsPageName(self.formatter.page.page_name, pagename))
                 node['refuri'] = page.url(self.request, anchor=anchor)
                 if not page.exists():