Implement nested formatting

This commit is contained in:
Juno Takano 2026-01-10 01:18:47 -03:00
commit 3837af387a
7 changed files with 78 additions and 57 deletions

View file

@ -6,11 +6,11 @@ use crate::{
Parseable as _,
parser::{
lexeme::Lexeme,
token::{
Token, oblique::Oblique, bold::Bold, underline::Underline,
strike::Strike,
},
state::State,
token::{
Token, bold::Bold, checkbox::CheckBox, oblique::Oblique,
strike::Strike, underline::Underline,
},
},
},
};
@ -50,6 +50,12 @@ pub fn parse(
tokens.push(Token::Bold(Bold::new(!state.switches.bold)));
state.switches.bold = !state.switches.bold;
return true;
} else if CheckBox::probe(lexeme) {
log!("CheckBox probed: {lexeme}");
tokens.push(Token::CheckBox(CheckBox::lex(lexeme)));
iterator.next();
iterator.next();
return true;
}
false
}