summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2012-10-05 12:31:26 -0500
committerJesse Luehrs <doy@tozt.net>2012-10-05 12:38:34 -0500
commite8a83edb85216a9f6978a99c77cc196db5cb4c44 (patch)
tree2c59f9ef7ecdbf87919093812576ca9872e4520d /lib
parent9191972488f91494a77025d27a2150a202dd0c1c (diff)
downloadtext-handlebars-e8a83edb85216a9f6978a99c77cc196db5cb4c44.tar.gz
text-handlebars-e8a83edb85216a9f6978a99c77cc196db5cb4c44.zip
implement {{^}} as an alias for {{else}}
Diffstat (limited to 'lib')
-rw-r--r--lib/Text/Xslate/Syntax/Handlebars.pm4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Text/Xslate/Syntax/Handlebars.pm b/lib/Text/Xslate/Syntax/Handlebars.pm
index ee4639c..c08cee9 100644
--- a/lib/Text/Xslate/Syntax/Handlebars.pm
+++ b/lib/Text/Xslate/Syntax/Handlebars.pm
@@ -64,6 +64,10 @@ sub split_tags {
$input =~ s/\A\Q$close_tag//
or die "Oops!";
+ # XXX this is ugly, but i don't know how to get the parsing
+ # right otherwise if we also need to support ^foo
+ $code = 'else' if $code eq '^';
+
my @extra;
my $autochomp = $code =~ m{^[!#^/=>]} || $code eq 'else';