Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Void elements spec #436

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Conversation

glebm
Copy link

@glebm glebm commented Nov 6, 2016

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
Copy link
Contributor

kivikakk commented Nov 7, 2016

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

@wooorm
Copy link
Contributor

wooorm commented Nov 7, 2016

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
Copy link
Member

jgm commented Nov 7, 2016

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
Copy link
Author

glebm commented Nov 8, 2016

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

@glebm
Copy link
Author

glebm commented Nov 8, 2016

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
Copy link
Author

glebm commented Nov 11, 2016

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
Copy link

mity commented Aug 9, 2017

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.

None yet

5 participants