-
-
Notifications
You must be signed in to change notification settings - Fork 14
Closed
Description
Describe the bug
The regular expression at https://github.com/scriptcoded/sql-highlight/blob/master/lib/index.js#L42 uses lookbehind, which is currently not supported by latest Safari (https://caniuse.com/js-regexp-lookbehind) and some other browsers; caniuse says that its global support is 76.9%. Safari considers that the code has a syntax error, crashing the page.
To Reproduce
- Import sql-highlight
getSegments
in your browser bundle. - Load your page on Safari.
- Page crashes with "syntax error: invalid regular expression: invalid group specifier name".
(Or just type /((?<![a-zA-z])\d+(?:\.\d+)?)/g
on Safari console.)
Expected behavior
Code should compile.
sql-highlight (please complete the following information):
v4.3.1 (latest)
Node.js (please complete the following information):
Not applicable.
Browser (please complete the following information):
MacOS Safari 16.3 (latest)
Metadata
Metadata
Assignees
Labels
No labels