ColdFusion Comments

For technical support for all editions of CSE HTML Validator. Includes bug reports.

ColdFusion Comments

Postby kennedyrt » Wed Jun 08, 2011 6:13 pm

Comments in ColdFusion are enclosed by <!--- --->. CSE HTML Validator flags these ColdFusion comments as errors even when Flag 116 is disabled.
kennedyrt
Rank I - Novice
Rank I - Novice
 
Posts: 15
Joined: Fri Nov 09, 2007 10:57 pm
Location: Renton, Washington

Re: ColdFusion Comments

Postby Albert Wiersch » Wed Jun 08, 2011 6:28 pm

Hello,

Can you post a sample code section that reproduces the problem? Thank you.
Image
Albert Wiersch
User avatar
Albert Wiersch
Site Admin
Site Admin
 
Posts: 2361
Joined: Sat Dec 11, 2004 10:23 am
Location: Near Dallas, TX

Re: ColdFusion Comments

Postby kennedyrt » Wed Jul 27, 2011 4:51 pm

<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>
.
.
.
kennedyrt
Rank I - Novice
Rank I - Novice
 
Posts: 15
Joined: Fri Nov 09, 2007 10:57 pm
Location: Renton, Washington

Re: ColdFusion Comments

Postby Albert Wiersch » Wed Jul 27, 2011 8:48 pm

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.
Image
Albert Wiersch
User avatar
Albert Wiersch
Site Admin
Site Admin
 
Posts: 2361
Joined: Sat Dec 11, 2004 10:23 am
Location: Near Dallas, TX

Re: ColdFusion Comments

Postby kennedyrt » Thu Jul 28, 2011 10:01 am

Yes. I would like the details of appending to the onConfigLoad(). Thank you.
kennedyrt
Rank I - Novice
Rank I - Novice
 
Posts: 15
Joined: Fri Nov 09, 2007 10:57 pm
Location: Renton, Washington

Re: ColdFusion Comments

Postby Albert Wiersch » Thu Jul 28, 2011 2:19 pm

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));
  }
 }");
Image
Albert Wiersch
User avatar
Albert Wiersch
Site Admin
Site Admin
 
Posts: 2361
Joined: Sat Dec 11, 2004 10:23 am
Location: Near Dallas, TX

Re: ColdFusion Comments

Postby kennedyrt » Thu Jul 28, 2011 2:39 pm

It doid work. Thank you.
kennedyrt
Rank I - Novice
Rank I - Novice
 
Posts: 15
Joined: Fri Nov 09, 2007 10:57 pm
Location: Renton, Washington


Return to CSE Tech Support

Who is online

Users browsing this forum: No registered users and 1 guest