After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 564345 - Problem with embedded PHP in a unquoted HTML attribute
Problem with embedded PHP in a unquoted HTML attribute
Status: RESOLVED FIXED
Product: gtksourceview
Classification: Platform
Component: Syntax files
3.11.x
Other Linux
: Normal normal
: ---
Assigned To: GTK Sourceview maintainers
GTK Sourceview maintainers
Depends on:
Blocks:
 
 
Reported: 2008-12-13 01:24 UTC by Brett Alton
Modified: 2014-02-08 21:29 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Brett Alton 2008-12-13 01:24:28 UTC
In a page with a .php extension (e.g. index.php), PHP is incorrectly highlighted inside HTML when there are no encompasing double-quotes.

Here is case I found from work (I didn't write this, else it wouldn't look like this) where PHP is highlighted incorrectly.

----
<a href=viewcustompage.php?id=<?php print $select_custom_page["page_id"]; ?>><img src="/buttons/<?php print $buttons; ?>/view.gif" border="0" alt="View this Custom Page"></a>
----

Since this is still valid HTML 4.0 (unfortunately -- believe me, I'm a big proponent of XHTML 1.1), I wonder if the solution to this, and any other multiple-syntax-highlights-in-one-file-problems may be fixed with this idea:

In an HTML file, the code uses the default background. When JavaScript, CSS and/or PHP are embedded, they use a different colour background.

PHP could be light light yellow, JavaScript could be light light blue and CSS would be light light red.

I think that visually separating these scripts/markups when contained in one file is very important.

Hopefully this will close bugs similar to: http://bugzilla.gnome.org/show_bug.cgi?id=564173
Comment 1 Carnë Draug 2011-05-16 17:05:02 UTC
I can confirm that this is still not correctly highlighted on the trunk version
Comment 2 Sébastien Wilmet 2014-02-08 18:01:25 UTC
(In reply to comment #0)
> ----
> <a href=viewcustompage.php?id=<?php print $select_custom_page["page_id"];
> ?>><img src="/buttons/<?php print $buttons; ?>/view.gif" border="0" alt="View
> this Custom Page"></a>
> ----

To fix this problem, here is an idea:
https://bugzilla.gnome.org/show_bug.cgi?id=565524#c12

About different background colors, it can be nice, indeed.
Comment 3 Sébastien Wilmet 2014-02-08 21:11:51 UTC
The problem with embedded PHP in unquoted attributes is fixed:
https://git.gnome.org/browse/gtksourceview/commit/?id=27d3f3a58b59b281fded601a34fae5e77dc3423d

> About different background colors, it can be nice, indeed.

It would be simpler to open another bug report for that.
Comment 4 Sébastien Wilmet 2014-02-08 21:29:14 UTC
See bug #723927 for the other part of this bug.