# Process Tags # Tag post-processing text plugin for Movable Type # # This was inspired by Kalsey Consulting Group's # tag post-processor. http://kalsey.com/ # # But it implements the post-processing via a text # plugin, rather than a global attribute. Also, # it does not require any other Perl library other # than Movable Type 2.6 itself. # # Copyright 2003 Jeff Borlik # Mon Apr 7 19:23:26 PDT 2003 # package MT::Plugins::ProcTextTags; use strict; use MT; MT->add_text_filter(proctags => { label => 'Process Entry Tags', docs => 'http://www.borlik.net/blog/archives/000030.html', on_format => \& process_tags } ); sub process_tags { my ($text, $ctx) = @_; my $builder = $ctx->stash('builder'); my $tokens = $ctx->stash('tokens'); my $tok = $builder->compile($ctx, $text); my $out = $builder->build($ctx, $tok); return $ctx->error("Error processing tags with proctags plugin: ".$builder->errstr) unless defined $out; return $out; } 1; #THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS #OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF #MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND #NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE #LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION #OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION #WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.