#plugin #markdown #markdown-it #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

#2130 in Parser implementations

Download history 207/week @ 2024-11-22 157/week @ 2024-11-29 195/week @ 2024-12-06 342/week @ 2024-12-13 84/week @ 2024-12-20 103/week @ 2024-12-27 117/week @ 2025-01-03 313/week @ 2025-01-10 248/week @ 2025-01-17 178/week @ 2025-01-24 273/week @ 2025-01-31 282/week @ 2025-02-07 258/week @ 2025-02-14 332/week @ 2025-02-21 311/week @ 2025-02-28 251/week @ 2025-03-07

1,196 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"));

lib.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

~7–15MB
~219K SLoC