link-text

0.0.2 • Public • Published

link-text

npm travis

A function to autolink text. It turns text into linked text with anchor tags.

var link = require('link-text')
 
link('foo https://google.com bar')
//=> 'foo <a href="https://google.com">https://google.com</a> bar'
 
link('aaa <script>')
//=> 'aaa &lt;script&gt;'
 
link('https://google.com', { target: '_blank' })
//=> '<a href="https://google.com" target="_blank">https://google.com</a>'
 
link('https://ja.wikipedia.org/wiki/%E5%AF%BF%E5%8F%B8')
//=> '<a href="https://ja.wikipedia.org/wiki/%E5%AF%BF%E5%8F%B8">https://ja.wikipedia.org/wiki/寿司</a>'

Install

npm install link-text

License

ISC

Readme

Keywords

none

Package Sidebar

Install

npm i link-text

Weekly Downloads

519

Version

0.0.2

License

ISC

Unpacked Size

4.75 kB

Total Files

7

Last publish

Collaborators

  • uiureo