convert-links

2.0.0 • Public • Published

Convert links

Detect and convert links and email addresses to HTML hyperlinks sanely.

convertLinks("The greatest page in the world is http://www.cwtsite.com I swear!")
// The greatest page in the world is <a href="http://www.cwtsite.com" target="_blank">http://www.cwtsite.com</a> I swear!

Add CSS classes to the link:

convertLinks("http://www.cwtsite.com", ['with-style'])
// <a href="http://www.cwtsite.com" target="_blank" class="with-style">http://www.cwtsite.com</a>

Tests

node test.js

Package Sidebar

Install

npm i convert-links

Weekly Downloads

1

Version

2.0.0

License

MIT

Unpacked Size

5.45 kB

Total Files

4

Last publish

Collaborators

  • zemke