diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2012-05-19 18:01:32 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2012-05-19 18:01:32 +0000 |
commit | b1509f22892dc98057c750e7fae39ded5cea3b09 (patch) | |
tree | 6bdcc9379ae86339a67022b758575729d1304074 /plugins/MirOTR/ekhtml/testsuite/plparser.pl | |
parent | e7a776a6f5ab323cd9dd824e815846ef268fa7f1 (diff) |
added MirOTR
git-svn-id: http://svn.miranda-ng.org/main/trunk@83 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/MirOTR/ekhtml/testsuite/plparser.pl')
-rw-r--r-- | plugins/MirOTR/ekhtml/testsuite/plparser.pl | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/plugins/MirOTR/ekhtml/testsuite/plparser.pl b/plugins/MirOTR/ekhtml/testsuite/plparser.pl new file mode 100644 index 0000000000..f7ee4a150b --- /dev/null +++ b/plugins/MirOTR/ekhtml/testsuite/plparser.pl @@ -0,0 +1,38 @@ +#!/usr/bin/perl +use HTML::Parser(); +use strict; +sub start_handler +{ + my ($tag, $self) = @_; + print "START: \"".$tag."\"\n"; +} + +sub end_handler +{ + my ($tag, $self) = @_; + print "END: \"".$tag."\"\n"; +} + +sub text_handler +{ + my ($text, $self) = @_; + print $text; +} + +sub comment_handler +{ + my ($text, $self) = @_; + print "COMMENT: \""; + foreach my $cur_comment (@$text) { + print $cur_comment; + } + print "\"\n"; +} + +my $p = HTML::Parser->new(api_version => 3); +$p->handler( start => \&start_handler, "tagname,self"); +$p->handler( end => \&end_handler, "tagname,self"); +$p->handler( text => \&text_handler, "dtext, self"); +$p->handler( comment => \&comment_handler, "tokens, self"); +$p->parse_file(shift || die) || die $!; + |