This is not correct. HTML5 HTML syntax allows for
self-closing tags in
foreign elements (e.g. when having an svg embedded directly in the
document), it does not allow for self-closing tags for HTML void
elements (those that don't have a closing tag, like <img>), raw text or
normal elements (which have mandatory closing tags).
This is not correct. The HTML5 specification, 13.1.2.1:
Then, if the element is one of the void elements, or
if the element is a
foreign element, then there may be a single U+002F SOLIDUS character (/),
which on foreign elements marks the start tag as self-closing. On void
elements, it does not mark the start tag as self-closing but instead is
unnecessary and has no effect of any kind.
It "does not mark the start tag as self closing" of course because in an
HTML parser context the element is inherently self closing and needs no such
mark. But the syntax is explicitly supported here.
However if you do <img src=foo.png/> (which is
valid in
HTML, but not XML) the '/' actually becomes part of the 'src' attribute
value, meaning that the file 'foo.png/' is used as src.
Yes. This unfortunate edge case is mentioned also in the spec, however if
using well-formed XML it is fortunately not possible to run into it.
For normal elements where a closing tag is mandatory,
the unnecessary
empty '/' attribute works the same, meaning the HTML parser is still
waiting for the closing tag after a seamingly self-closed element. As
an example <div><strong />Hey</div> will render "Hey" in bold
when
parsed as HTML (because the strong is not closed), but not when parsed
as
XHTML.
https://gist.github.com/mar-v-in/7aa612d173d02240b7d2124c18670ec3
is an example file, which when you save it with .html ending and open
it in a browser, it will make the last line bold, if you rename the
file to .xhtml, the last line won't be bold - because the file ending
is translated to an appropriate MIME type and the XML parser is
triggered. I reproduced this on both Firefox and Chromium and it
matches the specification.
Yes sure, old XHTML mime type had all kinds of extra things like this and
that's part of why people got grumpy about it.
Anyway, I still haven't heard of the features and
functionality that
people aim to get by reinstating XHTML-IM that XEP-0394 couldn't
provide as well or even better.
XEP-0394 is a non-starter for me. An attempt to re-invent HTML ourselves
with character ranges instead of markup? An attempt to do markup in XML
without resorting to... actually using markup? If anything as I said in my
first post the existence ofr 0394 in experimental shows that there is a
desire for a stable standard for rich text in XMPP using XML, and indeed we
already have a much better one in XHTML-IM.