Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: How to recognize url in text and convert to hyperlink, unless already in anchor

by DrHyde (Prior)
on Oct 12, 2004 at 08:51 UTC ( [id://398421]=note: print w/replies, xml ) Need Help??


in reply to How to recognize url in text and convert to hyperlink, unless already in anchor

Do it in two stages. First unwrap any URLs that the user has already wrapped in <a ...> ... </a> tags. Then wrap all URLs in <a ...> ... </a> tags.

Alternatively, don't allow your users to put the tags in in the first place! This makes it easier to protect yourself and your users against craziness involving some of the other attributes of the <a> tag, like target, onclick and so on.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (5)
As of 2024-04-19 12:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found