-
Notifications
You must be signed in to change notification settings - Fork 128
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
HAML 5 broken #172
Comments
🏏 s |
I am having a similar issue, almost a year and a half later it looks like. If I have a partial located at .foobar
%div{ data: { foo_bar: '' } } And an override at Deface::Override.new(
virtual_path: 'shared/_fields',
name: 'my_fields',
insert_top: '.foobar',
partial: 'shared/my_fields'
) And the new partial at %div{ data: { baz: '' } } The expected output should be: <div class='foobar'>
<div data-baz=''></div>
</div>
<div data-foo-bar=''></div> But it is actually: <div class='foobar'>
<div data-baz=''></div>
</div>
<div></div> Whatever data attributes I have already defined in the partial I want to deface are stripped, but the partial I'm inserting remains unmolested. For what it's worth this seems to be happening before the insertion is happening. If I run Here are the versions of as many gems as I can think of that might be related to the problem:
Please let me know if I can help in any way to figure this out, as it's a total showstopper from me being able to use this in my project :| Thanks in advance for your time! |
So I had some time before my day finished so I spurred up a demo to help in debugging: https://github.com/meowsus/deface-haml5-bug What's funny is that I'm having the same issue, but just in reverse; the data attribute of the partial being injected is losing its data attribute. Something's going on for sure. If you have a minute, take a peek at the repo I set up. Here's a screenshot of the compiled source: That I really hope this helps! |
Deface works until HAML 5 beta 2. If you update to HAML 5 then Deface will break all the attributes. This is what happens:
I have this layout file (summarized):
When I use Haml 5 with this file then rails throws at me this error:
When I use the stack trace to debug
value
in the HAML Parser class it returns"\"data-erb-lang\" => \"<%= I18n.locale %>\""
. This is wrong.However, if I write the attributtes in the HTML element in the old ruby rocket style, like this:
It outputs this:
It silently fails to parse the attributes.
The text was updated successfully, but these errors were encountered: