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

HTML-style attributes aren't always fontified #23

Closed
scalisi opened this issue Jan 20, 2013 · 5 comments
Closed

HTML-style attributes aren't always fontified #23

scalisi opened this issue Jan 20, 2013 · 5 comments

Comments

@scalisi
Copy link

scalisi commented Jan 20, 2013

When an HTML element has HTML-style attributes with values that are specified using single quotes, only the first attribute and value for the element will be fontified.

%p(fontified='Fontified' not-fontified='Not fontified')
@purcell
Copy link
Collaborator

purcell commented Jan 20, 2013

Thanks for the report! Yes -- as you've discovered, that style of attributes is not well supported in haml-mode. I rather suspect the style isn't very widely used, but I'll take a look if I get a chance. The code for highlighting attribute hashes is somewhat involved... :-/

@scalisi
Copy link
Author

scalisi commented Jan 20, 2013

Hey, Steve. I previously read haml-mode's code in an effort to resolve the issue, but I got lost and gave up (I lack experience with Emacs Lisp). I read the code again just now, and the issue is revolved when a single quote is added to the regular expression on line 717:

unless (haml-move "['a-z0-9_:\\-]+")

Update: The above change seems to break other fontification.

purcell added a commit that referenced this issue Jan 21, 2013
Without this, parsing of new-style (html-style) attribute hashes gets
confused because forward-sexp across a single-quoted attribute value
leaves point before the final quote, rather than after it.
@purcell
Copy link
Collaborator

purcell commented Jan 21, 2013

The fix ended up being a little more subtle, but easy nonetheless. Let me know if you have any problems with the new version. :-)

@purcell purcell closed this as completed Jan 21, 2013
@scalisi
Copy link
Author

scalisi commented Jan 23, 2013

Thanks for resolving so many issues, Steve. I didn't receive notifications when you resolved the issues I previously posted, and I'm very happy with the improved syntax highlighting. I really appreciate your help. Thanks again.

@purcell
Copy link
Collaborator

purcell commented Jan 23, 2013

No problem. Odd that github didn't notify you; thanks for checking back in.

-Steve

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

2 participants