Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

•Re: Change URIs in Text to HTML-Links

by merlyn (Sage)
on Nov 07, 2002 at 16:37 UTC ( #211110=note: print w/ replies, xml ) Need Help??

in reply to Change URIs in Text to HTML-Links

You left out the mandatory "escape HTML entity" calls. Shame on you.

use HTML::Entities qw(encode_entities); use URI::Find; ... my $finder = URI::Find->new # instead of URI::Find::Schemeless ( sub { my ($uri, $originalUri) = @_; return join "", q/<a href="/, encode_entities("$uri"), q/">/, encode_entities($originalUri), q/>/; } ); ...
Yes, I've already complained to the author. He "fixed" the manpage incorrectly, by escaping the entire source text first. That breaks in-page URLs that look like {sigh} I was too worn out explaining to him why that was wrong to submit another fix.

-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.

Comment on •Re: Change URIs in Text to HTML-Links
Select or Download Code

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://211110]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (16)
As of 2015-11-24 22:24 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (664 votes), past polls