Closed JulianVGit closed 4 months ago
More correctly, the code will enter an infinite loop, because you have defined a parameter to be an empty string, and there are infinitely many empty strings in any string. So the formatter will correctly detect infinite amount of these custom parameters.
The formatter could possibly check whether the supplied regex is an empty string, and throw a more friendly error message instead of getting stuck in infinite loop. If you're really interested in getting a better error in this specific case, I'm open to a pull request.
However there are infinitely many regexes that would end up matching empty string (for example (|)
) and therefore triggering an infinite loop. It's not really feasible to properly validate them all.
Oh well. As I'm already looking into this code, might as well add this little extra check.
When supplying and empty regex as a custom param for syntax, the browser crashes: