slim-template / ruby-slim.tmbundle

A Textmate / Sublime Text bundle for Slim
http://slim-lang.com/
MIT License
184 stars 46 forks source link

New leading/trailing whitespace syntax incorrectly detected as Ruby #42

Closed noinkling closed 10 years ago

noinkling commented 10 years ago

The old =' syntax works fine, but in the newer => syntax the > gets detected as Ruby. There's a bunch of possible combinations too:

=<
=>
=<>
=><
=<'
='<

plus all the double-equals (==) variants of these.

The relevant regex is at line 559 here. I think something like this would work:

(==|=)(<>|><|<'|'<|<|>|')?|-

(except with the pointy brackets XML-escaped). I tried making it more elegant than that but it was difficult not making it match =<<, ='', etc.

Edit: I opened a PR (#43).