#markdown-it #plugin #markdown #spoiler

markdown-it-block-spoiler

A markdown-it plugin for parsing block spoilers

3 stable releases

1.0.2 Feb 22, 2025
1.0.1 Dec 13, 2024
1.0.0 Sep 12, 2024

#2796 in Parser implementations

Download history 166/week @ 2025-05-24 204/week @ 2025-05-31 258/week @ 2025-06-07 189/week @ 2025-06-14 204/week @ 2025-06-21 132/week @ 2025-06-28 156/week @ 2025-07-05 169/week @ 2025-07-12 185/week @ 2025-07-19 111/week @ 2025-07-26 63/week @ 2025-08-02 57/week @ 2025-08-09 118/week @ 2025-08-16 76/week @ 2025-08-23 163/week @ 2025-08-30 202/week @ 2025-09-06

568 downloads per month

GPL-3.0 license

20KB
105 lines

License Latest version Downloads for latest version

markdown-it-block-spoiler.rs

A markdown-it plugin to process block spoliers.

To load the plugin:

let mut parser = markdown_it::MarkdownIt::new();
markdown_it::plugins::cmark::add(&mut parser);

markdown_it_block_spoiler::add(&mut parser);

let html = parser.parse("::: spoiler _click to see more_\nhow spicy!\n:::\n").xrender();
assert_eq!(html, String::from("<details><summary>_click to see more_</summary>how spicy!\n</details>\n"));

Dependencies

~5–15MB
~190K SLoC