changeset 410:1a2bd0457cf3

fix some wrong attributes, todo: fix quoting, see comment in text_html.url imported from: moin--main--1.5--patch-414
author Thomas Waldmann <tw@waldmann-edv.de>
date Fri, 03 Feb 2006 19:15:18 +0000
parents e0c7b89190ed
children 6e2114f8e942
files ChangeLog MoinMoin/formatter/text_gedit.py MoinMoin/formatter/text_html.py MoinMoin/parser/wiki.py MoinMoin/userform.py MoinMoin/wikimacro.py
diffstat 6 files changed, 35 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Fri Feb 03 18:42:04 2006 +0000
+++ b/ChangeLog	Fri Feb 03 19:15:18 2006 +0000
@@ -2,6 +2,22 @@
 # arch-tag: automatic-ChangeLog--arch@arch.thinkmo.de--2003-archives/moin--main--1.5
 #
 
+2006-02-03 20:15:18 GMT	Thomas Waldmann <tw@waldmann-edv.de>	patch-414
+
+    Summary:
+      fix some wrong attributes, todo: fix quoting, see comment in text_html.url
+    Revision:
+      moin--main--1.5--patch-414
+
+    fix some wrong attributes, todo: fix quoting, see comment in text_html.url
+    
+
+    modified files:
+     ChangeLog MoinMoin/formatter/text_gedit.py
+     MoinMoin/formatter/text_html.py MoinMoin/parser/wiki.py
+     MoinMoin/userform.py MoinMoin/wikimacro.py
+
+
 2006-02-03 19:42:04 GMT	Thomas Waldmann <tw@waldmann-edv.de>	patch-413
 
     Summary:
--- a/MoinMoin/formatter/text_gedit.py	Fri Feb 03 18:42:04 2006 +0000
+++ b/MoinMoin/formatter/text_gedit.py	Fri Feb 03 19:15:18 2006 +0000
@@ -57,8 +57,7 @@
         html_class = 'badinterwiki' # we use badinterwiki in any case to simplify reverse conversion
         href = wikiutil.quoteWikinameURL(pagename)
         title = kw.get('title', interwiki)
-        return self.url(1, href, title=title, unescaped=0, css=html_class)
-        # unescaped=1 was changed to 0 to make interwiki links with pages with umlauts (or other non-ascii) work
+        return self.url(1, href, title=title, do_escape=1, css=html_class) # interwiki links with pages with umlauts
 
     def attachment_inlined(self, url, text, **kw):
         if url == text:
--- a/MoinMoin/formatter/text_html.py	Fri Feb 03 18:42:04 2006 +0000
+++ b/MoinMoin/formatter/text_html.py	Fri Feb 03 19:15:18 2006 +0000
@@ -519,15 +519,16 @@
             else:
                 html_class = 'interwiki'
             title = kw.get('title', wikitag)
-            return self.url(1, href, title=title, unescaped=0, css=html_class)
-            # unescaped=1 was changed to 0 to make interwiki links with pages with umlauts (or other non-ascii) work
+            return self.url(1, href, title=title, do_escape=1, css=html_class) # interwiki links with umlauts
 
-    def url(self, on, url=None, css=None, **kw):
+    def url(self, on, url=None, css=None, do_escape=0, **kw):
         """ Inserts an <a> element.
 
             Call once with on=1 to start the link, and again with on=0
             to end it (no other arguments are needed when on==0).
 
+            do_escape: XXX doesn't work yet
+
             Keyword params:
                 url - the URL to link to; will go through Wiki URL mapping.
                 css - a space-separated list of CSS classes
@@ -549,6 +550,11 @@
             del kw['href']
         if url is not None:
             url = wikiutil.mapURL(self.request, url)
+            
+            # TODO just calling url_quote does not work, as it will also quote "http:" to "http%xx" X)
+            if 0: # do_escape: # protocol and server part must not get quoted, path should get quoted
+                url = wikiutil.url_quote(url)
+            
             attrs['href'] = url
 
         if css:
@@ -719,12 +725,12 @@
                     src=AttachFile.getAttachUrl(
                     pagename, filename, self.request,
                     addts=1),
-                    usemap='#'+mapid, html_class="drawing"))
+                    usemap='#'+mapid, css="drawing"))
         else:
             return wikiutil.link_tag(self.request,
                                      edit_link,
                                      self.image(alt=url,
-                                                src=AttachFile.getAttachUrl(pagename, filename, self.request, addts=1), html_class="drawing"),
+                                                src=AttachFile.getAttachUrl(pagename, filename, self.request, addts=1), css="drawing"),
                                      attrs='title="%s"' % (_('Edit drawing %(filename)s') % {'filename': self.text(fname)}))
         
     
@@ -1215,10 +1221,10 @@
             result = ("%s%s%s%s%s%s%s%s" %
                       (result,
                        kw.get('icons', ''),
-                       self.url(1, "#bottom", unescaped=1),
+                       self.url(1, "#bottom", do_escape=0),
                        self.icon('bottom'),
                        self.url(0),
-                       self.url(1, "#top", unescaped=1),
+                       self.url(1, "#top", do_escape=0),
                        self.icon('top'),
                        self.url(0)))
         return "%s%s%s" % (result, kw.get('icons', ''), number)
--- a/MoinMoin/parser/wiki.py	Fri Feb 03 18:42:04 2006 +0000
+++ b/MoinMoin/parser/wiki.py	Fri Feb 03 19:15:18 2006 +0000
@@ -428,11 +428,11 @@
             return self.attachment(words, pretty_url=1)
 
         if wikiutil.isPicture(words[1]) and re.match(self.url_rule, words[1]):
-            return (self.formatter.url(1, words[0], css='external', unescaped=1) +
+            return (self.formatter.url(1, words[0], css='external', do_escape=0) +
                     self.formatter.image(title=words[0], alt=words[0], src=words[1]) +
                     self.formatter.url(0))
         else:
-            return (self.formatter.url(1, words[0], css=scheme, unescaped=1) +
+            return (self.formatter.url(1, words[0], css=scheme, do_escape=0) +
                     self.formatter.text(words[1]) +
                     self.formatter.url(0))
 
--- a/MoinMoin/userform.py	Fri Feb 03 18:42:04 2006 +0000
+++ b/MoinMoin/userform.py	Fri Feb 03 19:15:18 2006 +0000
@@ -606,7 +606,7 @@
         data.addRow((
             #request.formatter.code(1) + uid + request.formatter.code(0),
             request.formatter.rawHTML(namelink),
-            (request.formatter.url(1, 'mailto:' + account.email, css='mailto', unescaped=1) +
+            (request.formatter.url(1, 'mailto:' + account.email, css='mailto', do_escape=0) +
              request.formatter.text(account.email) +
              request.formatter.url(0)),
             request.page.link_to(request, text=_('Mail me my account data'),
--- a/MoinMoin/wikimacro.py	Fri Feb 03 18:42:04 2006 +0000
+++ b/MoinMoin/wikimacro.py	Fri Feb 03 19:15:18 2006 +0000
@@ -310,7 +310,7 @@
         if 0: # if wikixml.ok: # XXX currently switched off (not implemented)
             from MoinMoin import wikixml
             index = (index + self.formatter.url(1, 
-                wikiutil.quoteWikinameURL(self.formatter.page.page_name) + "?action=rss_ti", unescaped=1) +
+                wikiutil.quoteWikinameURL(self.formatter.page.page_name) + "?action=rss_ti", do_escape=0) +
                      self.formatter.icon("rss") +
                      self.formatter.url(0))
 
@@ -567,7 +567,7 @@
         if self.request.user.valid:
             # decode address and generate mailto: link
             email = decodeSpamSafeEmail(email)
-            result = (self.formatter.url(1, 'mailto:' + email, css='mailto', unescaped=1) +
+            result = (self.formatter.url(1, 'mailto:' + email, css='mailto', do_escape=0) +
                       self.formatter.text(text or email) +
                       self.formatter.url(0))
         else: