changeset 834:f17ec1d923b3

gui converter: fix attachment links
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Wed, 14 Jun 2006 21:52:37 +0200
parents f6e52d938ba3
children d4dd4fca1477
files MoinMoin/converter/text_html_text_moin_wiki.py MoinMoin/parser/text_moin_wiki.py
diffstat 2 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/converter/text_html_text_moin_wiki.py	Wed Jun 14 21:02:44 2006 +0200
+++ b/MoinMoin/converter/text_html_text_moin_wiki.py	Wed Jun 14 21:52:37 2006 +0200
@@ -1127,11 +1127,11 @@
 
             # Attachments
             if title and title.startswith("attachment:"):
-                url = wikiutil.url_unquote(title[len("attachment:"):])
-                if url != text:
-                    self.text.append('[attachment:"%s" %s]' % (url, text))
+                attname, qattname = pagename_from_url(title[len("attachment:"):])
+                if attname != text:
+                    self.text.append('[attachment:%s %s]' % (qattname, text))
                 else:
-                    self.text.extend([self.white_space, 'attachment:"%s"' % url, self.white_space])
+                    self.text.extend([self.white_space, 'attachment:%s' % qattname, self.white_space])
             # wiki link
             elif href.startswith(scriptname):
                 pagename = href[len(scriptname):]
--- a/MoinMoin/parser/text_moin_wiki.py	Wed Jun 14 21:02:44 2006 +0200
+++ b/MoinMoin/parser/text_moin_wiki.py	Wed Jun 14 21:52:37 2006 +0200
@@ -188,6 +188,8 @@
         _ = self._
         #self.request.log("attachment: target_and_text %s" % target_and_text)
         scheme, fname, text = wikiutil.split_wiki(target_and_text)
+        if not text:
+            text = fname
 
         if scheme == 'drawing':
             return self.formatter.attachment_drawing(fname, text)