1HTTP::Proxy::BodyFilterU:s:ehrtmClotnetxrti(b3u)ted PerlHTDToPc:u:mPernotxayt:i:oBnodyFilter::htmltext(3)
2
3
4
6 HTTP::Proxy::BodyFilter::htmltext - A filter to transmogrify HTML text
7
9 use HTTP::Proxy::BodyFilter::tags;
10 use HTTP::Proxy::BodyFilter::htmltext;
11
12 # could it be any simpler?
13 $proxy->push_filter(
14 mime => 'text/html',
15 response => HTTP::Proxy::BodyFilter::tags->new,
16 response => HTTP::Proxy::BodyFilter::htmltext->new(
17 sub { tr/a-zA-z/n-za-mN-ZA-M/ }
18 )
19 );
20
22 The HTTP::Proxy::BodyFilter::htmltext is a filter spawner that calls
23 the callback of your choice on any HTML text (outside "<script>" and
24 "<style>" tags, and entities).
25
26 The subroutine should modify the content of $_ as it sees fit. Simple,
27 and terribly efficient.
28
30 The filter defines the following methods, called automatically:
31
32 init()
33 Ensures that the filter is initialised with a CODE reference.
34
35 begin()
36 Per page parser initialisation.
37
38 filter()
39 A simple HTML parser that runs the given callback on the text
40 contained in the HTML data. Please look at
41 HTTP::Proxy::BodyFilter::htmlparser if you need something more
42 elaborate.
43
45 HTTP::Proxy, HTTP::Proxy::BodyFilter,
46 HTTP::Proxy::BodyFilter::htmlparser.
47
49 Philippe "BooK" Bruhat, <book@cpan.org>.
50
52 Copyright 2003-2015, Philippe Bruhat.
53
55 This module is free software; you can redistribute it or modify it
56 under the same terms as Perl itself.
57
58
59
60perl v5.38.0 2023-07-2H0TTP::Proxy::BodyFilter::htmltext(3)