Per-document warnings/errors disabling

For technical support for all editions of CSS HTML Validator. Includes bug reports.
Post Reply
Rank 0 - Newcomer
Rank 0 - Newcomer
Posts: 3
Joined: Sat May 17, 2014 1:28 pm

Per-document warnings/errors disabling

Post by IZh » Sat May 24, 2014 3:45 am


Often you need to disable some warning only on particular file or URL. Is it possible to do?
I couldn't find it.

Disabling warning on particular page allows to have it enabled for the rest of pages.
The easiest way to implement it is to optionally print URL of the page in the message end.
The it would be possible to disable it by exact message.

(There may be some things to note like query string -- whether to include it to URL or not.
Also it could be possible to implement wildcards.)

Thank you.

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

Re: Per-document warnings/errors disabling

Post by Albert Wiersch » Sat May 24, 2014 8:37 am


It may be possible using the onMessageID_(msgid)() user function and a custom TNPL program: ... _msgid.htm

You can get the full path of the document being validated with getValueString(5) or just the filename without path with getValueString(6), and use that to determine whether to cancel the message in the function, or you could add the URL to the message so you can cancel it by exact text match. If the message does not have an ID, then another solution may be needed.

If you'd like to give me more details, then I can try to help with the function. Like what is the exact message text and what is the message ID?
Albert Wiersch

Post Reply