changeset 833:f6e52d938ba3

gui converter: use easy markup for links with pagename = linktext
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Wed, 14 Jun 2006 21:02:44 +0200
parents 0710dd481945
children f17ec1d923b3
files MoinMoin/converter/text_html_text_moin_wiki.py
diffstat 1 files changed, 8 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/converter/text_html_text_moin_wiki.py	Wed Jun 14 10:40:55 2006 +0200
+++ b/MoinMoin/converter/text_html_text_moin_wiki.py	Wed Jun 14 21:02:44 2006 +0200
@@ -396,13 +396,13 @@
     """ url is a fragment of an URL we extract the pagename from by URL-unqouting
         and possible adding quotes around the pagename if we detect blanks in it.
     """
-    pagename = wikiutil.url_unquote(url_frag)
+    pagename = qpagename = wikiutil.url_unquote(url_frag)
     if " " in pagename:
         if not '"' in pagename:
-            pagename = '"%s"' % pagename
+            qpagename = '"%s"' % pagename
         elif not "'" in pagename:
-            pagename = "'%s'" % pagename
-    return pagename
+            qpagename = "'%s'" % pagename
+    return pagename, qpagename
 
 class ConvertError(error.FatalError):
     """ Raise when html to wiki conversion fails """
@@ -1100,15 +1100,15 @@
                 wikitag, wikiurl, wikitail, err = wikiutil.resolve_wiki(
                     self.request, title + ":")
                 if not err and href.startswith(wikiurl):
-                    pagename = pagename_from_url(href[len(wikiurl):].lstrip('/'))
-                    interwikiname = "%s:%s" % (wikitag, pagename)
+                    pagename, qpagename = pagename_from_url(href[len(wikiurl):].lstrip('/'))
+                    interwikiname = "%s:%s" % (wikitag, qpagename)
                 else: 
                     raise ConvertError("Invalid InterWiki link: '%s'" % href)
             elif class_ == "badinterwiki" and title:
                 if href == "/": # we used this as replacement for empty href
                     href = ""
-                pagename = pagename_from_url(href)
-                interwikiname = "%s:%s" % (title, pagename)
+                pagename, qpagename = pagename_from_url(href)
+                interwikiname = "%s:%s" % (title, qpagename)
             if interwikiname and pagename == text: 
                 self.text.append("%s" % interwikiname)
                 return