xref: /openbsd-src/gnu/usr.bin/perl/cpan/Pod-Simple/lib/Pod/Simple/TextContent.pm (revision 48950c12d106c85f315112191a0228d7b83b9510)
1
2
3require 5;
4package Pod::Simple::TextContent;
5use strict;
6use Carp ();
7use Pod::Simple ();
8use vars qw( @ISA $VERSION );
9$VERSION = '3.20';
10@ISA = ('Pod::Simple');
11
12sub new {
13  my $self = shift;
14  my $new = $self->SUPER::new(@_);
15  $new->{'output_fh'} ||= *STDOUT{IO};
16  $new->nix_X_codes(1);
17  return $new;
18}
19
20#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
21
22sub _handle_element_start {
23  print {$_[0]{'output_fh'}} "\n"  unless $_[1] =~ m/^[A-Z]$/s;
24  return;
25}
26
27sub _handle_text {
28  if( chr(65) eq 'A' ) {     # in ASCIIworld
29    $_[1] =~ tr/\xAD//d;
30    $_[1] =~ tr/\xA0/ /;
31  }
32  print {$_[0]{'output_fh'}} $_[1];
33  return;
34}
35
36sub _handle_element_end {
37  print {$_[0]{'output_fh'}} "\n"  unless $_[1] =~ m/^[A-Z]$/s;
38  return;
39}
40
41#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
421;
43
44
45__END__
46
47=head1 NAME
48
49Pod::Simple::TextContent -- get the text content of Pod
50
51=head1 SYNOPSIS
52
53 TODO
54
55  perl -MPod::Simple::TextContent -e \
56   "exit Pod::Simple::TextContent->filter(shift)->any_errata_seen" \
57   thingy.pod
58
59=head1 DESCRIPTION
60
61This class is that parses Pod and dumps just the text content.  It is
62mainly meant for use by the Pod::Simple test suite, but you may find
63some other use for it.
64
65This is a subclass of L<Pod::Simple> and inherits all its methods.
66
67=head1 SEE ALSO
68
69L<Pod::Simple>, L<Pod::Simple::Text>, L<Pod::Spell>
70
71=head1 SUPPORT
72
73Questions or discussion about POD and Pod::Simple should be sent to the
74pod-people@perl.org mail list. Send an empty email to
75pod-people-subscribe@perl.org to subscribe.
76
77This module is managed in an open GitHub repository,
78L<http://github.com/theory/pod-simple/>. Feel free to fork and contribute, or
79to clone L<git://github.com/theory/pod-simple.git> and send patches!
80
81Patches against Pod::Simple are welcome. Please send bug reports to
82<bug-pod-simple@rt.cpan.org>.
83
84=head1 COPYRIGHT AND DISCLAIMERS
85
86Copyright (c) 2002 Sean M. Burke.
87
88This library is free software; you can redistribute it and/or modify it
89under the same terms as Perl itself.
90
91This program is distributed in the hope that it will be useful, but
92without any warranty; without even the implied warranty of
93merchantability or fitness for a particular purpose.
94
95=head1 AUTHOR
96
97Pod::Simple was created by Sean M. Burke <sburke@cpan.org>.
98But don't bother him, he's retired.
99
100Pod::Simple is maintained by:
101
102=over
103
104=item * Allison Randal C<allison@perl.org>
105
106=item * Hans Dieter Pearcey C<hdp@cpan.org>
107
108=item * David E. Wheeler C<dwheeler@cpan.org>
109
110=back
111
112=cut
113