Fix lexer behavior on non-whitespace before ref (#4553)

This commit is contained in:
Yip Coekjan 2024-07-14 20:54:51 +08:00 committed by GitHub
parent 98d98a4bfd
commit 4d8976b619
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 1 deletions

View File

@ -474,7 +474,7 @@ impl Lexer<'_> {
Some('-') if !s.at(['-', '?']) => {}
Some('.') if !s.at("..") => {}
Some('h') if !s.at("ttp://") && !s.at("ttps://") => {}
Some('@') if !s.at(is_id_start) => {}
Some('@') if !s.at(is_valid_in_label_literal) => {}
_ => break,
}

View File

@ -54,3 +54,8 @@ $ A = 1 $ <eq2>
// Error: 1-7 label occurs in the document and its bibliography
@arrgh
#bibliography("/assets/bib/works.bib")
--- issue-4536-non-whitespace-before-ref ---
// Test reference with non-whitespace before it.
#figure[] <1>
#test([(#ref(<1>))], [(@1)])