Fix to handle no-op escapes such as \\, broken by unicode fix
[scpubgit/HTML-String.git] / lib / HTML / String / TT / Directive.pm
index 5454785..d78aed4 100644 (file)
@@ -36,14 +36,14 @@ sub text {
     # which then gets overload::constant'ed appropriately.
 
     # The first two lines of the s! were assembled from the escape sequences
-    # table in "Quote and Quote-like Operators" in perlop by Lukas Mai, then
-    # the last line handles sigils.
+    # table in "Quote and Quote-like Operators" in perlop by Lucas Mai, then
+    # the . handles any other single character escape (\$, \@, \\ etc.)
 
     my $str = perlstring $text;
     $str =~ s!
       \\ ( [abefnrt] | c. | o \{ [0-7]+ \} | x (?: \{ [[:xdigit:]]+ \}
            | [[:xdigit:]]{1,2} ) | N \{ [^{}]* \} | [0-7]{1,3}
-           | \$ | \@ )
+           | . )
       !"."\\$1"."!xg;
 
     return $str;