added self closing tag option in html5 #935

Closed
wants to merge 1 commit into
from

2 participants

@enwin

Just added the possibility to use self closing tags in html5 as the W3C working draft describes when using the selfClose: true option in the complier.

@ForbesLindesay
Pug member

You're only applying it to void elements; where it has no effect. They can be self closing without the additional / character. Very few elements actually support being made self closing like that and aren't automatically self closing.

@enwin

The point of the PR is to give the developer the ability to use the / character if wanted. This character is not mandatory but neither forbidden.

As the void elements defined in the spec differs from the closing tag lists in self-closing.js and the closing / is used for foreign elements (svg tags) to mark the start tag as self-closing, having the option to force the character when compiling the .jade files could be nice.

@ForbesLindesay
Pug member

The / character never actually has an effect in the situations that this PR would allow it to be used. As such, its addition doesn't really add anything useful. If you want these characters added, just use one of the alternative doctypes supported by html (such as the xhtml transitional).

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