How to make a text link to hyperlinks in Facebook comments? Plugin comment

Now it is very difficult. I recently saw many blogs have facebook comment plugins where anyone can comment and post relevant links.

But the problem is that the links are in the text and are not hyperlinks, or you might say they are not clickable.

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

Now my question is, how did this user do it? I mean from text to hyperlink. Becks usually doesn't. I have searched a lot of things on google, but I cannot get the correct method.

+3


source to share


1 answer


The user does not do something that looks like a hyperlink as a hyperlink, a web page does!

What's going on is that script by page uses reg, looks for regex to match urls in comments. When a match is found, it will be displayed as a hyperlink if it doesn't match the regular expression, which it just displays as flat text, not a hyperlink. It's either built into the Facebook comment plugin or the website itself,

When text is rendered in HTML, it cannot tell what is and is not a link. However, if you process it through a script to identify links as links, you can tell them to display them as hyperlinks rather than plain text.



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

T; p Users don't, plug-in / webpage does it. Except for plugins that require the use of link tags in the case of the page you linked, although that's all that Facebook version of the plugin is.

0


source







All Articles