Jump To

Linkify HTML String Interface

Use linkify-html to highlight links within strings that contain HTML markup.


Node.js module

Install from the command line with NPM

npm install linkifyjs linkify-html

Import into your JavaScript with require

const linkifyHtml = require("linkify-html");

or with ES modules

import linkifyHtml from "linkify-html";

Browser globals

Download linkify and extract the contents into your website’s assets directory. Include the following scripts in your HTML:

<script src="linkify.js"></script>
<script src="linkify-html.js"></script>


const options = {
  /* … */
const str = "<p>For help with GitHub.com, please email support@github.com</p>";
linkifyHtml(str, options);


'<p>For help with <a href="http://github.com" target="_blank">GitHub.com</a>, please email <a href="mailto:support@github.com">support@github.com</a></p>';


  • string str string to linkify
  • Object [options] Options object

Returns string Linkified HTML string