changeset 3257:7beffeb2e41f

moin wiki parser: fix escaping of attributes (the formatter does it!)
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Fri, 14 Mar 2008 17:07:02 +0100
parents 584d6376c465
children 1ff7cb6c381b
files MoinMoin/parser/text_moin_wiki.py
diffstat 1 files changed, 4 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/parser/text_moin_wiki.py	Fri Mar 14 15:57:02 2008 +0100
+++ b/MoinMoin/parser/text_moin_wiki.py	Fri Mar 14 17:07:02 2008 +0100
@@ -655,12 +655,10 @@
             if acceptable_attrs is None:
                 acceptable_attrs = []
             for key, val in kw.items():
-                key = str(key) # we can't use unicode as key
+                # wikiutil.escape for key/val must be done by (html) formatter!
+                key = str(key) # we can't use unicode as key ...
                 if key in acceptable_attrs:
-                    key = wikiutil.escape(key)
-                    val = unicode(val) # but for the value
-                    val = wikiutil.escape(val)
-                    tag_attrs[key] = val
+                    tag_attrs[key] = unicode(val) # ... but for the value
                 elif key.startswith('&'):
                     key = key[1:]
                     val = unicode(val)
@@ -744,7 +742,7 @@
                             macro.formatter = self.request.html_formatter
                             pagename = self.formatter.page.page_name
                             href = AttachFile.getAttachUrl(pagename, url, self.request, escaped=1)
-                            return EmbedObject.macro_EmbedObject(macro, wikiutil.escape(url))
+                            return EmbedObject.macro_EmbedObject(macro, url)
                 elif scheme == 'drawing':
                     desc = self._transclude_description(desc, url)
                     return self.formatter.attachment_drawing(url, desc)