sub new {
shift;
+ my @args = (ref($_[0]) eq 'HASH' ? %{$_[0]} : @_);
Template->new(
PARSER => Template::Parser->new(
- FACTORY => 'HTML::String::TT::Directive'
+ FACTORY => 'HTML::String::TT::Directive',
+ @args,
),
- STASH => Template::Stash->new,
+ STASH => Template::Stash->new( @args,),
FILTERS => { no_escape => sub {
$_[0]->$_isa('HTML::String::Value')
? HTML::String::Value->new(map $_->[0], @{$_[0]->{parts}})
: HTML::String::Value->new($_)
} },
- (ref($_[0]) eq 'HASH' ? %{$_[0]} : @_)
+ @args,
);
}