1 stable release
1.0.0 | Sep 12, 2024 |
---|
#2233 in Parser implementations
203 downloads per month
16KB
105 lines
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
~6–15MB
~213K SLoC