Crates.io | markdown-it-block-spoiler |
lib.rs | markdown-it-block-spoiler |
version | 1.0.0 |
source | src |
created_at | 2024-09-12 16:52:49.647391 |
updated_at | 2024-09-12 16:52:49.647391 |
description | A markdown-it plugin for parsing block spoilers |
homepage | |
repository | https://github.com/LemmyNet/lemmy-markdown-it-plugins |
max_upload_size | |
id | 1372940 |
size | 43,172 |
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"));