ruby-slim.tmbundle icon indicating copy to clipboard operation
ruby-slim.tmbundle copied to clipboard

#{ } constructor becomes comment in attributes wrapper

Open jumbosushi opened this issue 8 years ago • 2 comments

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

jumbosushi avatar Sep 28 '16 18:09 jumbosushi

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

unspecified

ml avatar Dec 09 '16 18:12 ml

@ml @jumbosushi This is actually tricky to do.

  1. The highlighter handles any line that starts with = or - as Ruby code
  2. 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.
  3. 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?

tshedor avatar Sep 17 '17 21:09 tshedor