| Plagger documentation | Contained in the Plagger distribution. |
Plagger::Plugin::Filter::StripTagsFromTitle - Strip tags from entry title
- module: Filter::StripTagsFromTitle
This plugin filters entries to remove HTML tags from its title. Some feeds like blog search engine's result feeds contain HTML tags e.g.:
<title><b>Plagger</b> rocks</title>
But with RSS spec, there's no way to declare if it's a markup or an escaped text, while Atom 1.0 has by using title@type attribute. This plugin normalizes those titles by simply stripping HTML tags from them.
Tatsuhiko Miyagawa
| Plagger documentation | Contained in the Plagger distribution. |
package Plagger::Plugin::Filter::StripTagsFromTitle; use strict; use base qw( Plagger::Plugin ); use Plagger::Util; sub register { my($self, $context) = @_; $context->register_hook( $self, 'update.entry.fixup' => \&filter, ); } sub filter { my($self, $context, $args) = @_; if (defined $args->{entry}->title && $args->{entry}->title->is_html) { $args->{entry}->title( Plagger::Util::strip_html($args->{entry}->title) ); } } 1; __END__