HTML::RewriteAttributes::Links(3pm)

HTML::RewriteAttributes::Links3pm

Concise link rewriting

Usage

    # up for some HTML::ResolveLink?
    $html = HTML::RewriteAttributes::Links->rewrite($html, "http://search.cpan.org");
    # or perhaps HTML::LinkExtor?
    HTML::RewriteAttributes::Links->rewrite($html, sub {
        my ($tag, $attr, $value) = @_;
        push @links, $value;
        $value;
    });

Overview

"HTML::RewriteAttributes::Links" is a special case of HTML::RewriteAttributes for rewriting links.

See HTML::ResolveLink and HTML::LinkExtor for examples of what you can do with this.

Methods

"new"

You don't need to call "new" explicitly - it's done in "rewrite". It takes no arguments.

"rewrite" HTML, (callback|base)[, args] -> HTML

See the documentation of HTML::RewriteAttributes.

Instead of a callback, you may pass a string. This will mimic the behavior of HTML::ResolveLink -- relative links will be rewritten using the given string as a base URL.

Releases

8 releases since Debian 6.0 (Squeeze); the text changed 5 times.

  1. 6.0
  2. 7
  3. 8–9
  4. 10–11
  5. 12
  6. 13

Author

Best Practical Solutions, LLC <[email protected]>

License

Copyright 2008-2024 Best Practical Solutions, LLC. HTML::RewriteAttributes::Links is distributed under the same terms as Perl itself.

From libhtml-rewriteattributes-perl 0.06-1 in Debian 13 (Trixie). Parsed by carta from the page's man source.