From 527d63ed25d668eeb24e21ff441429fbcc7ad6a5 Mon Sep 17 00:00:00 2001 From: Nathan Varner <17197562+nvarner@users.noreply.github.com> Date: Tue, 2 Jan 2024 04:08:07 -0500 Subject: [PATCH] Don't stop parsing markup text for braces (#3112) --- crates/typst-syntax/src/lexer.rs | 4 ++-- crates/typst-syntax/src/reparser.rs | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/crates/typst-syntax/src/lexer.rs b/crates/typst-syntax/src/lexer.rs index ecb800ba3..4800c8def 100644 --- a/crates/typst-syntax/src/lexer.rs +++ b/crates/typst-syntax/src/lexer.rs @@ -311,8 +311,8 @@ impl Lexer<'_> { table! { | ' ' | '\t' | '\n' | '\x0b' | '\x0c' | '\r' | '\\' | '/' - | '[' | ']' | '{' | '}' | '~' | '-' | '.' | '\'' | '"' - | '*' | '_' | ':' | 'h' | '`' | '$' | '<' | '>' | '@' | '#' + | '[' | ']' | '~' | '-' | '.' | '\'' | '"' | '*' | '_' + | ':' | 'h' | '`' | '$' | '<' | '>' | '@' | '#' }; loop { diff --git a/crates/typst-syntax/src/reparser.rs b/crates/typst-syntax/src/reparser.rs index 1b7dc42fe..157c075b4 100644 --- a/crates/typst-syntax/src/reparser.rs +++ b/crates/typst-syntax/src/reparser.rs @@ -301,6 +301,8 @@ mod tests { test("a\n#let \nb", 7..7, "i", true); test(r"#{{let x = z}; a = 1} b", 7..7, "//", false); test(r#"a ```typst hello```"#, 16..17, "", false); + test("a{b}c", 1..1, "#", false); + test("a#{b}c", 1..2, "", false); } #[test]