https://github.com/nasa8x/markdown-it-redirect
Replace / Redirect external links with Markdown-it Plugin
https://github.com/nasa8x/markdown-it-redirect
mardown markdown-it markdown-it-plugin
Last synced: about 1 month ago
JSON representation
Replace / Redirect external links with Markdown-it Plugin
- Host: GitHub
- URL: https://github.com/nasa8x/markdown-it-redirect
- Owner: nasa8x
- License: mit
- Created: 2019-09-23T03:40:42.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-04T11:13:13.000Z (over 3 years ago)
- Last Synced: 2025-12-30T16:25:50.886Z (4 months ago)
- Topics: mardown, markdown-it, markdown-it-plugin
- Language: HTML
- Homepage: https://morioh.com/topic/node-js
- Size: 401 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 14
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Replace / Redirect external links with Markdown-it Plugin
Markdown-it Plugin repalce external links with redirect link.
### If you don't know Node.js
[Node.js Tutorial for Beginners in 2020](https://morioh.com/p/0907cef2141c)
[How To Build a Blog with Nest.js, MongoDB, and Vue.js](https://morioh.com/p/74ffc8a798bb)
[Machine Learning In Node.js With TensorFlow.js](https://morioh.com/p/a517bc403340)
### Install
```js
npm i markdown-it-redirect --save
```
### Example
```js
var redirect = require('markdown-it-redirect');
var md = require('markdown-it')({ html: true}).use(redirect, {
// default option
redirect: 'https://l.morioh.com/b0a3f595aa?r=',
regex: {
link: /((http|https):\/\/(?!([^/]+\.)?morioh.com)[\w\.\/\-=?#]+)/i,
html: /(https://morioh.com/p/e446a15a1022\
https://learnstartup.net/p/rJHeJJdk6l');
```
```js
// result
https://morioh.com/p/e446a15a1022
https://learnstartup.net/p/rJHeJJdk6l
https://morioh.com/p/e446a15a1022
https://learnstartup.net/p/rJHeJJdk6l
```