Permalink
Browse files

*** empty log message ***

git-svn-id: svn://svn.tt2.org/tt/Template2/trunk@15 d5a88997-0a34-4036-9ed2-92fb5d660d91
  • Loading branch information...
1 parent 850d474 commit 70214227eb6b1b3e8fb4764cadab0811662ca7fd @abw committed Jul 6, 2000
View
@@ -0,0 +1,151 @@
+Changes
+MANIFEST
+Makefile.PL
+README
+RELEASE
+TODO
+bin/README
+bin/tpage
+bin/ttree
+docs/lib/author
+docs/lib/copyright
+docs/lib/exceptions
+docs/lib/footer
+docs/lib/option/blocks
+docs/lib/option/case
+docs/lib/option/chomp
+docs/lib/option/error
+docs/lib/option/evalperl
+docs/lib/option/filters
+docs/lib/option/grammar
+docs/lib/option/interp
+docs/lib/option/plugins
+docs/lib/option/preproc
+docs/lib/option/reset
+docs/lib/option/stash
+docs/lib/option/tag
+docs/lib/option/tagstyle
+docs/lib/option/templates
+docs/lib/option/trim
+docs/lib/option/variables
+docs/lib/option/version
+docs/lib/plugins
+docs/lib/ref/despat
+docs/lib/revision
+docs/lib/seealso
+docs/lib/version
+docs/pod/README
+docs/src/Base.pod
+docs/src/Config.pod
+docs/src/Constants.pod
+docs/src/Context.pod
+docs/src/Document.pod
+docs/src/Exception.pod
+docs/src/Filters.pod
+docs/src/Iterator.pod
+docs/src/Parser.pod
+docs/src/Plugin.pod
+docs/src/Plugins.pod
+docs/src/Provider.pod
+docs/src/Service.pod
+docs/src/Stash.pod
+docs/src/Template.pod
+docs/src/Test.pod
+docs/src/Utils.pod
+docs/ttree.cfg
+lib/Template.pm
+lib/Template/Base.pm
+lib/Template/Config.pm
+lib/Template/Constants.pm
+lib/Template/Context.pm
+lib/Template/Directive.pm
+lib/Template/Document.pm
+lib/Template/Exception.pm
+lib/Template/Filters.pm
+lib/Template/Grammar.pm
+lib/Template/Iterator.pm
+lib/Template/Parser.pm
+lib/Template/Plugin.pm
+lib/Template/Plugin/CGI.pm
+lib/Template/Plugin/Datafile.pm
+lib/Template/Plugin/Date.pm
+lib/Template/Plugin/Format.pm
+lib/Template/Plugin/Iterator.pm
+lib/Template/Plugin/Table.pm
+lib/Template/Plugin/URL.pm
+lib/Template/Plugin/XML/DOM.pm
+lib/Template/Plugin/XML/RSS.pm
+lib/Template/Plugins.pm
+lib/Template/Provider.pm
+lib/Template/README
+lib/Template/Service.pm
+lib/Template/Stash.pm
+lib/Template/Test.pm
+lib/Template/Utils.pm
+parser/Grammar.pm.skel
+parser/Parser.yp
+parser/README
+parser/yc
+t/README
+t/base.t
+t/binop.t
+t/block.t
+t/capture.t
+t/cgi.t
+t/compile1.t
+t/compile2.t
+t/compile3.t
+t/config.t
+t/context.t
+t/datafile.t
+t/date.t
+t/directive.t
+t/document.t
+t/dom.t
+t/evalperl.t
+t/exception.t
+t/filter.t
+t/foreach.t
+t/format.t
+t/include.t
+t/iterator.t
+t/list.t
+t/object.t
+t/output.t
+t/parser.t
+t/provider.t
+t/rss.t
+t/service.t
+t/skel.t
+t/stop.t
+t/table.t
+t/tags.t
+t/template.t
+t/test/lib/README
+t/test/lib/barfed
+t/test/lib/blockdef
+t/test/lib/config
+t/test/lib/error
+t/test/lib/footer
+t/test/lib/header
+t/test/lib/incblock
+t/test/lib/menu
+t/test/lib/trimme
+t/test/lib/udata1
+t/test/lib/udata2
+t/test/src/README
+t/test/src/bar/baz
+t/test/src/bar/baz.txt
+t/test/src/baz
+t/test/src/benchmark
+t/test/src/complex
+t/test/src/foo
+t/test/src/foobar
+t/test/src/golf
+t/test/tmp/README
+t/test/xml/example.rdf
+t/test/xml/testfile.xml
+t/try.t
+t/url.t
+t/vars.t
+t/varsv1.t
View
@@ -10,4 +10,4 @@
^docs/design/
^docs/tpj/
^docs/pod/.*\.pod$
-^t/test/tmp/
+
View
@@ -133,3 +133,9 @@ Misc
* should be able to pre-define BLOCKS as text which is auto-pre-compiled
- may rely on above to get access to Provider's PARSER object.
+* copied XML plugins and tests
+
+* fixed TRIM option to work with all BLOCKs and templates. Moved TRIMing
+ operation into context process() and include() methods. Also changed
+ service to call $context->process($template) rather than call the sub/
+ doc itself, thus ensuring that the output can get TRIMmed.
@@ -204,7 +204,7 @@ sub filter {
sub process {
my ($self, $template, $params) = @_;
- my $blocks;
+ my ($blocks, $output);
# request compiled template from cache
$template = $self->template($template)
@@ -222,11 +222,20 @@ sub process {
if $params;
if (ref $template eq 'CODE') {
- return &$template($self);
+ $output = &$template($self);
}
else {
- return $template->process($self);
+ $output = $template->process($self);
}
+
+ if ($self->{ TRIM }) {
+ for ($output) {
+ s/^\s+//;
+ s/\s+$//;
+ }
+ }
+
+ return $output;
}
@@ -271,6 +280,14 @@ sub include {
$self->{ STASH } = $self->{ STASH }->declone();
die $error if $error;
+
+ if ($self->{ TRIM }) {
+ for ($output) {
+ s/^\s+//;
+ s/\s+$//;
+ }
+ }
+
return $output;
}
Oops, something went wrong.

0 comments on commit 7021422

Please sign in to comment.