slim-template / ruby-slim.tmbundle

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

#{ } constructor becomes comment in attributes wrapper #66

Open jumbosushi opened 7 years ago

jumbosushi commented 7 years ago

Attributes wrapper ref: http://www.rubydoc.info/gems/slim/frames#Attributes

When #{ } is used after second line inside an attributes wrapper, the string followed after # is considered as a comment

I noticed this error on github, and I recognized that github syntax lib was getting the syntax from this repo. Let me know if this should be issued else where.

screen shot 2016-09-28 at 11 19 50 am
ml commented 7 years ago

Actually it happens everywhere, not only in attributes wrapper. Everything after # is being interpreted as a comment:

unspecified

tshedor commented 7 years ago

@ml @jumbosushi This is actually tricky to do. 1) The highlighter handles any line that starts with = or - as Ruby code 1) github/linguist handles the syntax highlighting across projects. I did some digging and found this line, which considers everything a comment after # on a Ruby line. 1) Sublime (where I'm testing the highlighting) handles this ably. However, Github's syntax highlighting seems to cherrypick a lot of the definitions. How they choose which definitions to use and ignore I'm still not sure.

I don't know of a way around this on Github without interfering with the Ruby definition. Do you have any ideas?