Bug <PRE

For technical support for all editions of CSS HTML Validator. Includes bug reports.
Post Reply
User avatar
roedygr
Rank V - Professional
Rank V - Professional
Posts: 370
Joined: Fri Feb 17, 2006 5:22 am
Location: Victoria BC Canada
Contact:

Bug <PRE

Post by roedygr » Sun Aug 10, 2014 3:51 am

If there is a <PRE section inside a <p>...</p> HTMLValidator will complain the <p> are unbalanced.

I am not sure if PRE is supposed to be allowed in <p>, but if it is not, the error message should say "<PRE must not be nested inside <P>...</P>", not "<P> unbalanced".

User avatar
Albert Wiersch
Site Admin
Site Admin
Posts: 3442
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX
Contact:

Re: Bug <PRE

Post by Albert Wiersch » Mon Aug 11, 2014 9:09 am

Hello,

The <pre> tag implies a </p> end tag so p is ended at that point. This is allowed so it's not an error and there is no message to generate. When it gets to the explicit </p> it sees that p is not open anymore and generates the error you are seeing.

It may be possible to improve the message by checking to see whether p was ended by implication and, if so, assume one was trying to put a "pre" element inside a "p" element.... so I will look into this improvement.

Thanks.

UPDATE: This has been improved for v15. If you'd like to try a v15 BETA, then please email or PM me.
Image
Albert Wiersch

Post Reply