@mdit/plugin-spoiler
Plugins to hide content.
Usage
TS
import MarkdownIt from "spoilerdown-it";
import { spoiler } from "@mdit/plugin-spoiler";
const mdIt = MarkdownIt().use(spoiler);
mdIt.render("VuePress Theme Hope is !!powerful!!.");
JS
const MarkdownIt = require("spoilerdown-it");
const { spoiler } = require("@mdit/plugin-spoiler");
const mdIt = 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.
Demo
Demo
VuePress Theme Hope is powerful.
VuePress Theme Hope is !!powerful!!.
Options
export interface MarkdownItSpoilerOptions {
/**
* @default "span"
*/
tag?: string;
/**
* @default [["class", "spoiler"], ["tabindex","-1"]]
*/
attrs?: [string, string][];
}