Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#{ } constructor becomes comment in attributes wrapper #66

Open
jumbosushi opened this issue Sep 28, 2016 · 2 comments
Open

#{ } constructor becomes comment in attributes wrapper #66

jumbosushi opened this issue Sep 28, 2016 · 2 comments

Comments

@jumbosushi
Copy link

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
Copy link

ml commented Dec 9, 2016

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

unspecified

@tshedor
Copy link
Member

tshedor commented Sep 17, 2017

@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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants