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