Permalink
Browse files

Added r() function as shorthand for mark_raw()

  • Loading branch information...
1 parent 44449c0 commit 4d84f3c536ce519476a78caadecc39d721a174aa @Getty Getty committed Dec 3, 2012
Showing with 4 additions and 4 deletions.
  1. +1 −1 dist.ini
  2. +3 −3 lib/DDG/Publisher/SiteRole.pm
View
@@ -1,7 +1,7 @@
name = DDG-Publisher
author = Torsten Raudssus <torsten@raudss.us>
license = Perl_5
-copyright_holder = Torsten Raudssus
+copyright_holder = DuckDuckGo, Inc. L<http://duckduckgo.com/>
copyright_year = 2012
[GatherDir]
@@ -91,14 +91,14 @@ sub _build_template_engine {
my %xslate_locale_functions;
for my $key (keys %{ Locale::Simple->coderef_hash }) {
$xslate_locale_functions{$key} = sub {
- my $result = Locale::Simple->coderef_hash->{$key}->(@_);
- return mark_raw($result);
+ return mark_raw(Locale::Simple->coderef_hash->{$key}->(@_));
};
}
return Text::Xslate->new(
path => [$site_template_root,$core_template_root],
function => {
- js => sub { mark_raw(javascript_value_escape(join("",@_))) },
+ js => sub { return mark_raw(javascript_value_escape(join("",@_))) },
+ r => sub { return mark_raw(join("",@_)) },
%xslate_locale_functions,
find_template => sub {
my ($filename) = @_;

0 comments on commit 4d84f3c

Please sign in to comment.