An open API service indexing awesome lists of open source software.

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

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

```