# markdown-it-regexp

> plugin that makes regexp replacement simple

Latest version **0.4.0** (published 2015-06-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install markdown-it-regexp
pnpm add markdown-it-regexp
yarn add markdown-it-regexp
bun add markdown-it-regexp
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.4.0 |
| Published | 2015-06-06 |
| First published | 2015-06-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 54 |
| Author | Alex Kocharin |
| Maintainers | rlidwka |
| Keywords | markdown-it-plugin |

## Links

- npm: https://www.npmjs.com/package/markdown-it-regexp
- Repository: https://github.com/rlidwka/markdown-it-regexp
- Issues: https://github.com/rlidwka/markdown-it-regexp/issues
- npm.io page: https://npm.io/package/markdown-it-regexp

## Alternatives

- [@mdxeditor/editor](https://npm.io/package/@mdxeditor/editor.md) — 962.4K weekly downloads
- [mmdb-lib](https://npm.io/package/mmdb-lib.md) — 680.9K weekly downloads
- [playcanvas](https://npm.io/package/playcanvas.md) — 36.2K weekly downloads
- [@glw907/cairn-cms](https://npm.io/package/@glw907/cairn-cms.md) — 967 weekly downloads
- [markdown-to-confluence](https://npm.io/package/markdown-to-confluence.md) — 103 weekly downloads

## Recent versions

- 0.4.0 (latest) — 2015-06-06

## README

Make simple [markdown-it](https://github.com/markdown-it/markdown-it) plugins easier.

## Usage:

```js
var md     = require('markdown-it')
var Plugin = require('markdown-it-regexp')

var plugin = Plugin(
  // regexp to match
  /@(\w+)/,

  // this function will be called when something matches
  function(match, utils) {
    var url = 'http://example.org/u/' + match[1]

    return '<a href="' + utils.escape(url) + '">'
         + utils.escape(match[1])
         + '</a>'
  }
)

md()
  .use(plugin)
  .render("hello @user")

// prints out:
// <p>hello <a href="http://example.org/u/user">user</a></p>
```

## Fair warning:

1. it could be slower than you expect
2. it is a draft, breaking changes might happen

---
_Source: https://npm.io/package/markdown-it-regexp · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
