Permalink
Browse files

RT #68680 is fixed; SVG.pm now escapes text

  • Loading branch information...
1 parent 956a03d commit f7af24d5c4300276406905a94bf5eba841fff488 @moritz committed Sep 13, 2009
Showing with 3 additions and 7 deletions.
  1. +2 −6 lib/SVG/MatchDumper.pm
  2. +1 −1 match-to-svg.pl
View
@@ -9,9 +9,7 @@ my $margin = 10;
our $s;
-multi sub svg-dump(Match $m, $orig = ~$m) is export {
- # XXX $chars should be $m.orig.chars by default,
- # but blocks on RT #68680
+multi sub svg-dump(Match $m, $orig = $m.orig) is export {
my $chars = $orig.chars;
my $font-width = $font-size * 0.6;
my $scale = $width / ($font-width * $chars);
@@ -54,9 +52,7 @@ multi sub svg-dump(Match $m, Str $path, $y) {
for $m.caps -> $c {
my $k = $c.key;
- my $newkey = $k ~~ Int ?? "[$k]" !! "<$k>"; # ugly hack
- # until SVG.pm
- # does some escaping
+ my $newkey = $k ~~ Int ?? "[$k]" !! "<$k>;";
svg-dump($c.value, $path ~ $newkey, $y+1);
}
}
View
@@ -9,7 +9,7 @@
my $x = 'just 20,000 dollar per apple';
if $x ~~ m/:s ((\d+) ** ',') <currency> 'per' <fruit> $ / {
- svg-dump($/, $x);
+ svg-dump($/);
} else {
die "no match";
}

0 comments on commit f7af24d

Please sign in to comment.