input element allows name attribute values "isindex", ""
Today I learned that you can't use the "isindex" value for the name attribute of e.g. : https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#attr-fe-name
Neither is an empty name allowed, but tyxml accepts both:
let _ = Tyxml.Html.(input ~a:[a_name "isindex"]) ()
let _ = Tyxml.Html.(input ~a:[a_name ""]) ()
It is personally not a problem for me, but since you advertise in the README that "TyXML is a library for building statically correct HTML5 [...] documents" I thought I would let you know :D
Thanks for the report !
These days, Tyxml's credo is to encode as many criterion it can into the type system, but without bothering programmers, and without ever raising dynamic validity failure!
That particular constraint is definitely not something we can catch statically in the typesystem. The best we could really do is to escape isindex (and avoiding emitting empty names). Personally, unless someone can present me a convenient solution that is well rendered by browsers, I'm inclined to let it pass.
Thanks for the answer! I think that's a very reasonable approach and goal. So I guess "statically correct HTML5" could be interpreted as things we can statically verify. Do you think it would make sense to document the limitations in the README? I guess they are few.
Please feel free to close this issue either way.