Subject: | Extract.pm: more whitespace stripping options to TT tags |
I see [%-|l-%] sort of tags are already supported in v0.68. Could it be
possible for all the white space stripping tag modifiers to be
supported? That'd be +, =, ~ (and '-', which is already supported).
Attached is a patch to do this.
For reference, see Template::Manual::Config (search for 'Tag Modifier')
Thanks in advance.
Subject: | 02more_TT_whitespace_flags.patch |
--- a/lib/Locale/Maketext/Extract.pm
+++ b/lib/Locale/Maketext/Extract.pm
@@ -255,7 +255,7 @@ sub extract {
# Template Toolkit
$line = 1; pos($_) = 0;
- while (m!\G(.*?\[%-?\s*\|l(?:oc)?(.*?)\s*(-?)%\](.*?)\[%(-?)\s*END\s*-?%\])!sg) {
+ while (m!\G(.*?\[%[-=~+]?\s*\|l(?:oc)?(.*?)\s*([-=~+]?)%\](.*?)\[%([-=~+]?)\s*END\s*[-=~+]?%\])!sg) {
my ($vars, $trim_start, $str, $trim_end) = ($2, $3, $4, $5);
$line += ( () = ($1 =~ /\n/g) ); # cryptocontext!
$vars =~ s/^\s*\(//;