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".
Bug <PRE
-
- Site Admin
- Posts: 3785
- Joined: Sat Dec 11, 2004 9:23 am
- Location: Near Dallas, TX
Re: Bug <PRE
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.
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.
Albert Wiersch, CSS HTML Validator Developer • Download CSS HTML Validator FREE Trial