3

Now this is very tricky thing. I have recently seen that many blogs do have facebook comment plugins where anyone can comment and place relevant links.

But the problem is those links are in text and are not hyperlink or you can say not clickable.

I found here in this article post right down you can see a facebook comment plugin, there you can see a text link is a hyperlink. http://www.huffingtonpost.com/2014/11/25/black-friday-apple-deals-2014_n_6211754.html

Now my question how did that user do that? i mean from text to hyperlink. Becz normally it won't happen. I have searched lot of stuff in google but i am not able to get the correct method.

  • did you find the solution? If yes, please share it, I am also stuck with same problem, how to add clickable hyperlinks in facebook comment plugin on my site. I am using fatpanda facebook comment plugin on my wordpress site. – shairya Dec 13 '14 at 16:32
  • You can start with this question's resources for some help: http://stackoverflow.com/questions/37684/how-to-replace-plain-urls-with-links – dmanexe Jun 10 '15 at 23:36

1 Answers1

0

The user doesn't make something that looks like a hyper-link display as a hyper-link, the webpage does!

What happens is that the scripting behind the page is using a reg is looking for a regular expression to pattern match URLs in the comments. When a match is found it'll be displayed as a hyper-link, if it doesn't match the regex it just displays as flat text instead of a hyper-link This either built into the Facebook comment plug-in or the website itself.

When text gets passed to HTML it has no way of telling what is and is not a link However if you process it through a script to identify links as being links you can tell it to display them as hyper-links rather than just plain text.

A great example/explanation of this is over at http://regexr.com/39i0i

Tl;Dr Users don't make it happen, the plug-in/webpage make it happen. With the exception of plug ins that require you use link tags, in the case of the page you linked though that is all that version of the Facebook plugin.

Spooler
  • 222
  • 1
  • 10