Re: After your "No p element in scope but a p end tag seen." please add " Remember p elements can't be nested"

2013-09-20 13:15, Ruud Steltenpool wrote:

> I've seen many devs not figure out what the problem is based on "No p
> element in scope but a p end tag seen." until I told them "Remember p
> elements can't be nested". Please change your errormessage
> accordingly.

Any remark that may help to understand an error message in a specific 
situation may thoroughly confuse people when the situation is different.

A much more common problem than attempts to nest p elements is an 
attempt to have a list, a table, or other block-level content inside a p 
element. In such situations, "Remember p elements can't be nested" would 
be a distraction or worse.

The explanation given in classic HTML mode (i.e. when not using HTML5) 
is already too "explanatory" to be understandable:

"end tag for element "P" which is not open
The Validator found an end tag for the above element, but that element 
is not currently open. This is often caused by a leftover end tag from 
an element that was removed during editing, or by an implicitly closed 
element (if you have an error related to an element being used where it 
is not allowed, this is almost certainly the case). In the latter case 
this error will disappear as soon as you fix the original problem.

If this error occurred in a script section of your document, you should 
probably read this FAQ entry."

Compared with this story, surely written with the best intentions, the 
HTML5 validator's "No p element in scope but a p end tag seen." is a 
great improvement.

A validator is not a teacher or a tutor. It just issues error and 
warning messages. The user needs to take it from there. There are 
myriads of reasons why a document may contain a homeless end tag


Received on Friday, 20 September 2013 11:22:27 UTC