I started talking about this on #172 but figured that it might be best to open a new issue, since the problem described in the original ticket differs from what I'm seeing.
What I am seeing is if a Haml view in my application contains a data attribute formatted as follows:
.component{ data: { foo_bar: 'baz' } }
When I try to "deface" this view, I am left with:
<div class='component'>
So Deface (or Nokogiri) is gobbling up my data attributes.
I've confirmed that this form in the original template will work:
.component{ 'data-foo-bar' => 'baz' }
Possible points of interest:
My project is a meta gem, which contains 3 engines:
One responsible for an administration panel
One responsible for a user facing interface
One responsible for the common abstractions between the two, this is where our dependencies are managed
I'm including Deface as part of an external engine, or plugin, to my app.
My app is:
Using nokogiri 1.10.3
Using rails 5.2.3
Using haml 5.0.4
Using deface 1.3.2
I made a standalone Rails app to see if I could reproduce, and I could, but only in reverse. This was unexpected, but showcases that there is a problem, somewhere, with parsing of data attributes.
I started talking about this on #172 but figured that it might be best to open a new issue, since the problem described in the original ticket differs from what I'm seeing.
What I am seeing is if a Haml view in my application contains a data attribute formatted as follows:
When I try to "deface" this view, I am left with:
So Deface (or Nokogiri) is gobbling up my data attributes.
I've confirmed that this form in the original template will work:
Possible points of interest:
I made a standalone Rails app to see if I could reproduce, and I could, but only in reverse. This was unexpected, but showcases that there is a problem, somewhere, with parsing of data attributes.
Here's the Rails app: https://github.com/meowsus/deface-haml5-bug
This time in the deface partial I am losing my data attributes. More information can be found on the original ticket (#172)
I hope this helps. Any ideas where this bug might be occurring would be very helpful.
Thanks in advance.