Implement nested lists

This commit is contained in:
Juno Takano 2026-01-07 15:11:50 -03:00
commit e42c67676d
11 changed files with 475 additions and 131 deletions

View file

@ -16,7 +16,7 @@ impl CheckBox {
impl Parseable for CheckBox {
fn probe(lexeme: &Lexeme) -> bool {
lexeme.match_triple_as_char(('[', ' ', ']'))
|| lexeme.match_triple_as_char(('[', 'x', ']'))
|| lexeme.match_triple_as_char(('[', 'x', ']'))
}
fn lex(lexeme: &Lexeme) -> CheckBox {
@ -30,11 +30,7 @@ impl Parseable for CheckBox {
}
fn render(&self) -> String {
let toggle = if self.checked {
" checked "
} else {
""
};
let toggle = if self.checked { " checked " } else { "" };
format!(r#"<input type="checkbox"{toggle}/>"#)
}
}