The `markdown-it-mark` package is a plugin for the `markdown-it` markdown parser, designed to extend its functionality by adding support for the HTML `<mark>` tag. It enables users to highlight text within their Markdown documents using the `==text==` syntax, which is then rendered as `<mark>text</mark>`. The current stable version is 4.0.0, last published approximately two years ago, indicating a mature and stable project likely in maintenance mode rather than rapid feature development. This plugin is highly focused, providing a straightforward implementation for text highlighting that adheres to similar rules as CommonMark emphasis. Its key differentiator is its seamless integration with the `markdown-it` ecosystem, offering a lightweight solution for a common formatting need without introducing complex parsing behaviors.
npm install markdown-it-markVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to initialize `markdown-it` and register `markdown-it-mark` to parse and render `==marked==` syntax into `<mark>` HTML tags.
Upgrade `markdown-it` to at least version 10.0.0: `npm install markdown-it@^10.0.0` (or the latest compatible version).
Ensure that `==` delimiters directly surround the text to be marked, without leading or trailing spaces within the delimiters (e.g., `==marked==`, not `== marked ==`).
Ensure `markdownit` is imported and instantiated correctly (e.g., `const markdownit = require('markdown-it'); const md = markdownit();` or `import markdownit from 'markdown-it'; const md = markdownit();`).Run `npm install markdown-it-mark` to install the package. Verify the import/require path matches your module system configuration.
Ensure `md.use(markdownitMark)` is called after `markdown-it` initialization. Check that the markdown syntax is `==text==` with no internal spaces, similar to CommonMark emphasis rules.