Page 1 of 1

feeding the Griffon

Posted: Wed Apr 30, 2014 2:20 am
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.

Re: feeding the Griffon

Posted: Wed Apr 30, 2014 7:27 am
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

Re: feeding the Griffon

Posted: Fri May 09, 2014 2:58 pm
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.

Re: feeding the Griffon

Posted: Fri May 09, 2014 3:32 pm
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).