| Text-Microformat documentation | Contained in the Text-Microformat distribution. |
Text::Microformat::Plugin::Include - a plugin providing the Microformat include pattern
Text::Microformat::Plugin::Parser::HTML - HTML parser plugin for Text::Microformat
Keith Grennan, <kgrennan at cpan.org>
Log bugs and feature requests here: http://code.google.com/p/ufperl/issues/list
Project homepage: http://code.google.com/p/ufperl/
Copyright 2007 Keith Grennan, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
| Text-Microformat documentation | Contained in the Text-Microformat distribution. |
package Text::Microformat::Plugin::Include; use strict; use warnings; sub post_parse { my $c = shift; my @includes = $c->tree->look_down( _tag => $c->tag_regex('object'), class => $c->class_regex('include'), ); foreach my $source (@includes) { my $id = $source->attr('data'); if (defined $id and length $id > 1 and $id =~ s/^#//) { my ($target) = $c->tree->look_down(id => $id); if ($target) { $source->replace_with($target->clone)->delete; } } } return $c->NEXT::post_parse(@_); }
1;