Why does Lemmy output horribly invalid HTML?
from onehundredsixtynine@sh.itjust.works to nostupidquestions@lemmy.world on 24 Sep 10:28
https://sh.itjust.works/post/46658981

Just look at W3C validator results for lemmy.world’s homepage.

#nostupidquestions

threaded - newest

betterdeadthanreddit@lemmy.world on 24 Sep 10:53 next collapse

Could bring that up with the devs but it hasn’t been the early 2000s for a long time, nobody seems to care as long as it works.

einkorn@feddit.org on 24 Sep 11:12 next collapse

Which is a shame. Browser should be strict when rendering.

  • Multiple IDs with the same name? Jail!
  • Open tags? Jail!
  • Invalid order of tags? Believe it or not: Jail!
betterdeadthanreddit@lemmy.world on 24 Sep 11:16 next collapse

I choose to imagine that these offenses result in developers cooling their heels in the slammer rather than a browser being a picky eater.

onehundredsixtynine@sh.itjust.works on 24 Sep 11:26 next collapse

Interesting fact: Firefox (or Gecko to be accurate, because there was no single “Firefox” browser back then - there was Netscape Navigator and Mozilla Application Suite) had such rendering mode, but it was quickly abandoned.[1]


  1. hsivonen.fi/doctype/: “In the summer of 2000 before Netscape 6 was released, Gecko actually had parser modes that enforced HTML syntax rules and one of these modes was called the “Strict DTD”. These modes were incompatible with existing Web content and were abandoned.”
Dojan@pawb.social on 24 Sep 11:39 next collapse

Oh my gods I wish. I was working on a webapp some months ago and was having the weirdest issue with how things were updating. There was a hard to discern pattern to it, but eventually when I really dug into it, I realised that it was generating elements with duplicate IDs, then it all made sense.

If the browser yelled at me, at least in the dev tools, it would’ve saved me a lot of work trying to figure things out.

throwaway@lemmy.cafe on 24 Sep 21:14 next collapse

XHTML.

__siru__@discuss.tchncs.de on 29 Sep 07:00 collapse

This wsa considered in the earlier days of the web, but then intentionally not enforced. HTML was specifically designed to not fall into the same scheme as most programming languages in that it should try to render what it could even if there was a lot going wrong (unlike most programming languages that try to fail fast).

(And before someone comes after me for comparing HTML to programming languages, I am well aware that it is not Turing complete.)

ViatorOmnium@piefed.social on 24 Sep 11:50 collapse

Works is different from works consistently across all browsers, or even versions of the same browser. I know most web developers got into their heads that only Chrome (and maybe Firefox if they are feeling generous) matters, but open source projects shouldn’t incentivise this.

Justas@sh.itjust.works on 24 Sep 13:56 next collapse

Because HTML rules are the tools of the bourgeois. /s

teletext@reddthat.com on 25 Sep 15:17 collapse

W3’s validator has not been updated in more than 10 years and it did not work correctly even back than.