markdown-it-ruby

Crates.iomarkdown-it-ruby
lib.rsmarkdown-it-ruby
version1.0.0
sourcesrc
created_at2024-09-12 16:53:21.946667
updated_at2024-09-12 16:53:21.946667
descriptionA markdown-it plugin for parsing ruby text
homepage
repositoryhttps://github.com/LemmyNet/lemmy-markdown-it-plugins
max_upload_size
id1372945
size42,414
(SleeplessOne1917)

documentation

README

License Latest version Downloads for latest version

markdown-it-ruby.rs

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

cargo fmt