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]