Markdown comments

Allan Odgaard 29mtuz102 at sneakemail.com
Sun Sep 17 20:15:44 EDT 2006


On 18/9/2006, at 1:30, John Gruber gruber-at-fedora.net |Markdown|
wrote:


> [...] Interesting. I had no idea that SGML comment rules were being

> officially or semi-officially abandoned for HTML parsers. I

> certainly welcome this change.


The HTML specification sort of defines comments [1]:

> [...] A common error is to include a string of hyphens
> ("---") within a comment. Authors should avoid putting two
> or more adjacent hyphens inside comments.

So it is an error, and authors *should* avoid it, which I read as,
don’t do it because it gives problems, but it’s not really illegal.

Of course another place [2] in the specification they write:

> Please consult the SGML standard for information about rules
> governing elements (e.g., they must be properly nested, an
> end tag closes, back to the matching start tag, all unclosed
> intervening start tags with omitted end tags (section
> 7.5.1), etc.).

I.e. HTML is an SGML application, and thus normal SGML rules apply,
hinting that the bit about comments is really just trying to say that
because of de facto standards, one should not expect full SGML
comments to be supported.

I find the above (quoted) paragraph a bit ironic, considering that I
have not found a browser which fully adheres to the rule they quote
(about an end-tag closing back to the matching start tag).



[1] http://www.w3.org/TR/html4/intro/sgmltut.html#h-3.2.4
[2] http://www.w3.org/TR/html4/intro/sgmltut.html#h-3.2.1



More information about the Markdown-Discuss mailing list