Skip to content
This repository was archived by the owner on Sep 1, 2026. It is now read-only.
nunof07Public archive

About

Markdown-it plugin to create Bootstrap alerts

Topics

Resources

Stars

5 stars

Watchers

1 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

Repository files navigation

markdown-it-alerts

Markdown-it plugin to create Bootstrap alerts.

E.g.:

::: warning
Hello world! [Link](#).
:::

Gets converted to:

<div class="alert alert-warning" role="alert">
<p>Hello world! <a href="#" class="alert-link">Link</a>.</p>
</div>

Install

$ npm install markdown-it-alerts --save

Usage

Enable plugin

var md = require('markdown-it');
var alerts = require('markdown-it-alerts');

md().use(alerts);

Options

Enable/disable adding class alert-link to links inside alerts.

var md = require('markdown-it');
var alerts = require('markdown-it-alerts');

md().use(alerts, {links: false});

Example

With option links enabled (by default):

This is a test. [Link](#).

::: success
Hello world! [Link](#).
:::

This is a test. [Link](#).

Gets converted to:

<p>This is a test. <a href="#">Link</a>.</p>
<div class="alert alert-success" role="alert">
<p>Hello world! <a href="#" class="alert-link">Link</a>.</p>
</div>
<p>This is a test. <a href="#">Link</a>.</p>

About

Markdown-it plugin to create Bootstrap alerts

Topics

Resources

Stars

5 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages