From c4ec8e689764348f2e6d56e46b192209187033a2 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Thu, 27 Sep 2012 13:55:35 -0500 Subject: basic implementation of raw strings --- t/003-safestring.t | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 't/003-safestring.t') diff --git a/t/003-safestring.t b/t/003-safestring.t index 77aa7de..8e095ea 100644 --- a/t/003-safestring.t +++ b/t/003-safestring.t @@ -1,7 +1,7 @@ use strict; use warnings; use Test::More; -use Text::Xslate; +use Text::Xslate 'mark_raw'; my $tx = Text::Xslate->new(syntax => 'Handlebars'); @@ -16,18 +16,15 @@ is( is( $tx->render_string( '

{{title}}

{{{body}}}

', - { title => 'All about

Tags', body => 'This is a post about <p> tags' }, + { title => 'All About

Tags', body => 'This is a post about <p> tags' }, ), '

All About <p> Tags

This is a post about <p> tags

', ); -# XXX I'm not sure what the safestring constructor should be called -# it's effectively Handlebars::SafeString->new($str) in JS -# maybe we can just use Text::Xslate's mark_raw directly is( $tx->render_string( '

{{title}}

{{{body}}}

', - { title => Handlebars::SafeString->new('All about <p> Tags'), body => 'This is a post about <p> tags' }, + { title => mark_raw('All About <p> Tags'), body => 'This is a post about <p> tags' }, ), '

All About <p> Tags

This is a post about <p> tags

', ); -- cgit v1.2.3-54-g00ecf