0.4.5 • Published 5 years ago

linkable v0.4.5

Weekly downloads
3
License
MIT
Repository
github
Last release
5 years ago

linkable-js

Build Status Coverage Status

Detect URL, Email, Hashtag and Mention from plain-text and convert into HTML clickable hyperlink.

Install

$ npm install --save linkable

Usage

Demo

  import Linkable from 'linkable'

  const text = 'This is test with a #hashtag from @linkable on github.com'
  const linkable = new Linkable()
  console.log(
    linkable.replaceLinks(text)
  )

Output:

This is test with <a href="/hashtag/#hashtag">#hashtag</a> from <a href="/@linkable">@linkable</a> on <a href="http://github.com">github.com</a>

Options

for more details see src/index.js file

const options = {
  mentionStyle: 'twitter',
  replaceHashtag: replaceHashtag,
  replaceMention: replaceMention,
  replaceUrl: replaceUrl,
  replaceEmail: replaceEmail
}
0.4.5

5 years ago

0.4.4

5 years ago

0.4.3

5 years ago

0.4.1

5 years ago

0.4.0

5 years ago

0.3.0

5 years ago

0.2.4

5 years ago

0.2.3

5 years ago

0.2.2

5 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.1.5

5 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago