markdown-it-block-spoiler

Crates.iomarkdown-it-block-spoiler
lib.rsmarkdown-it-block-spoiler
version1.0.0
sourcesrc
created_at2024-09-12 16:52:49.647391
updated_at2024-09-12 16:52:49.647391
descriptionA markdown-it plugin for parsing block spoilers
homepage
repositoryhttps://github.com/LemmyNet/lemmy-markdown-it-plugins
max_upload_size
id1372940
size43,172
(SleeplessOne1917)

documentation

README

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"));
Commit count: 0

cargo fmt