jquery-linkify

2.2.1 • Public • Published

Linkify jQuery Plugin

Linkify is jQuery plugin to formatting the text that contains URL or hashtag into a clickable HTML content.

Usage

Include the plugin script

<script src="jquery.linkify.js" type="text/javascript"></script>
$("#content").linkify();

or to enable the hashtag link

function toHashtagUrl(hashtag) {
  return "http://myservice.com?q=" + hashtag;
}
 
$("#content-with-hashtag").linkify(toHashtagUrl);

or if you want to disable the URL that does't include http

function toHashtagUrl(hashtag) {
  return "http://myservice.com?q=" + hashtag;
}
 
$("#content-with-hashtag").linkify({
    hashtagUrlBuilder: toHashtagUrl, 
    includeW3: false
});

or to specify the target for links

$("#content").linkify({
    target: "_blank"
});

Readme

Keywords

none

Package Sidebar

Install

npm i jquery-linkify

Weekly Downloads

151

Version

2.2.1

License

ISC

Last publish

Collaborators

  • laszlof