The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 4,262 other subscribers

Thanks Stephan Kämper for showing me how to validate HTML on-line at W3C

Posted by jpluimers on 2023/07/05

In Another difference between the and element in HTML&XHTML, I mentioned Stephan Kämper taught be about the W3C HTML NU validator in [Archive] Stephan Kämper on Twitter: “I try to write fairly simple & #valid #HTML ➙ …gist..Validating it with …online HTML-Validator…, I get the error ‘No p element in scope but a p end tag seen.‘ What? Why? Removing the list from the HTML, gets rid of the error… Why?!? I. don’t. get it. 1/2″ / Twitter.

Upon closer inspection, there are actually two w3c.org HTML validators, each operating in three modes:

  1. Default checker which is DTD-based:

    This validator checks the [Wayback/Archive] markup validity of Web documents in HTML, XHTML, SMIL, MathML, etc. If you wish to validate specific content such as [Wayback/Archive] RSS/Atom feeds or [Wayback/Archive] CSS stylesheets, [Wayback/Archive] MobileOK content (now retired), or to [Wayback/Archive] find broken links, there are [Wayback/Archive] other validators and tools available. As an alternative you can also try our [Wayback/Archive] non-DTD-based validator.

    1. [Wayback/Archive] The W3C Markup Validation Service: #validate_by_uri mode (without #validate_by_uri URL fragment) and

      default: checks the HTML of a URL

    2. [Archive] The W3C Markup Validation Service: #validate_by_upload mode

      you upload a file of which the HTML then gets checked

    3. [Archive] The W3C Markup Validation Service: #validate_by_input mode

      you enter the HTML to be checked into a text box

  2. NU checker which is non-DTD-based:
    1. [Wayback/Archive] Ready to check – Nu Html Checker; #address mode (without #address URL fragment) and

      default: checks the HTML of a URL

    2. [Archive] Ready to check – Nu Html Checker: #file mode

      you upload a file of which the HTML then gets checked

    3. [Archive] Ready to check – Nu Html Checker: #textarea mode

      you enter the HTML to be checked into a <textarea> element

Notes:

  1. that all three above modes get selected by a URL fragment (after a # hash) which the Wayback machine cannot individually save, but Archive.is can, hence the non-default URLs are not saved only in Archive.is, and not in the Wayback machine.
  2. The DTD-based checker seems non-functional and redirects all requests to the non-DTD-based checker.

I also took a look at the Wayback machine saved pages under the direct URLs of both checkers:

  1. https://web.archive.org/web/*/https://validator.w3.org/*
  2. https://web.archive.org/web/*/https://validator.w3.org/nu/*

I learned that the NU validator accepts at least these arguments:

Note that you cannot do this directly with HTML files saved in a gist or GitHub repository because it serves all RAW files as

[Wayback/Archive] text/plain MIME type. You can work around this by using a raw.githack.com trick I explained before at:

I also amended my above reply with more information using the ?doc= parameter with RAW gist files and archived that thread at [Wayback/Archive] Thread by @jpluimers on Thread Reader App – Thread Reader App.

–jeroen

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.