| Markdent documentation | Contained in the Markdent distribution. |
Markdent::Handler::HTMLFilter - Filters out HTML events from the event stream
version 0.17
my $html = Markdent::Handler::HTMLStream->new( ... ); my $filter = Markdent::Handler::HTMLFilter->new( handler => $html ); my $parser = Markdent::Parser->new( handler => $filter ): $parser->parse( markdown => ... );
This class implements an event filter which drops all HTML events except for HTML entities.
This class provides the following methods:
This method creates a new handler.
This class does the Markdent::Role::Handler role.
See Markdent for bug reporting details.
Dave Rolsky <autarch@urth.org>
This software is copyright (c) 2010 by Dave Rolsky.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
| Markdent documentation | Contained in the Markdent distribution. |
package Markdent::Handler::HTMLFilter; BEGIN { $Markdent::Handler::HTMLFilter::VERSION = '0.17'; } use strict; use warnings; use Markdent::CapturedEvents; use namespace::autoclean; use Moose; use MooseX::StrictConstructor; with 'Markdent::Role::FilterHandler'; sub filter_event { my $self = shift; my $event = shift; return if grep { $event->isa( 'Markdent::Event::' . $_ ) } qw( HTMLBlock HTMLComment HTMLCommentBlock HTMLTag StartHTMLTag EndHTMLTag ); $self->handler()->handle_event($event); return; } __PACKAGE__->meta()->make_immutable(); 1; # ABSTRACT: Filters out HTML events from the event stream
__END__