From ac9258496572edc95fcfead8eb95cd66d8aa85a9 Mon Sep 17 00:00:00 2001 From: Nolan Date: Wed, 23 Oct 2024 15:17:59 -0400 Subject: [PATCH] support labels with key+command --- crates/parser/src/latex.rs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/crates/parser/src/latex.rs b/crates/parser/src/latex.rs index 8393f19d..d6b60cf2 100644 --- a/crates/parser/src/latex.rs +++ b/crates/parser/src/latex.rs @@ -863,7 +863,20 @@ impl<'a> Parser<'a> { } if self.lexer.peek() == Some(Token::LCurly) { - self.curly_group_word(); + self.builder.start_node(CURLY_GROUP_WORD.into()); + self.eat(); + self.trivia(); + + if self.peek() == Some(Token::Word) || self.peek() == Some(Token::Pipe) { + self.key(); + } + + if let Some(Token::CommandName(_)) = self.peek() { + self.content(ParserContext::default()); + } + + self.expect(Token::RCurly); + self.builder.finish_node(); } self.builder.finish_node();