-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Bill Moseley wrote:
> The TT docs for the uri filter suggests:
>
> <a href="[% filename | uri | html %]">click here</a>
>
> Which I have done for a while out of habit, but doesn't work well for
> fragments:
>
> $ perl -MTemplate -le 'Template->new->process( \"[% u | uri | html %]", { u
> => "my file&stuff.html#offset" } )'
> my%20file&stuff.html%23offset
>
> Frankly, I'm not sure what's should happen, but the browsers I tested
> with choked on it.
>
> I'm now using Catalyst, so I use its c.uri_for(), but one usage of
> that filter still ended up in a macro and broke some links.
I'm pretty sure you're not supposed to URI encode links in HTML at all. That's
the browser's job. When you click on a
link that contains '%20', the browser should escape the % sign, making it
'%2E20', when it sends the request to the
server. That's not at all what you want. So just do [% u | html %].
Basically:
URI encoding is for HTTP, from the browser to the web server.
HTML encoding is for HTML, from the web server to the browser.
You'd only use both if you were representing an HTTP request in HTML... like
with AJAX?
- --
C. Chad Wallace, B.Sc.
The Lodging Company
http://skihills.com/
OpenPGP Public Key ID: 0x262208A0
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFFJwZGKeSNHCYiCKARAqfuAJsHih7asP67iA7iWiFs8ukc3QNDFgCcDrOc
3sNnDMaVcb1PNDQ4aD965Gw=
=y+fC
-----END PGP SIGNATURE-----
_______________________________________________
templates mailing list
[email protected]
http://lists.template-toolkit.org/mailman/listinfo/templates