Markdown-it Insert Text Plugin

4.0.0 · active · verified Tue Apr 21

markdown-it-ins is a plugin for the popular markdown-it parser that extends its functionality to include support for the HTML `<ins>` (inserted text) tag. It allows users to mark text for insertion using the `++text++` syntax, mirroring the behavior of CommonMark's emphasis rules. The current stable version is 4.0.0, published approximately two years ago, which implies a release cadence tied to upstream `markdown-it` updates or specific feature additions. A key differentiator is its focused purpose: providing `<ins>` tag support specifically for the markdown-it ecosystem, offering a straightforward way to add this semantic markup. While markdown-it itself is highly configurable and extensible, this plugin provides a ready-to-use solution for this specific text-level semantic element without requiring custom rule implementations.

Common errors

Warnings

Install

Imports

Quickstart

Demonstrates how to import and register `markdown-it-ins` with `markdown-it` to process `++text++` markup into `<ins>` HTML tags.

import markdownit from 'markdown-it';
import markdownitIns from 'markdown-it-ins';

// Initialize markdown-it with the ins plugin
const md = markdownit().use(markdownitIns);

// Example usage with ++inserted++ syntax
const markdownText = `Hello, ++this text should be inserted++.\n\nThis is a paragraph with ++another inserted phrase++ and a regular sentence.`;

const htmlOutput = md.render(markdownText);

console.log('Markdown Input:\n', markdownText);
console.log('\nHTML Output:\n', htmlOutput);

// Expected output: <p>Hello, <ins>this text should be inserted</ins>.</p><p>This is a paragraph with <ins>another inserted phrase</ins> and a regular sentence.</p>

view raw JSON →