Skip to content

sachaarbonel/furigana.rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Parsing ruby markup annotation

let text = "<ruby>同<rt>どう</ruby>ぜず。";
  println!("{:#?}", ruby(text));//will print out the ast
Ok(
    (
        "",
        Ruby {
            ruby_text: RubyText {
                kanji: "",
                annotation: "どう",
            },
            base_text: "ぜず。",
        },
    ),
)

Serialization

   let ruby = RubyElement::new(
            RubyElement::RubyText("同".to_string(), "どう".to_string()),
            "ぜず。".to_string(),
        );
    ruby.to_string();
<ruby>同<rt>どう</ruby>ぜず。

About

a furigana parser written in nom

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages