Skip to content

Commit

Permalink
unescaped braces in regex is deprecated in 5.17+
Browse files Browse the repository at this point in the history
perl 5.17.0 and up deprecate the use of unescaped braces inside regular expressions, triggering a warning every time they see it (one that will, in time, become an error). This patch updates Text::Haml to newer perls :)
  • Loading branch information
garu committed Jul 30, 2012
1 parent a1e815f commit 00a77ab
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/Text/Haml.pm
Original file line number Diff line number Diff line change
Expand Up @@ -889,11 +889,11 @@ sub _parse_text {
my $t;
my $escape = 0;
my $found = 0;
if ($text =~ s/^(.*?)?(?<!\\)\#{//) {
if ($text =~ s/^(.*?)?(?<!\\)\#\{//) {
$found = 1;
$t = $1;
}
elsif ($text =~ s/^(.*?)?\\\\\#{//) {
elsif ($text =~ s/^(.*?)?\\\\\#\{//) {
$found = 1;
$t = $1;
$escape = 1;
Expand All @@ -905,7 +905,7 @@ sub _parse_text {
}

if ($found) {
$text =~ s/^([^}]+)}//;
$text =~ s/^([^}]+)\}//;

my $prefix = $escape ? quotemeta("\\") : '';
$output .= qq/$prefix".$1."/;
Expand Down

0 comments on commit 00a77ab

Please sign in to comment.