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
When passed through highlightAuto or highlight with ignore_illegals turned on, will cause an infinite loop, specifically, because of '$' as an illegal in CSS selector attributes:
@wooorm Please review fix. Do you think my catch-all is overkill? I really think we've covered everything now with being/end 0 width detection plus illegal 0 width detection. Am I just being paranoid adding a third check?
I just think freezes like this a VERY VERY bad things.
Lgtm. Loop check is very heavy, but may be good indeed.
Weirdly enough, this used to work in 9.16 (or at least in the lowlight clone since when it started). I’m not sure what changed: i looked a bit through git blame and the ‘m’ flag isn’t new, and I didn’t see anything else that was weird 🤷♂️
Heavy handed perhaps. I'm not sure it's that CPU heavy. I run a few test iterations and couldn't see a measurable difference with the typical marge of changes I usually see.
Oh it could probably be faster if we just started iterations with a negative # and then compared without the multiplication... but now I think i'm micro-optimizing without a real problem. :)
Yeah, not worth it to figure out why... something prolly changed, but 0 width matches with illegal is definitely an edge case that needs to be handled to make sure the cursor advances.
On 10.0.1, the following XML:
When passed through
highlightAuto
orhighlight
withignore_illegals
turned on, will cause an infinite loop, specifically, because of'$'
as an illegal in CSS selector attributes:highlight.js/src/languages/css.js
Line 72 in e8624cc
The text was updated successfully, but these errors were encountered: