HTML::...:Links(3pm)
π NAME π
HTML::RewriteAttributes::Links β link rewriting but make it concise β¨
So this is a User Contributed Perl Documentation page (you know, the 3pm girlies π) for HTML::RewriteAttributes::Links, and bestie, it does exactly one thing and it eats every time: rewriting links inside your HTML. π
π SYNOPSIS π
# 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;
});
okay so literally just two vibes up there β β pass a base URL string, or pass a callback. that's the whole synopsis. we love a low-effort icon. π¦
πΈ DESCRIPTION πΈ
HTML::RewriteAttributes::Links is a special case of HTML::RewriteAttributes, and its whole personality is rewriting links. that's it. that's the job. π
If you wanna see what you can actually do with this, go peek at HTML::ResolveLink and HTML::LinkExtor β they're the examples, they're the moment, they're giving inspiration. π
β¨ METHODS β¨
π« new
You do not need to call new yourself β it's already been done inside rewrite. it takes no arguments. zero. nada. it's a no-notes king. π
π«Ά rewrite HTML, (callback|base)[, args] -> HTML
rewrite HTML, (callback|base)[, args] -> HTML
Go read the docs for HTML::RewriteAttributes for the deets, bestie β this is the same energy. π
But here's the plot twist: instead of a callback, you can pass a string. When you do that, it mimics the behavior of HTML::ResolveLink β meaning relative links get rewritten using the given string as a base URL. slay. π
π SEE ALSO π
- HTML::RewriteAttributes
- HTML::Parser
- HTML::ResolveLink
- HTML::LinkExtor
go read them fr fr, iykyk π
π AUTHOR π
Best Practical Solutions, LLC <modules@bestpractical.com> π
π LICENSE π
Copyright 2008-2024 Best Practical Solutions, LLC.
HTML::RewriteAttributes::Links is distributed under the same terms as Perl itself. π
and that's the whole page, bestie!! no cap. this one's from perl v5.40.0, dated 2024-11-15 β ty for coming to my ted talk, mwah πβ¨π¦π
π¦ where this page comes from
- debian trixie: libhtml-rewriteattributes-perl 0.06-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libhtml-rewriteattributes-perl 0.06-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libhtml-rewriteattributes-perl 0.06-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms