Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

eliminate the work around

  • Loading branch information...
commit 7836a7a9ac2f959018000355cd8519a9bed9e602 1 parent 2fb55fc
@szabgab szabgab authored
Showing with 5 additions and 10 deletions.
  1. +5 −10 lib/HTML/Template.pm
View
15 lib/HTML/Template.pm
@@ -54,15 +54,7 @@ method substitute( $contents, %params ) {
if $i<attributes><escape> {
my $et = ~$i<attributes><escape>[0];
- # RAKUDO: Segfault here :(
- #$value = escape($value, $et);
- if $et eq 'HTML' {
- $value = escape($value, 'HTML');
- }
- elsif $et eq 'URL' | 'URI' {
- $value = escape($value, 'URL');
- }
-
+ $value = escape($value, $et);
}
$output ~= ~$value;
}
@@ -139,9 +131,12 @@ sub escape($str is copy, $mode) {
$str .= subst(m/\</, "&lt;", :g);
$str .= subst(m/\>/, "&gt;", :g);
}
- when 'URL' {
+ when 'URL' | 'URI' {
$str .= subst(m/\ /, "+%20+", :g);
}
+ when 'NONE' {
+ # nothing to do here
+ }
default {
die "Invalid mode '$mode'";
}

0 comments on commit 7836a7a

Please sign in to comment.
Something went wrong with that request. Please try again.