textmate / css.tmbundle

TextMate support for CSS
54 stars 36 forks source link

Wrong syntax highlighting for minifed css file where code is after closing comment #26

Closed jcubic closed 8 years ago

jcubic commented 8 years ago

I have minified css file that is not highlighted correctly, the whole file is mark as comment, here is sample using lightshow.

infininight commented 8 years ago

OK, you can get confirmation from Github on this issue but I believe I know the cause. There is nothing wrong with the grammar itself, the same code snippet parses in TextMate just fine. It appears that GitHub's parser has a time limit or length limit per-line before the parser cancels out and returns the line unparsed. So it's not actually matching as a comment it just never gets closed as that is on the line with the rest of the CSS.

You can verify this by having a short snippet of one line CSS that matches fine, keep duplicating it on the end and it will eventually stop being matched.