@mdit/plugin-spoiler
Plugins to hide content.
Usage
import { spoiler } from "@mdit/plugin-spoiler";
import MarkdownIt from "markdown-it";
const mdIt = new MarkdownIt().use(spoiler);
mdIt.render("VuePress Theme Hope is !!powerful!!.");With the default options, you can import @mdit/plugin-spoiler/style to apply styles.
Syntax
Use !! !! hide contents.
Options
tag
stringDefault
"span"HTML tag name for the spoiler element.
attrs
[attr: string, value: string][] | (() => [attr: string, value: string][])Default
() => [["class", "spoiler"], ["tabindex","-1"]]Custom HTML attributes for the spoiler element. A static array is cloned for every token; a factory function is called once per token and must return a new array (recommended for dynamic attributes).
Demo
VuePress Theme Hope is powerful.
Demo
VuePress Theme Hope is !!powerful!!.See the comparison report for the full upstream comparison.