highlight.js
highlight.js copied to clipboard
Time to finally allow negative lookbehind?
I just checked and the latest versions of Safari (that now support negative lookbehind) [16.4, 16.5, etc] go all the way back to Big Sur, supporting:
- Big Sur (November 12, 2020)
- Montery (October 25, 2021)
- Ventura (October 24, 2022)
- Sonoma (September 26, 2023)
Big Sur support extends all the way back to Mac's from 2013. I have some sympathy for those who hold off a while on OS releases, but little for those who would avoid installing the newest version of Safari (since often there are security fixes, etc)... so I think if we allow support for negative lookbehind we'd only be dropping support for Mac's 10+ years old or those refusing to upgrade their Safari - in which case I'd suggest they use another browser instead, such as Chrome.
So I say it's time to allow look-behind...
Thoughts, @allejo ?
As long as the introduction of negative lookbehinds in grammars is introduced in 12.0 and not in our 11.x series, you have my support :+1:
Solely on principle for semantic versioning, I'd be hesitant to introduce a breaking change in browser support in a minor release
I have quite a few personal lexers that really require the use of lookbehinds as my current workarounds do not work for all cases. Is there a timeline on when lookbehinds will be allowed?
Well if they are truly personal, just use them... it's only the core library that we aren't allowing them in v11 because of semantic versioning. I haven't had much time lately to do a major release but it's a long weekend so I'll take a look at where we stand with v12...
@allejo The old website handled us being able to publish two major versions at once - and it just did the right thing (pay attention to the new one)... does the new website share this characteristic - what if say we pushed a few 12.0.0-beta or alpha relases? (the old website would also ignore alpha/betas, etc)
Ah it looks like all I needed to do was change the ecmaVersion to 2018 in the config to allow it to work. Thanks!