Page 1 of 1

Proper comment highlighting

Posted: Wed Mar 25, 2009 9:00 pm
by tehsolace
With the following PHP code, incorrect comment coloring occurs. Only comment tags WITHIN the SyntaxStart/SyntaxEnd tags should be colored. There currently seems to be no method of writing a syn file to correct this.

Code: Select all

<?php
// in somefile.php
// some php here
?>
<style>

/* some css comments here

this should NOT be colored, because the comment tags are not within the <?php ?> tags

<?php
echo "this entire php block will appear as a comment, incorrectly.";
?>

*/

Posted: Wed Mar 25, 2009 9:04 pm
by tehsolace
Another example of improper comment coloring with the following settings:

Code: Select all

SyntaxStart = <?php
SyntaxEnd = ?>
CommentStart = /*
CommentEnd = */
CommentStartAlt = 
CommentEndAlt = 
SingleComment = //
Example:

Code: Select all

<style><!--

.some-css-here {
    width: auto;
}

//--></style><div>this line appears as a php comment... but i havent even written any php anywhere</div>

Posted: Wed Mar 25, 2009 9:19 pm
by MudGuard
tehsolace wrote://--></style>[/code]
doesn't make any sense at all. // is not allowed inside a style element.

Posted: Wed Mar 25, 2009 9:23 pm
by tehsolace
You're right, that should have been a <script> element.

Fixed 2nd example:

Code: Select all

<script type="text/javascript"><!--

function foo() {  }

//--></script><div>this line appears as a php comment... but i havent even written any php anywhere</div>