https://github.com/tylingsoft/markdown-it-regex
Plugin for markdown-it, replaces strings that match a regular expression pattern.
https://github.com/tylingsoft/markdown-it-regex
Last synced: about 1 year ago
JSON representation
Plugin for markdown-it, replaces strings that match a regular expression pattern.
- Host: GitHub
- URL: https://github.com/tylingsoft/markdown-it-regex
- Owner: tylingsoft
- Created: 2017-01-01T08:40:39.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2025-01-07T22:20:38.000Z (over 1 year ago)
- Last Synced: 2025-03-28T07:16:42.681Z (over 1 year ago)
- Language: TypeScript
- Homepage:
- Size: 104 KB
- Stars: 8
- Watchers: 2
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# markdown-it-regex
Plugin for markdown-it, replaces strings that match a regular expression
pattern.
## Installation
```
yarn add markdown-it-regex
```
## Usage
```javascript
import markdownIt from "markdown-it";
import markdownItRegex from "markdown-it-regex";
const mdi = markdownIt();
mdi.use(markdownItRegex, {
name: "emoji",
regex: /(:(?:heart|panda_face|car):)/,
replace: (match) => {
return ``;
},
});
mdi.render("I :heart: you"); //
I you
```