markdown-it-marked
TypeScript icon, indicating that this package has built-in type declarations

0.3.3 • Public • Published

markdown-it-marked

On NPM CI status UMD size

Plugin for markdown-it for marking substrings within text.

Supports insertion of <mark/> elements to show render-time configured matches such as search text results or other context not in the markdown input string.

For having <mark/> with markdown syntax see markdown-it-mark plugin instead.

Install

npm install --save markdown-it-marked

Use

import MarkdownIt from 'markdown-it';
import {envFromTerms, plugin as markedPlugin} from 'markdown-it-marked';

const md = MarkdownIt().use(markedPlugin);

const html = md.render('some text to _render_', envFromTerms(['text']));
// html === '<p>some <mark>text</mark> to <i>render</i></p>\n'

TODO

  • Add instructions for transpiling with application settings.
  • Fancy unicode handling for \b replacement.
  • Attribute setting from match via replacement override.

Package Sidebar

Install

npm i markdown-it-marked

Weekly Downloads

21

Version

0.3.3

License

Apache-2.0

Unpacked Size

23 kB

Total Files

12

Last publish

Collaborators

  • bz2
  • mingya_zhou