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

make the closing "/" character optional for the void HTML elements #74

Closed
wants to merge 1 commit into from

Conversation

PK1A
Copy link
Contributor

@PK1A PK1A commented Feb 24, 2014

Fixes #70
Closes #74

@@ -0,0 +1,13 @@
##### Template:
# template test
Hello<br>World</br>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a
opening element in the template

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the error message is not the best after this change :-/
Let me see if I can quickly fix it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about this message: "An orphan end element </br> is not needed, <br> is a void HTML element"?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest:
</whatevervoidelem> and/or <whatevervoidelem/> is not needed here. As a void HTML element just <whateverelem> is fine

in which we replace dynamically whateverelem

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My 2 cents here:

  • <br/> is not necessary as <br> is perfectly fine, but
  • </br> is not just "not needed", it is wrong.

Only the second point should be raised (as an error.)

@piuccio
Copy link
Contributor

piuccio commented Feb 25, 2014

<br> is a void element and has no closing tag </br>
or just
<br> has no closing tag </br>

@benouat
Copy link
Member

benouat commented Feb 25, 2014

I would still enforce the void element as a warning. Just to make sure that people that does not know will learn something.

My concern here is quite simple. Let's consider something that does not know void elements syntax (or even just void elements period):

  • he might write <br></br>
  • we might display an error such as <br> is a void element and has no closing tag </br>

What would be the first reaction ? I am pretty sure it might be this one

  • he will change the code to <br/>

People probably doesn't know void elements, if if you suggest that the closing tag is not mandatory, they will self close if...

Which is totally fine, as @olaf-k mentioned. This is perfectly valid (even in html5, or x-html5 I would say..).
So for me, we should take the opportunity, via a warning message, to educate our user with a nice message that a void html element such as <br> or <input> is fine! <br/> or <input/> is not needed

@PK1A PK1A closed this in 917a580 Feb 25, 2014
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.

Void elements
5 participants