Max Ischenko wrote: > Hi, > > I am trying to validate my XHTML page (generated with Pylons/Mako) and > got an error: > http://validator.w3.org/check?uri=http%3A%2F%2Ftesting.developers.org.ua%2F > > Warning /Line 104 column 41/: cannot generate system identifier for > general entity "norestart". > > || <a href="/_pylons/selfupdate?svnup=yes&*n*orestart=yes">Update</a>| > > Obviously, w3c validators expects & to be encoded as & while it > isn't. The url in question is generated with > | <a href="${h.url_for(controller='selfupdate', svnup='yes', > norestart='yes')}">Update</a> > > What should I do to automatically convert & to &? Do I need to write > a Mako filter? Does current behaviour correct/expected?
A filter is the right way to handle this. The URL shouldn't have & in it. That's just the way you encode & in an HTML attribute. If you put it in a Javascript string literal it definitely shouldn't be encoded. Templating languages that auto-encode or know the structure of HTML will get this right (e.g., ZPT, Genshi, etc.). IMHO Mako should encode strings by default too. But either way, it's a template concern, not something url_for should handle. -- Ian Bicking | [EMAIL PROTECTED] | http://blog.ianbicking.org | Write code, do good | http://topp.openplans.org/careers --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~----------~----~----~----~------~----~------~--~---
