/ piacw.com / dev / final / node_modules / markdown-it-regex /

[ICO]NameLast modifiedSizeDescription
[PARENTDIR]Parent Directory  -  
[DIR]src/2 years ago -  
[DIR]test/2 years ago -  
[TXT]README.md2 years ago619 0fb859dc fixed mobile overflwo options [كارل مبارك]
[   ]package.json2 years ago1.7K0fb859dc fixed mobile overflwo options [كارل مبارك]
[   ]webpack.config.js2 years ago862 0fb859dc fixed mobile overflwo options [كارل مبارك]
[   ]yarn.lock2 years ago124K0fb859dc fixed mobile overflwo options [كارل مبارك]
README.md

markdown-it-regex

Plugin for markdown-it, replaces strings that match a regular expression pattern.

Installation

yarn add markdown-it-regex

Usage

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
Apache/2.4.38 (Debian) Server at www.karls.computer Port 80