feeding the Griffon

For technical support and bug reports for all editions of CSS HTML Validator, including htmlval for Linux and Mac.
User avatar
roedygr
Rank V - Professional
Posts: 367
Joined: Fri Feb 17, 2006 5:22 am
Location: Victoria BC Canada

feeding the Griffon

Post by roedygr »

Blue Griffon is an HTML editor. It has a rude habit the author refuses to fix.

It removes all markup of the form <a id="XXX"></a> without comment.

I have gradually been changing my markup to avoid this construct but it would be nice if HTML Validator would warn me of remaining bits, meaning it is safe to edit the document with Blue Griffon.
User avatar
Albert Wiersch
Site Admin
Posts: 3785
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX

Re: feeding the Griffon

Post by Albert Wiersch »

I think this should be possible using TNPL. It could check for empty "a" elements. Is that what it removes? Or does it also have to have an "id" attribute? And if so must it be the only attribute? And if so must it only have the value "XXX"? That is, I need more information as to exactly what the editor is removing in order to generate the appropriate error message.

I haven't even heard of the editor, but you may want to suggest to the author that he/she integrate support for CSE HTML Validator in it. :D
Albert Wiersch, CSS HTML Validator Developer • Download CSS HTML Validator FREE Trial
User avatar
roedygr
Rank V - Professional
Posts: 367
Joined: Fri Feb 17, 2006 5:22 am
Location: Victoria BC Canada

Re: feeding the Griffon

Post by roedygr »

I think it is removing all empty <a tags, even if they have an id. I have to be careful never to feed it unexpanded macros (which look like comments) to griffon, since they can look like empty <a too. However, there is nothing you could do about that. Perhaps I will take another stab at convincing Griffon. They have been silent a year, though.

I would be happy of HTMLValidator removed true <a></a> empty tags without a comment or id, or at least warned about them.
User avatar
Albert Wiersch
Site Admin
Posts: 3785
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX

Re: feeding the Griffon

Post by Albert Wiersch »

It's easy to generate warnings for elements with no attributes. Here's the TNPL user function to do that for "a" elements:

Code: Select all

function onStartTag_a() {
 if !numAttributes {
  Message(1,MSG_WARNING,'This "'+CurrentTagName+'" element has no attributes.');
 }
}
As usual, put it in a text file like myTNPL.cfg and specify it (since it's for the validator engine and not the Batch Wizard) in the Validator Engine Options, Validator Engine->Config File page in one of the 'User functions' fields and then reload the configuration.

As for CSE HTML Validator changing the document (like removing "a" tags), the validator tool is not designed to change anything, just analyze it (at least at this point in time).
Albert Wiersch, CSS HTML Validator Developer • Download CSS HTML Validator FREE Trial