@md-plugins/md-plugin-blockquote
v0.1.0-alpha.29
Published
A markdown-it plugin for Blockquotes with custom styles.
Maintainers
Readme
@md-plugins/md-plugin-blockquote
A Markdown-It plugin that enhances blockquote rendering by adding customizable CSS classes. This allows for easier styling and alignment with design systems, enabling more visually appealing and consistent blockquote presentation.
Features
- Adds customizable CSS classes to
<blockquote>elements. - Supports a default class that can be overridden via plugin options.
Installation
Install the plugin via your preferred package manager:
# with pnpm:
pnpm add @md-plugins/md-plugin-blockquote
# with Yarn:
yarn add @md-plugins/md-plugin-blockquote
# with npm:
npm install @md-plugins/md-plugin-blockquoteUsage
Basic Setup
import MarkdownIt from 'markdown-it'
import { blockquotePlugin } from 'md-plugin-blockquote'
const md = new MarkdownIt()
md.use(blockquotePlugin, {
blockquoteClass: 'custom-blockquote',
})
const markdownContent = `
> This is a blockquote.
`
const renderedOutput = md.render(markdownContent)
console.log('Rendered Output:', renderedOutput)Example Output
The rendered output will include the specified CSS class:
<blockquote class="custom-blockquote">
<p>This is a blockquote.</p>
</blockquote>Options
The md-plugin-blockquote plugin supports the following options:
| Option | Type | Default | Description | | --------------- | ------ | --------------------- | ---------------------------------- | | blockquoteClass | string | 'markdown-blockquote' | CSS class to apply to blockquotes. |
Testing
To run the tests, use the following command:
pnpm testDocumentation
In case this README falls out of date, please refer to the documentation for the latest information.
License
This project is licensed under the MIT License. See the LICENSE file for details.
