Fix bug with MWTemplate::Parse

The slurp after the template name needs to be non-greedy so it ends at the first }}.
Now that I think about it,
this will break if the template invocation has template/variable calls within it
main
Daniel Asher Resnick 10 months ago
parent b3b8d8700f
commit 4687677e0c
  1. 4
      MWTemplate.pm

@ -9,9 +9,7 @@ my $DEBUG = 1;
sub Parse($input, $template_name)
{
# say STDERR "Looking for $template_name in:";
# say STDERR $input;
my ($contents) = $input =~ /\{\{ \s* $template_name \s* \| (.*) \}\}/sx;
my ($contents) = $input =~ /\{\{ \s* $template_name \s* \| (.*?) \}\}/sx;
return 0 unless $contents;
my @params = split /\|/, $contents;
my @positional_params;

Loading…
Cancel
Save