Skip to content

Void elements spec#436

Open
glebm wants to merge 4 commits into
commonmark:masterfrom
glebm:void-elements-spec
Open

Void elements spec#436
glebm wants to merge 4 commits into
commonmark:masterfrom
glebm:void-elements-spec

Conversation

@glebm

@glebm glebm commented Nov 6, 2016

Copy link
Copy Markdown

Void elements as described in the HTML spec should not start a CommonMark HTML block, because void elements cannot have any content.

The void elements are:

area base br col embed hr img input link menuitem meta param source track wbr

This updates the spec to account for void elements.
Refs #435

@kivikakk

kivikakk commented Nov 7, 2016

Copy link
Copy Markdown
Contributor

@jgm if this looks good to you, I'd be happy to put the changes together to cmark for this.

@wooorm

wooorm commented Nov 7, 2016

Copy link
Copy Markdown
Contributor

There’s some more, mostly legacy elements: basefont, bgsound, command, frame, image, isindex, keygen, nextid listen in HTML, HTML4, and HTML5 (source), which may be useful to add?

@jgm

jgm commented Nov 7, 2016

Copy link
Copy Markdown
Member

Thanks! Let's wait a little longer for comment (I've also
linked this from talk.commonmark.org).

+++ Yuki Izumi [Nov 07 16 00:13 ]:

[1]@jgm if this looks good to you, I'd be happy to put the changes
together to cmark for this.

@glebm

glebm commented Nov 8, 2016

Copy link
Copy Markdown
Author

@wooorm Good catch, I will add the legacy elements to the list.
Update: Added in 3f292b5 ac762f7.

@glebm

glebm commented Nov 8, 2016

Copy link
Copy Markdown
Author

I think another class of tags that should not start an HTML block is self-closing tags. I'll add them as well. What do you think? If you agree, then I can add a separate proposal.

@glebm

glebm commented Nov 11, 2016

Copy link
Copy Markdown
Author

I've started a discussion about self-closing tags and tags closed at the end of the same line that has the starts them here: https://talk.commonmark.org/t/reason-for-starting-an-html-block-when-the-closing-tag-is-on-the-same-line/2290/1

@mity

mity commented Aug 9, 2017

Copy link
Copy Markdown

Void elements as described in the HTML spec should not start a CommonMark HTML block, because void elements cannot have any content.

But the HTML block is not just about having content, but also about not being wrapped by <p>...</p> which will happen if you downgrade those tags to an inline HTML.

Also the HTML blocks with all those start and end conditions are quite simplified and, as such, majority of the block contents does not really have to be valid HTML at all, so trying to interpret something of it more specially IMHO does not make much sense, unless you aim to specify the blocks into more details in other aspects too; e.g. by specifying how the whole block has to look like instead of just those start/end conditions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants