calliope icon indicating copy to clipboard operation
calliope copied to clipboard

Attributes with names ending with "id" get interpreted as the "id" attribute

Open benkuhn opened this issue 8 years ago • 1 comments

Steps to repro (on version 0.3.0, first and fourth lines are the bug):

iex(1)> Calliope.render(".foo{attr-id: \"bar\"}")
"<div id=\"bar\" class=\"foo\" attr-></div>"
iex(2)> Calliope.render(".foo{attr-id-bar: \"bar\"}")
"<div class=\"foo\" attr-id-bar=\"bar\"></div>"
iex(3)> Calliope.render(".foo{id-bar: \"bar\"}")
"<div class=\"foo\" id-bar=\"bar\"></div>"
iex(4)> Calliope.render(".foo(attr-id= \"bar\")")
"<div id=\"bar\" class=\"foo\" attr-></div>"

I'd expect the output of the first/fourth line to be "<div class=\"foo\" attr-id=\"bar\"></div>" similar to lines 2/3. I ran across this while trying to create an element with a data-form-id attribute, which I couldn't find a way to do.

benkuhn avatar Jul 31 '16 17:07 benkuhn

@benkuhn on version 0.4.1 there is not this issue anymore)

papergliff avatar Sep 10 '16 11:09 papergliff