Crates.io | markdown-it-ruby |
lib.rs | markdown-it-ruby |
version | 1.0.0 |
source | src |
created_at | 2024-09-12 16:53:21.946667 |
updated_at | 2024-09-12 16:53:21.946667 |
description | A markdown-it plugin for parsing ruby text |
homepage | |
repository | https://github.com/LemmyNet/lemmy-markdown-it-plugins |
max_upload_size | |
id | 1372945 |
size | 42,414 |
A markdown-it
plugin to process ruby text.
To load the plugin:
let mut parser = markdown_it::MarkdownIt::new();
markdown_it::plugins::cmark::add(&mut parser);
markdown_it_ruby::add(&mut parser);
let html = parser.parse("{漢|Kan}{字|ji}").xrender();
assert_eq!(html, String::from("<p><ruby>漢<rp>(</rp><rt>Kan</rt><rp>)</rp></ruby><ruby>字<rp>(</rp><rt>ji</rt><rp>)</rp></ruby></p>\n"));