Per-document warnings/errors disabling

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

Per-document warnings/errors disabling

Post by IZh »

Hi!

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
Posts: 3785
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX
Contact:

Re: Per-document warnings/errors disabling

Post by Albert Wiersch »

Hello,

It may be possible using the onMessageID_(msgid)() user function and a custom TNPL program:
https://www.htmlvalidator.com/current/d ... _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, CSS HTML Validator Developer • Download CSS HTML Validator FREE Trial
Post Reply