-
Notifications
You must be signed in to change notification settings - Fork 9
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
Support class option hash for eruby #52
Comments
No, that's fine -- the definitions are all attempted, and the "smallest" match wins. The problem is that the pattern is surrounded by double-quotes, and those evaluate backslashes. If you
And you can see the start pattern starts with I'm not sure if I it makes sense to keep this in the default definitions, since it's specific to the rails helper, and not a feature of ERB itself. Still, I guess it wouldn't be a practical problem, and it's true that most ERB is rails... Would you like to see this in the defaults, or are you happy to use this in your own override? If you'd like, you could create a PR with the change, and I can probably be persuaded to merge it. |
I'm fine with having this be an override. I can imagine encountering a gem that use some variation of the name Thanks for clearing that up! I've learned some things that should useful for future changes. Actually the customization section in help covers this pretty well, sorry! |
I find myself having the same problem constantly with classes in option hashes in ERB. I've gotten used to stopping myself from using this plugin's functionality in that one context, but it's a constant point of tiny friction I tried using @jdsutherland implementation, then modifying it based on @AndrewRadev's response, but couldn't get it to work... I know it's an old issue but if anyone can help I would be really grateful 🙏 |
@pooriar I've added support to the repo in the eruby-classes branch. Could you try it out and see if the patterns in that form work? |
It'd be nice if #41 worked for option hashes in eruby:
I tried implementing this myself:
but the existing seemed to take precedence. I'm guessing the regex:
would have to negative lookahead for
class:
?The text was updated successfully, but these errors were encountered: