You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
thread 'main' panicked at /home/user/.local/share/cargo/git/checkouts/syntect-e33b39f181e4f0f4/d023aaa/src/parsing/regex.rs:70:53:
regex string should be pre-tested: Error(OnigError(-104), end pattern at escape)
regex_impl::Regex::new(&self.regex_str).expect("regex string should be pre-tested")
There should be some way to get Result::Err from some function call to be able to show in stderr what exactly went wrong. This error is generally "invalid regex" or more specifically "invalid regex: backslash doesn't escape anything".
I was able to remove panic by validating the regex before searching:
But this wouldn't give away any Error. I also don't see any way to use Regex::try_compile() directly in Typst/MRA code, therefore some other way of validating all regexes in a .sublime-syntax file should be added.
The text was updated successfully, but these errors were encountered:
Hello, I discovered a panic in Typst: typst/typst#4421. I was able to recreate the panic and the use case of the library in Typst:
syntect/src/parsing/regex.rs
Line 70 in d023aaa
There should be some way to get
Result::Err
from some function call to be able to show in stderr what exactly went wrong. This error is generally "invalid regex" or more specifically "invalid regex: backslash doesn't escape anything".I was able to remove panic by validating the regex before searching:
syntect/src/parsing/regex.rs
Lines 64 to 65 in d023aaa
But this wouldn't give away any
Error
. I also don't see any way to useRegex::try_compile()
directly in Typst/MRA code, therefore some other way of validating all regexes in a.sublime-syntax
file should be added.The text was updated successfully, but these errors were encountered: