Re: Slash or no slash?

"Jukka K. Korpela" <[email protected]> Sun, 08 Mar 2015 23:28:00 +0200
Newsgroups gmane.org.w3c.validator.css
Message-ID <[email protected]>
2015-03-05, 15:21, David Dorward wrote:

> On 3 Mar 2015, at 14:20, Bill Byrd wrote:
>
>     Immediately below your snippet for the =E2=80=9Cpassed the validati=
on=E2=80=9D
>     badge, you have this...
>
>     (close the img tag with > instead of /> if using HTML <=3D 4.01)
>
>     To me, that suggests that HTML5 user WOULD use the forward slash.
>     That=E2=80=99s not correct is it?
>
> It is correct. The |/| character is optional in HTML 5.

No, it is optional only in HTML serialization; in XHTML serialization,=20
you need to use either <img .../> or <img ...></img>.

> See Stackoverflow: Are self-closing tags valid in HTML5?
> <http://stackoverflow.com/questions/3558119/are-self-closing-tags-valid=
-in-html5>

So much confusion... after years of improving the answers there, the=20
approved answer is still wrong in this respect: it does not recognize=20
that HTML5 comes with two syntaxes.

The instructions are confusing, but not formally incorrect. They give=20
instructions for XHTML, then give instructions for non-XHTML HTML, but=20
express this in an odd way. They apparently reflect ideas of the time=20
when XHTML was fashionable and was regarded as the modern HTML,

It would be simpler to give just HTML syntax without the =E2=80=9C/=E2=80=
=9D. Everyone=20
who uses XHTML should be expected to know what to do.

And it would be even simpler to remove all that advice on using =E2=80=9C=
this=20
icon=E2=80=9D. The validator should simply report the errors it has detec=
ted, or=20
say =E2=80=9CNo errors detected.=E2=80=9D Suggestions to use some icons a=
re just a=20
distraction and bad advice; the wording about =E2=80=9C/=E2=80=9D is just=
 a minor=20
addition to the confusion.

Yucca