SMPTE / html-pub

Tools for publishing SMPTE documents as HTML documents
BSD 3-Clause "New" or "Revised" License
1 stars 0 forks source link

Conflict between XML and HTML5 requirements? #272

Open jhursty opened 2 weeks ago

jhursty commented 2 weeks ago

The guide says:

The main element shall be an HTML document represented using the XML syntax, as specified at [HTMLStandard]

but https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#technical_summary says (near the end:)

Tag omission | Must have a start tag and must not have an end tag.

XML does not allow unclosed tags, so it is not possible to comply with both requirements.

Chrome and Firefox are fine with closed img, so I did not notice until the CI said:

Stray end tag "img"

If it is possible to support well-formed XML that would be the preferred solution. Doing so would make using standard XML validation tools more accessible during massive cut-and-paste development.

jhursty commented 2 weeks ago

Oh by the way a is in the same boat, but I noticed it earlier because the preview via tooling complained.

palemieux commented 2 weeks ago

Don't <img/> and <a></a> comply with both HTML5 and XML syntax?

jhursty commented 2 weeks ago

Yes, <img/> works. I was perhaps confused because <a/> does not. I think I may have normalized <img/> to <img></img> to be congruent with <a></a>. Since we have a tooling layer, is there any way we could address this so that either form works for either case? Would be great to use <a/>.