actually reading your email again I guess you are saying that for _src and _href we should use urllib.quote instead of cgi.escape. something like
if self.attributes.has_key('_src'): self.attributes['_src'] =urllib.quote(self.attributes['_src']) problems: 1) GAE does not have urllib. Is there an alternative? 2) urllib.quote encodes '#' too. Is that correct? Massimo On Nov 29, 6:37 pm, mdipierro <[EMAIL PROTECTED]> wrote: > anctually helpers already automatically cgi.escape all tag attributes. > > Massimo > > On Nov 29, 5:15 pm, achipa <[EMAIL PROTECTED]> wrote: > > > Inspired by the URL talk in the other thread, I'm wordering if would > > make sense to make helpers a bit smarter to make conversions and some > > defaults easier (not to mention standards compliance enforcing !). The > > URL() helper is actually already moving in this direction as it > > transparently urlencodes the parameters. So, I was thinking we could > > do the same for helpers which deal with URL-s, f.e. A(), IMG(), etc. > > For the A() tag, the 'smartness' is required for example to have the > > HREF field automatically urlescaped, or definining an empy "#" HREF if > > it's not specified to pass validation. An image element without an ALT > > and SRC tag will also not pass validation, thus, if these are not > > provided, the helper should generate them on a best effort basis. I > > would more likely expect from an IMG('something.jpg') to use the > > string for src or alt and not throw an error. There are probably more > > helpers that could do some more interpretation/validation according to > > HTML specs. Thoughts ? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~----------~----~----~----~------~----~------~--~---