HTML-FormatText-WithLinks
view release on metacpan or search on metacpan
lib/HTML/FormatText/WithLinks.pm view on Meta::CPAN
C<_>. You can change these markers by using the C<italic_marker> and
C<bold_marker> options.
=item unique_links
If set to 1 then will only generate 1 footnote per unique URI as oppose to the default behaviour which is to generate a footnote per URI.
=item anchor_links
If set to 0 then links pointing to local anchors will be skipped.
The default behaviour is to include all links.
=item skip_linked_urls
If set to 1, then links where the text equals the href value will be skipped.
The default behaviour is to include all links.
=back
=head2 parse
my $text = $f->parse($html);
Takes some HTML and returns it as text. Returns undef on error.
Will also return undef if you pass it undef. Returns an empty
string if passed an empty string.
=head2 parse_file
my $text = $f->parse_file($filename);
Takes a filename and returns the contents of the file as plain text.
Returns undef on error.
=head2 error
$f->error();
Returns the last error that occurred. In practice this is likely to be
either a warning that parse_file couldn't find the file or that
HTML::TreeBuilder failed.
=head1 CAVEATS
When passing HTML fragments the results may be a little unpredictable.
I've tried to work round the most egregious of the issues but any
unexpected results are welcome.
Also note that if for some reason there is an a tag in the document
that does not have an href attribute then it will be quietly ignored.
If this is really a problem for anyone then let me know and I'll see
if I can think of a sensible thing to do in this case.
=head1 AUTHOR
Struan Donald. E<lt>struan@cpan.orgE<gt>
L<http://www.exo.org.uk/code/>
Ian Malpass E<lt>ian@indecorous.comE<gt> was responsible for the custom
formatting bits and the nudge to release the code.
Simon Dassow E<lt>janus@errornet.de<gt> for the anchor_links option plus
a few bugfixes and optimisations
Kevin Ryde for the code for pulling the base out the document.
Thomas Sibley E<lt>trs@bestpractical.comE<gt> patches for skipping links that are their urls and to change the delimiters for bold and italic text..
=head1 SOURCE CODE
The source code for this module is hosted on GitHub
L<http://github.com/struan/html-formattext-withlinks>
=head1 COPYRIGHT
Copyright (C) 2003-2010 Struan Donald and Ian Malpass. All rights reserved.
=head1 LICENSE
This program is free software; you can redistribute
it and/or modify it under the same terms as Perl itself.
=head1 SEE ALSO
perl(1), HTML::Formatter.
=cut
( run in 2.261 seconds using v1.01-cache-2.11-cpan-63c85eba8c4 )