Closed HookedBehemoth closed 2 years ago
Unfortunately <foo/>
is not correct according to the spec:
Start tags consist of the following parts, in exactly the following order:
- A "<" character.
- The element’s tag name.
- Optionally, one or more attributes, each of which must be preceded by one or more space characters.
- Optionally, one or more space characters.
- Optionally, a "/" character, which may be present only if the element is a void element.
- A ">" character.
The optional /
character has no significance to HTML parsers, so it does not have the effect you desire. For instance, <div/><div/>
is equivalent to <div><div>
.
For void elements, those that do not require a closing tag, you can use ;
instead of {}
.
Thanks for letting me know. Came from xmpp and just assumed this would be XML standard.
I have a pending feature request for XML support at #62. It's a bit more complicated than it looks because of 🅰️ context-aware escaping and 🅱️ namespaces.
This changes the emited markup with tags like this:
use href="#page" {}
from<use href="#page"></use>
to<use href="#page"/>
. Other tags this is useful for are e.g. video and all svg subtags.