Title: Lookbehind in number regexp crashes Safari · Issue #106 · scriptcoded/sql-highlight · GitHub
Open Graph Title: Lookbehind in number regexp crashes Safari · Issue #106 · scriptcoded/sql-highlight
X Title: Lookbehind in number regexp crashes Safari · Issue #106 · scriptcoded/sql-highlight
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 o...
Open Graph 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://cani...
X 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://cani...
Opengraph URL: https://github.com/scriptcoded/sql-highlight/issues/106
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Lookbehind in number regexp crashes Safari","articleBody":"**Describe the bug**\r\nThe 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.\r\n\r\n**To Reproduce**\r\n1. Import sql-highlight `getSegments` in your browser bundle.\r\n2. Load your page on Safari.\r\n3. Page crashes with \"syntax error: invalid regular expression: invalid group specifier name\".\r\n\r\n(Or just type `/((?\u003c![a-zA-z])\\d+(?:\\.\\d+)?)/g` on Safari console.)\r\n\r\n**Expected behavior**\r\nCode should compile.\r\n\r\n**sql-highlight (please complete the following information):**\r\nv4.3.1 (latest)\r\n\r\n**Node.js (please complete the following information):**\r\nNot applicable.\r\n\r\n**Browser (please complete the following information):**\r\nMacOS Safari 16.3 (latest)\r\n","author":{"url":"https://github.com/tmadeira","@type":"Person","name":"tmadeira"},"datePublished":"2023-03-14T17:35:33.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/106/sql-highlight/issues/106"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:fa644f4f-436b-f46f-7190-d65a104e4ad8 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 928A:32780D:FC5401:1461A77:69929AD7 |
| html-safe-nonce | cf3eb5f69506761b79932f7bd27323793f18d120edf44d54861566d0a02ee171 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MjhBOjMyNzgwRDpGQzU0MDE6MTQ2MUE3Nzo2OTkyOUFENyIsInZpc2l0b3JfaWQiOiI1MjE1MDUwNjcwOTgyNDcwMzU5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 0a7107293a49854f2bede9dd8ee66e0248a894e71856ea831815084e56e526ad |
| hovercard-subject-tag | issue:1623990741 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/scriptcoded/sql-highlight/106/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b00ca1b502ff54677893ab16dcb5c90f4d55c590f3d1fff14b8bce79d0be2cf0/scriptcoded/sql-highlight/issues/106 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b00ca1b502ff54677893ab16dcb5c90f4d55c590f3d1fff14b8bce79d0be2cf0/scriptcoded/sql-highlight/issues/106 |
| og:image:alt | 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://cani... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | tmadeira |
| hostname | github.com |
| expected-hostname | github.com |
| None | 42c603b9d642c4a9065a51770f75e5e27132fef0e858607f5c9cb7e422831a7b |
| turbo-cache-control | no-preview |
| go-import | github.com/scriptcoded/sql-highlight git https://github.com/scriptcoded/sql-highlight.git |
| octolytics-dimension-user_id | 6452991 |
| octolytics-dimension-user_login | scriptcoded |
| octolytics-dimension-repository_id | 147309066 |
| octolytics-dimension-repository_nwo | scriptcoded/sql-highlight |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 147309066 |
| octolytics-dimension-repository_network_root_nwo | scriptcoded/sql-highlight |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 848bc6032dcc93a9a7301dcc3f379a72ba13b96e |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width