"the validator came up short of fully satisfying the w3c 4.01 transitional spec and even farther short of the strict spec"

It is true that there are conformance requirements which the validator is unable to check. However, my example exploits none of these. I haven't tricked the validator; it's simply a valid HTML 4.01 Transitional document.

It would be valid HTML 4.01 Strict, except that the <hr size> attribute is presentational and Strict doesn't contain most of the presentational attributes.

If you prefer an example that passes Strict:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"> <title>Foo</title> <hr class = size-1 >

"The validator, for example, blesses your code ("validates") without error (albeit, with warnings) despite the lack of <head>...</head>, <body>...</body> and <html>...</html> tags... and that's using the transitional spec which allows no such things.

The <html>, <head> and <body> start and end tags are all optional in every version of HTML that has ever been published by the W3C. (They are of course required in XHTML, but that's not what we're talking about.)

For example, see The HTML element, which says, "Start tag: optional, End tag: optional". You'll find the same under the definitions for HEAD, BODY and also TBODY. Many elements have optional end tags, but IIRC those are the only four with optional start tags.

"If you try it with strict, upload mode, and add: <table width = 17%> you'll see even the validator lets fly"

Indeed. As I said, attribute values do not need to be quoted if they conform to the regexp /^[A-Za-z0-9_:-]+$/. The percent sign character is disallowed by that regexp, so that attribute value needs quoting.

"Your regex and the accompanying statement are correct, as far as they go, but are most closely applicable to webmonkeys (yeah, been there; done that.) writing for NS or IE4 style browsers."

You think modern browsers don't support HTML 4.01? In most cases they support it better than those early browsers you mention did; and in most cases they support HTML better than they support full-blown XHTML.

package Cow { use Moo; has name => (is => 'lazy', default => sub { 'Mooington' }) } say Cow->new->name

In reply to Re^4: Understanding this particular Regex. by tobyink
in thread Understanding this particular Regex. by tty1x

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.