changeset 829:77ad89f9f1bf

fix image urls
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 11 Jun 2006 19:48:40 +0200
parents 902c34d95085
children e9e09bf11c82
files MoinMoin/parser/text_moin_wiki.py
diffstat 1 files changed, 9 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/parser/text_moin_wiki.py	Sun Jun 11 17:48:25 2006 +0200
+++ b/MoinMoin/parser/text_moin_wiki.py	Sun Jun 11 19:48:40 2006 +0200
@@ -399,19 +399,20 @@
             if len(words) == 1:
                 words = words * 2
 
-            if words[0][0] == '#':
-                # anchor link
+            if words[0].startswith('#'): # anchor link
                 return (self.formatter.url(1, words[0]) +
                         self.formatter.text(words[1]) +
                         self.formatter.url(0))
-            raise "what is triggering this?"
         else:
             scheme, rest = scheme_and_rest
-
-        if scheme == "wiki":
-            return self.interwiki(word, pretty_url=1)
-        if scheme in self.attachment_schemas:
-            return self.attachment(word, pretty_url=1)
+            if scheme == "wiki":
+                return self.interwiki(word, pretty_url=1)
+            if scheme in self.attachment_schemas:
+                return self.attachment(word, pretty_url=1)
+            
+            words = word.split(None, 1)
+            if len(words) == 1:
+                words = words * 2
 
         if wikiutil.isPicture(words[1]) and re.match(self.url_rule, words[1]):
             return (self.formatter.url(1, words[0], css='external', do_escape=0) +