#!/usr/bin/perl # Blosxom Plugin: zap_markup # Author(s): Jan "Yenya" Kasprzak kas _a_t_ fi.muni.cz, # http://www.fi.muni.cz/~kas/ # Version: 0.1 # Blosxom Home/Docs/Licensing: http://www.raelity.org/apps/blosxom/ # This plugin home: http://www.fi.muni.cz/~kas/zap_markup-plugin.txt # Yes, it is named so that it can be loaded last package zap_markup; # --- Configurable variables ----- # From which flavours to strip markup @strip_flavours = qw(); # qw(rss) to enable this plug-in for the rss flavour # Keep the first paragraph only in this markup $first_paragraph_only = 0; # What to add when $first_paragraph_only == 1 and the story is being truncated $truncated_text = ' [...]'; # -------------------------------- sub start { return (grep { $blosxom::flavour eq $_ } @strip_flavours) ? 1 : undef; } sub story { my ($pkg, $path, $filename, $story_ref, $title_ref, $body_ref) = @_; if ($first_paragraph_only) { $$body_ref =~ s|

.*|$truncated_text|xms; } $$body_ref =~ s|&|&|gxms; $$body_ref =~ s|\<|<|gxms; $$body_ref =~ s|\>|>|gxms; 1; } 1;