feeding the Griffon

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:

feeding the Griffon

Post by roedygr » Wed Apr 30, 2014 2:20 am

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

Re: feeding the Griffon

Post by Albert Wiersch » Wed Apr 30, 2014 7:27 am

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
Image
Albert Wiersch

User avatar
roedygr
Rank V - Professional
Rank V - Professional
Posts: 370
Joined: Fri Feb 17, 2006 5:22 am
Location: Victoria BC Canada
Contact:

Re: feeding the Griffon

Post by roedygr » Fri May 09, 2014 2:58 pm

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

Re: feeding the Griffon

Post by Albert Wiersch » Fri May 09, 2014 3:32 pm

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).
Image
Albert Wiersch

Post Reply