NAME
Pod::ParseLink -- Parse an L<> formatting code in POD text
SYNOPSIS
use Pod::ParseLink;
my ($text, $inferred, $name, $section, $type) = parselink ($link);
DESCRIPTION
This module only provides a single function, parselink(), which takes the text of an L<> formatting code and parses it. It returns the anchor text for the link (if any was given), the anchor text possibly inferred from the name and section, the name or URL, the section if any, and the type of link. The type will be one of 'url', 'pod', or 'man', indicating a URL, a link to a POD page, or a link to a Unix manual page.
Parsing is implemented per perlpodspec. For backward compatibility, links where there is no section and name contains spaces, or links where the entirety of the link (except for the anchor text if given) is enclosed in double-quotes are interpreted as links to a section (L</section>).
The inferred anchor text is implemented per perlpodspec:
L<name> => L<name|name>
L</section> => L<"section"|/section>
L<name/section> => L<"section" in name|name/section>
The name may contain embedded E<> and Z<> formatting codes, and the section, anchor text, and inferred anchor text may contain any formatting codes. Any double quotes around the name or section are removed as part of the parsing, as are any leading or trailing whitespace.
No attempt is made to resolve formatting codes. The caller must be prepared to do that either before or after calling parselink(). (This is because interpretation of E<> formatting codes may vary by formatter.)
AUTHOR
Russ Allbery <rra@stanford.edu>.
COPYRIGHT AND LICENSE
Copyright 2001 by Russ Allbery <rra@stanford.edu>.
This program is free software; you may redistribute it and/or modify it under the same terms as Perl itself.
1 POD Error
The following errors were encountered while parsing the POD:
- Around line 114:
An empty L<>