On Sep 30, 2022, at 12:38 AM, Darren Duncan <[email protected]> wrote:
> 
> Modern HTML must follow all the XML rules, which is that tags in pairs look 
> like "<foo></foo>" and standalone tags look like "<foo/>".  Whether or not 
> there is whitespace before a "/" is a stylistic choice, but the "/" MUST be 
> present in standalone tags.  Having "<br>" by itself is wrong, full stop. -- 
> Darren Duncan

According to the HTML5 standard at WHATWG, https://html.spec.whatwg.org/ 
<https://html.spec.whatwg.org/>, dated 28 September 2022, in Section 1.8, HTML 
vs XML syntax (non-normative):
> There are various concrete syntaxes that can be used to transmit resources 
> that use this abstract language, two of which are defined in this 
> specification.
> 
> The first such concrete syntax is the HTML syntax. This is the format 
> suggested for most authors. It is compatible with most legacy web browsers. 
> If a document is transmitted with the text/html 
> <https://html.spec.whatwg.org/multipage/iana.html#text/html> MIME type 
> <https://mimesniff.spec.whatwg.org/#mime-type>, then it will be processed as 
> an HTML document by web browsers. This specification defines the latest HTML 
> syntax, known simply as "HTML".
> 
> The second concrete syntax is XML. When a document is transmitted with an XML 
> MIME type <https://mimesniff.spec.whatwg.org/#xml-mime-type>, such as 
> application/xhtml+xml 
> <https://html.spec.whatwg.org/multipage/iana.html#application/xhtml+xml>, 
> then it is treated as an XML document by web browsers, to be parsed by an XML 
> processor. Authors are reminded that the processing for XML and HTML differs; 
> in particular, even minor syntax errors will prevent a document labeled as 
> XML from being rendered fully, whereas they would be ignored in the HTML 
> syntax.
> 


See also my previous reply to Omar KN, quoting from the same standard to the 
effect that the terminal slash in void element tags is optional.

I believe that the only HTML version that required consistency with XML syntax 
was XHTML, which is scarcely a modern HTML at this point.

Regards,
Neil Faiman

-- 
This is the BBEdit Talk public discussion group. If you have a feature request 
or need technical support, please email "[email protected]" rather than 
posting here. Follow @bbedit on Twitter: <https://twitter.com/bbedit>
--- 
You received this message because you are subscribed to the Google Groups 
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/bbedit/4B1A281D-0C73-4FD3-832D-267B76800C29%40faiman.org.

Reply via email to