https://github.com/uiur/link-text
Autolink text
https://github.com/uiur/link-text
Last synced: 3 months ago
JSON representation
Autolink text
- Host: GitHub
- URL: https://github.com/uiur/link-text
- Owner: uiur
- License: isc
- Created: 2015-10-29T09:35:48.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2018-05-25T02:14:03.000Z (about 7 years ago)
- Last Synced: 2025-03-03T04:05:58.733Z (3 months ago)
- Language: JavaScript
- Homepage:
- Size: 28.3 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# link-text
[![npm][npm-image]][npm-url]
[![travis][travis-image]][travis-url][npm-image]: https://img.shields.io/npm/v/link-text.svg?style=flat-square
[npm-url]: https://www.npmjs.com/package/link-text
[travis-image]: https://img.shields.io/travis/uiureo/link-text.svg?style=flat-square
[travis-url]: https://travis-ci.org/uiureo/link-textA function to autolink text. It turns text into linked text with anchor tags.
```js
var link = require('link-text')link('foo https://google.com bar')
//=> 'foo https://google.com bar'link('aaa ')
//=> 'aaa <script>'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](LICENSE)