According to the RFC, TT is doing the right thing. Double quotes are the correct way to quote things in HTML, though single quotes do work in many situations. In XML, single quotes are allowed, so if you're using XHTML then that's more reasonable. But according to the URI RFC the ' character is allowed in URLs, which is why TT doesn't escape it. http://www.ietf.org/rfc/rfc2396.txt
You might need to create a custom filter (maybe call it xuri in honor of xhtml) and use that instead. On Tue, Mar 1, 2011 at 2:29 PM, Kevin Goess <[email protected]> wrote: > We're a little puzzled by this, any help would be appreciated. > > We're converting some HTML to TT. Our current HTML uses single quotes > around the attribute values, which is unusual though not unreasonable. > This idiom correctly deals with everything but the single quote: > > [% param4 = "Bob's Diner & " _ '"Sandwiches"' %] > <a href='/foo?param1=[% name | uri %]'> > > It outputs this, which given that the single quote is the attribute > delimiter, is broken HTML > > <a href='/foo?name=Bob's%20Diner%20%26%20%22Sandwiches%22'> > > Is there a good way to deal with that besides just requiring > double-quotes for the attribute values? > > _______________________________________________ > templates mailing list > [email protected] > http://mail.template-toolkit.org/mailman/listinfo/templates > -- Check out my LEGO blog at http://www.brickpile.com/ View my photos at http://flickr.com/photos/billward/ Follow me at http://twitter.com/williamward
_______________________________________________ templates mailing list [email protected] http://mail.template-toolkit.org/mailman/listinfo/templates
