projects
/
scpubgit/HTML-String.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
(parent:
f27b509
)
further escaping fixes
Matt S Trout [Sun, 12 Aug 2012 17:10:37 +0000 (10:10 -0700)]
lib/HTML/String/TT/Directive.pm
patch
|
blob
|
blame
|
history
xt/tt.t
patch
|
blob
|
blame
|
history
diff --git
a/lib/HTML/String/TT/Directive.pm
b/lib/HTML/String/TT/Directive.pm
index
5e6baad
..
4a1c819
100644
(file)
--- a/
lib/HTML/String/TT/Directive.pm
+++ b/
lib/HTML/String/TT/Directive.pm
@@
-19,7
+19,7
@@
sub textblock {
sub text {
my ($class, $text) = @_;
for ($text) {
- s/(["\$\@\\])/\\$1/g;
+ s/(["\$\@\\])/"."\\$1"."/g;
s/\n/"."\\n"."/g;
}
return '"' . $text . '"';
diff --git
a/xt/tt.t
b/xt/tt.t
index
bd0af60
..
debdbbd
100644
(file)
--- a/
xt/tt.t
+++ b/
xt/tt.t
@@
-28,4
+28,9
@@
is(
'<tag>Hi <bob></tag>',
);
+is(
+ do_tt('<foo>"$bar"</foo>'."\n"),
+ '<foo>"$bar"</foo>'."\n"
+);
+
done_testing;