# Blosxom plugin: strip_script_tags -*-cperl-*-
# Author: Sam Pearson
# $Id: strip_script_tags,v 1.1 2005/04/16 14:46:19 sam Exp sam $
package strip_script_tags;
# ---- Configuration ----
# List of flavours, separated by '|', to operate upon:
# e.g. my $flavours = 'rss1|rss2';
my $flavours = 'rss';
# ---- End configuration ----
sub start {
return 1 if $blosxom::flavour =~ /$flavours/;
return 0;
}
sub story {
my( $pkg, $path, $filename, $story_ref, $title_ref, $body_ref ) = @_;
$$body_ref =~ s!!!gis;
1;
}
1;
__END__
=head1 NAME
Blosxom plugin: strip_script_tags
=head1 DESCRIPTION
Designed to remove script tags and their contents from posts so that they can be used in syndication feeds without raising an error at feedvalidator.org.
By default, this plugin will be triggered if the flavour being generated is 'rss', but this can be configured.
If you are doing anything else to the HTML in the post bodies (such as escaping it) be sure to run this plugin first.
=head1 AUTHOR
Sam Pearson
=head1 VERSION
$Id: strip_script_tags,v 1.1 2005/04/16 14:46:19 sam Exp sam $
=head1 SEE ALSO
http://sgp.me.uk/sam/2005/04/16/strip-script-tags
=head1 LICENSE
Copyright 2005, Sam Pearson
This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/2.0/uk/ or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.