Proper comment highlighting

Ideas for new features

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
tehsolace
Posts: 3
Joined: Wed Mar 25, 2009 8:51 pm

Proper comment highlighting

Post 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.";
?>

*/
tehsolace
Posts: 3
Joined: Wed Mar 25, 2009 8:51 pm

Post 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>
User avatar
MudGuard
Posts: 1295
Joined: Sun Mar 02, 2003 10:15 pm
Location: Munich, Germany
Contact:

Post by MudGuard »

tehsolace wrote://--></style>[/code]
doesn't make any sense at all. // is not allowed inside a style element.
tehsolace
Posts: 3
Joined: Wed Mar 25, 2009 8:51 pm

Post 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>
Post Reply