davidrios / pug-tmbundle

A comprehensive textmate / sublime text bundle for the Pug (formerly Jade) template language.
https://github.com/davidrios/pug-tmbundle
MIT License
48 stars 20 forks source link

"style." breaks the syntax highlighter #12

Closed Dan503 closed 1 year ago

Dan503 commented 7 years ago

Every time without fail the pug syntax highlighting will completely break after a style element followed by a "." is used.

p this paragraph #[strong will] have the correct highlighting

//-this will break the pug highlighter and throw an error even though it is valid pug syntax
style.
    .element { background: red; }

p this paragraph will #[strong not] have any highlighting

It displays this error message when the pug template contains a dotted style block:

empty range in char class in regex (?=[\w.:#\[*-&]|@nest)
alexkuz commented 7 years ago

Also, this template would crash Sublime completely:

style(type='text/css').
      body {
        margin: 1rem;
      }
luxlogica commented 7 years ago

@Dan503 , @alexkuz can you confirm whether this bug has been fixed? I've just tried both your examples with the current stable build of Sublime - build 3126 - and the Pug package, and they both seem to work fine...

abrenneke commented 6 years ago

This is still happening for me. Pug package 1.0.1, Sublime 3 build 3175

brwnrclse commented 5 years ago

Hello, this issue is still happening for me 3190.

I found a similar bug and fix in different language tmbundle repository but maybe the solution here is similar?

https://github.com/alexlouden/Terraform.tmLanguage/commit/cc9fb7e02874929c73542db47283f7583bbbd6fd

davidrios commented 1 year ago

Please comment if you think this is still relevant.