>Optionally, a "/" character, which may be present only if the element is a void element.
>There is absolutely no difference between <br> and <br />.
>Actually, one might argue that adding / to a void tag is an ignored syntax error.
>every browser and parser should not handle <br> and <br /> any differently
If it's optional and has absolutely no effect and makes no difference, how exactly would one argue that it's an error?
To me, this is like saying `print ${SHELL}` is erroneous because the braces don't do anything and `print $SHELL` does exactly the same thing. It may be superfluous, but it's not erroneous.
It is erroneous. It only makes no difference because the error is ignored (or rather rendering is wrong). In HTML properly rendered <br/> would produce extra ">" on each occurrence.
IIRC there was a browser (some reference implementation) that did this correctly. Also, I remember Gecko used to flag these slashes in source view too.
HTML5 has a list of tags for which a trailing solidus is not producing an error. It's still not something the parser ever uses for anything besides sometimes producing an error. "<br/>" is tolerated whereas "<script/>" for instance is a parsing error.
Is erroneous because one of the stated goals of HTML5 is semantic value, and under any line of logic you cannot close something that isn't open, therefore is an error, albeit not (yet?) a technical one.
>There is absolutely no difference between <br> and <br />.
>Actually, one might argue that adding / to a void tag is an ignored syntax error.
>every browser and parser should not handle <br> and <br /> any differently
If it's optional and has absolutely no effect and makes no difference, how exactly would one argue that it's an error?
To me, this is like saying `print ${SHELL}` is erroneous because the braces don't do anything and `print $SHELL` does exactly the same thing. It may be superfluous, but it's not erroneous.