mbylstra / html-to-elm

An online tool for converting HTML to elm-html. Go to
http://mbylstra.github.io/html-to-elm/
395 stars 23 forks source link

Convert Bool and Int tag attributes to specific Html.Attribute functions, rather than the generic `attribute` function #16

Open mbylstra opened 8 years ago

mbylstra commented 8 years ago

Currently for any html attributes that take bools or ints, such as <input readonly=true> or <input tabindex=2>, the generic Html.Attribute.attribute function is used for the conversion. For example, tabindex=2 will be converted to attribute "tabindex" "2" rather than the preferable tabindex 2 from Html.Attribute.tabindex.

For bool attributes, it should be able to handle the absence of an attribute value, such as <input readonly>, and convert that to input [readonly True] []