It would be very helpful if there were 2 types (maybe 2 roles) that when a template tag recipe an instance of that type,
it would automatically avoiding escaping it. Maybe it could be something like HSML and JAVASCRIPT roles and that would
automatically apply &HTML and &HTML-AND_JAVASCRIPT (maybe a &JAVASCRIPT if that exists), so when doing:
and the object on $_ has something like:
method method-returning-html {
'<a href="http://pudim.com.br">Pudim</a>' does HTML
}
it would behave as it were:
<&HTML(.method-returning-html)>
and also existing:
class Link {
has Str $.title;
has Str $.href;
method Str {
qq'<a href="$!href">$!title</a>' does HTML
}
}
if we have:
and that returns something like:
method pudim-link { Link.new: :title<Pudim>, :href<http://pudim.com.br> }
it would be equivalent to:
and the same for JS
It would be very helpful if there were 2 types (maybe 2 roles) that when a template tag recipe an instance of that type,
it would automatically avoiding escaping it. Maybe it could be something like HSML and JAVASCRIPT roles and that would
automatically apply &HTML and &HTML-AND_JAVASCRIPT (maybe a &JAVASCRIPT if that exists), so when doing:
and the object on $_ has something like:
it would behave as it were:
and also existing:
if we have:
and that returns something like:
it would be equivalent to:
and the same for JS