+ 1

How to transform plain text URL into html hyperlink?

for example I want to be able to change www.sololearn.com into <a href="www.sololearn.com" />.

12th Jul 2017, 5:03 PM
mexikodro thanksgiving samples 1/1
mexikodro thanksgiving samples 1/1 - avatar
7 Réponses
+ 1
If I'm understanding you correctly, you're not wanting to display the link, but simply want the code itself to be shown? <pre><a href="sololearn.com">test</a></pre> For the < and >, use & lt; and & gt; instead. (remove spaces from char code) <pre> & lt;a href="sololearn.com"& gt; test & lt; /a & gt; </pre> *EDIT* I forgot Code Playground was a thing. Here you go. :P https://code.sololearn.com/WYlCR1rWWZ7E/#html
12th Jul 2017, 5:27 PM
AgentSmith
+ 2
a simple url is always a hyperlink.. there's nothing link html hyperlink.. if u want to write a Html code for your url or hyperlink.. u need to use anchor tag <a></a> and place your link in between it as href attribute's value.. <a href="https://www.sololearn.com">Sololearn</a>
12th Jul 2017, 5:15 PM
Мг. Кнап🌠
Мг. Кнап🌠 - avatar
+ 2
thank you guys, upvoted
12th Jul 2017, 5:30 PM
mexikodro thanksgiving samples 1/1
mexikodro thanksgiving samples 1/1 - avatar
+ 1
https://code.sololearn.com/WYlCR1rWWZ7E/#html ^That's what you're looking for I believe.
12th Jul 2017, 5:28 PM
AgentSmith
0
no, you don't understand. I want every plain text URL in for example, a chat website, to be clickable (so transformed into a hyperlink <a /> of course I know how to make a link... this would work with a PHP code for example
12th Jul 2017, 5:17 PM
mexikodro thanksgiving samples 1/1
mexikodro thanksgiving samples 1/1 - avatar
0
ok u mean to say when you click on any link then it's Html code gets generated ?
12th Jul 2017, 5:25 PM
Мг. Кнап🌠
Мг. Кнап🌠 - avatar
0
yeah something like that
12th Jul 2017, 5:25 PM
mexikodro thanksgiving samples 1/1
mexikodro thanksgiving samples 1/1 - avatar