Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/withspectrum/markdown-linkify
Turn plain URLs in text into Markdown links. Works in the browser and on the server.
https://github.com/withspectrum/markdown-linkify
linkify linkify-text markdown
Last synced: about 1 month ago
JSON representation
Turn plain URLs in text into Markdown links. Works in the browser and on the server.
- Host: GitHub
- URL: https://github.com/withspectrum/markdown-linkify
- Owner: withspectrum
- License: mit
- Archived: true
- Created: 2017-07-08T19:05:38.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-11-10T14:01:16.000Z (about 5 years ago)
- Last Synced: 2024-09-30T16:41:48.964Z (3 months ago)
- Topics: linkify, linkify-text, markdown
- Language: JavaScript
- Size: 171 KB
- Stars: 23
- Watchers: 4
- Forks: 5
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# `markdown-linkify`
Turn plain URLs in text into Markdown links. Works in the browser and on the server.
## Usage
1. Input: `"Made by folks from https://spectrum.chat"`
2. Output: `"Made by folks from [https://spectrum.chat](https://spectrum.chat)"````javascript
const linkify = require('markdown-linkify');const text = 'Made by folks from https://spectrum.chat'
const linked = linkify(text);console.log(linked)
// -> 'Made by folks from [https://spectrum.chat](http://spectrum.chat)'
```We use [`linkify-it`](http://npm.im/linkify-it) to detect URLs which supports major TLDs without protocol (`google.com`, `facebook.net` etc) and everything that uses a protocol. (e.g. `https://bla.bullshit`, `mailto:[email protected]`) We err on the side of being certain and not-linkifying rather than over-linkifying.
## Installation
```sh
npm install --save markdown-linkify
# or if you have yarn installed
yarn add markdown-linkify
```## License
Licensed under the MIT License, Copyright ©️ 2017 Maximilian Stoiber. See [LICENSE.md](LICENSE.md) for more information.