GNOME Bugzilla – Bug 617950
Syntax highlighting with PHP in HTML inputs buggy
Last modified: 2013-01-20 13:19:13 UTC
I am having a small little issue where gEdit's syntax highlighting acts buggy. For example, let's say I am creating a PHP file and write something like this: <input type="text" value="<?php echo("$value");>" /> All is well until I get to the first quote inside the echo statement. From there on, the color coding is incorrect for the rest of the line. Even though the multiple quotes are correctly used, I think gEdit is having problems distinguishing the ones inside of the PHP statement from the ones on the outside. This is a very minor bug, which at worst is only an annoyance. Keep up the good work! gEdit is amazing!
I can confirm this issue. This is not only with the <input> tag. This happens whenever you put php inside ANY html attribute. Other examples: <a href="<?php echo "http://$myurl"; ?>">...</a> <p style="color: <?php echo "rgb($r,$g,$b)"; ?>">...</p> etc This is NOT a minor issue at all. Syntax highlighting for a given language is useless unless it correctly highlights all code that is valid for that language. If syntax highlighting ever gets broken, you are forced to turn it off because it will make all your code unreadable. And the particular case that triggers this issue is not some rare or arcane code, it is something very common that is seen in most html/php pages. This is a minor issue only for those who are not using gedit to write php code (or those who don't mind coding without any syntax highlight).
There is a similar issue also when using self-closing tags within JavaScript code. For example in: <script> document.write('<input type="text" />'); </script> highlight works until the / character and then breaks up.
*** Bug 674212 has been marked as a duplicate of this bug. ***
This bug is related to gtksourceview and already reported there. Someone with the proper rights should move it and mark it as a duplicate of https://bugzilla.gnome.org/show_bug.cgi?id=565524
*** This bug has been marked as a duplicate of bug 565524 ***