X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FHTML%2FString%2FTT.pm;h=0244de808da2b403044f7b2eba52c444297e212c;hb=4f4204a3cb10eac31bb4387275f10753d25bf07e;hp=6e35360acb8196715e344da95bad7d76ca87768c;hpb=51eaef0b19f5ecdb237e313c327745e879f45d28;p=scpubgit%2FHTML-String.git diff --git a/lib/HTML/String/TT.pm b/lib/HTML/String/TT.pm index 6e35360..0244de8 100644 --- a/lib/HTML/String/TT.pm +++ b/lib/HTML/String/TT.pm @@ -2,6 +2,15 @@ package HTML::String::TT; use strictures 1; +BEGIN { + if ($INC{"Template.pm"} and !$INC{"UNIVERSAL/ref.pm"}) { + warn "Template was loaded before we could load UNIVERSAL::ref" + ." - this means you're probably going to get weird errors." + ." To avoid this, use HTML::String::TT before loading Template." + } + require UNIVERSAL::ref; +} + use HTML::String; use HTML::String::TT::Directive; use Safe::Isa; @@ -9,6 +18,16 @@ use Template; use Template::Parser; use Template::Stash; +BEGIN { + my $orig_blessed = Template::Stash->can('blessed'); + no warnings 'redefine'; + *Template::Stash::blessed = sub ($) { + my $val = $orig_blessed->($_[0]); + return undef if defined($val) and $val eq 'HTML::String::Value'; + return $val; + }; +} + sub new { shift; Template->new( @@ -26,3 +45,97 @@ sub new { } 1; + +__END__ + +=head1 NAME + +HTML::String::TT - HTML string auto-escaping for L