ColdFusion Comments

For technical support for all editions of CSS HTML Validator. Includes bug reports.
Post Reply
kennedyrt
Rank II - Novice
Rank II - Novice
Posts: 20
Joined: Fri Nov 09, 2007 9:57 pm
Location: Kent, Washington

ColdFusion Comments

Post by kennedyrt »

Comments in ColdFusion are enclosed by <!--- --->. CSE HTML Validator flags these ColdFusion comments as errors even when Flag 116 is disabled.

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

Re: ColdFusion Comments

Post by Albert Wiersch »

Hello,

Can you post a sample code section that reproduces the problem? Thank you.

kennedyrt
Rank II - Novice
Rank II - Novice
Posts: 20
Joined: Fri Nov 09, 2007 9:57 pm
Location: Kent, Washington

Re: ColdFusion Comments

Post by kennedyrt »

<table border="0" cellpadding="0" cellspacing="0" width="800">
<tr>
<!--- This is a ColdFusion Comment that is flagged as an error --->
<td><img src="images/spacer.gif" width="1" height="1" border="0" alt=""></td>
<td><img src="images/spacer.gif" width="198" height="1" border="0" alt=""></td>
.
.
.

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

Re: ColdFusion Comments

Post by Albert Wiersch »

Thank you. This should be addressed in the next v11 BETA.

In the meantime, disabling that message by right-clicking on it when displayed in the Results Window of CSE HTML Validator should disable it, but that would also disable it for non-ColdFusion comments.

If you'd like, I believe this can also be addressed by appending to the onConfigLoad() function in the 'Functions' program of the config file using the Configuration Editor in the pro or higher edition. If you'd like to do it this way, then please let me know and I will provide the details.

kennedyrt
Rank II - Novice
Rank II - Novice
Posts: 20
Joined: Fri Nov 09, 2007 9:57 pm
Location: Kent, Washington

Re: ColdFusion Comments

Post by kennedyrt »

Yes. I would like the details of appending to the onConfigLoad(). Thank you.

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

Re: ColdFusion Comments

Post by Albert Wiersch »

kennedyrt wrote:Yes. I would like the details of appending to the onConfigLoad(). Thank you.
Sure. Please try appending the following to the end of the onConfigLoad() function in the "Functions" program in the Configuration Editor->Programs tab. Be sure to go to the Programs tab and check the "Functions" radio button then find the onConfigLoad() function and insert the code into the function at the end - just before the final '}' that ends the function.

Please note that the config will need to be reloaded for the changes to take effect. Also, I recommend that you save your custom config to another filename.

Please let me know how it works. Note that it requires flag 116 to be unchecked.

Code: Select all

setValueString(6,"#cc=true;
if beginsWithCase($commentstring,'!---') { if !isFlagSet(116) { #cc=false; } }
if #cc {
  if checkStringEx(0,5,$commentstring) {
   MessageEx(13,2006082303,$MSG_ERROR,'The HTML 4.01 specification states that it is a common error to include two or more adjacent hyphens in comments (between <!-- and -->). This also applies to XHTML. To prevent possible problems, always avoid using a string of hyphens within a comment. More compliant browsers like Firefox may (and probably will) consider the comment ended as soon as two adjacent hyphens are used. Also, avoid nesting comments.',getLocation(7,0));
  }
 
  if checkStringEx(0,6,$commentstring) {
   MessageEx(13,2003031401,$MSG_WARNING,'The HTML 4.01 specification states that it is valid to include whitespace between '--' and '>' but this may cause problems because some browsers may not parse this correctly. We recommend that the whitespace be removed.',getLocation(2,2));
  }
 }");

kennedyrt
Rank II - Novice
Rank II - Novice
Posts: 20
Joined: Fri Nov 09, 2007 9:57 pm
Location: Kent, Washington

Re: ColdFusion Comments

Post by kennedyrt »

It doid work. Thank you.

Post Reply