How are attributes with dash (-) treated?
In this example, how is stroke-width=5 treated? The parser complains about this.
<svg>
<circle cx="25" cy="75" r="20" stroke="red" fill="transparent" stroke-width="5"/>
</svg>
I think this could be easier if done using the same way javascript allow type to be accessed using a camel-case on the identifier that has a dash.
example: z-index could be accessed in javascript using zIndex.
so stroke-width=5 will become strokeWidth=5.
This is similar to https://github.com/chinedufn/percy/issues/106#issuecomment-474647127 where the parser currently assumes that all attributes are composed of a single identifier.
Note the single input.parse() here.
https://github.com/chinedufn/percy/blob/344e757206de0c2c134b79ed596676489290ca93/crates/html-macro/src/tag.rs#L143
The solution is peeking for a - and if there is one parsing two more identifiers, concatenating their to_string's and then creating a new identifier using that new String.
As with https://github.com/chinedufn/percy/issues/106#issuecomment-474647127 we'd want a test for this.
I can take a look next time I'm working on the parser. If you'd like to take a look in the meantime I'd be happy to provide more detailed instructions.
Cheers and thanks for opening the issue!!
Hi, any chance of raising the priority of this issue as its a showstopper for Accessibility aria-* and bootstrap data-* attributes. Thanks
as well for http-equiv in meta tags