[ICO]NameLast modifiedSizeDescription
[PARENTDIR]Parent Directory  -  
[DIR]src/2023-06-08 13:46 -  
[DIR]test/2023-06-08 13:46 -  
[TXT]README.md2023-06-08 13:46 619 0fb859dc fixed mobile overflwo options [كارل مبارك]
[   ]package.json2023-06-08 13:46 1.7K0fb859dc fixed mobile overflwo options [كارل مبارك]
[   ]webpack.config.js2023-06-08 13:46 862 0fb859dc fixed mobile overflwo options [كارل مبارك]
[   ]yarn.lock2023-06-08 13:46 124K0fb859dc fixed mobile overflwo options [كارل مبارك]
# 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 `<i class="e1a-${match.slice(1, -1)}"></i>`
  }
})
mdi.render('I :heart: you') // <p>I <i class="e1a-heart"></i> you</p>
```


## Development

### Build

```
yarn run build
```

### Test

```
yarn test
```