use Template::TT3::Scanner; use Template::TT3::Tag::Replace; my $tag = Template::TT3::Tag::Replace->new( start => '[b]', end => '[/b]', replace => sub { my ($self, $text) ); my $scanner = Template::TT3::Scanner->new( tagset => { bold => $bold } ); my $tokens = $scanner->scan($some_text);
This module is a subclass of Template::TT3::Tag which implements the TT3 comment tag.
[# this is a comment tag #]
The following methods are defined in addition to those inherited from the Template::TT3::Tag::Inline , Template::TT3::Tag , Template::TT3::Base and Badger::Base base classes.
Custom tokenisation method for scanning comment tags. The start token for
the comment tag is the last token in $output
when this method is called.
It scans to the end of the comment tag and appends the comment to the end
of the start tag token. It then changes the start token type to be a comment.
Andy Wardley http://wardley.org/
Copyright (C) 1996-2009 Andy Wardley. All Rights Reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.