Subject: | uri filter behaviour contradicts docs and seems wrong |
use strict;
use warnings;
use Template;
print Template->VERSION, "\n";
Template->new->process( \'[% x |html %]', { x => q{'"} } );
__END__
prints
2.26
'"
that means:
1) single quote not escaped
2) double quote is escaped
here are the docs:
https://metacpan.org/pod/Template::Manual::Filters#uri
====
As of version 2.26 of the Template Toolkit, the uri and url filters use the unsafe character set defined by RFC3986. This means that certain characters ("(", ")", "~", "*", "!" and the single quote "'") are now deemed unsafe and will be escaped as hex character sequences. The double quote character ('"') is now deemed safe and will not be escaped.
====
docs says that:
1) single quote will be escaped
2) double quote will not be escaped
and according to https://www.ietf.org/rfc/rfc3986.txt seems docs are correct and code is wrong.