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 614022 - HTML comments within quotes are not correctly colored
HTML comments within quotes are not correctly colored
Status: RESOLVED DUPLICATE of bug 565524
Product: gtksourceview
Classification: Platform
Component: Syntax files
unspecified
Other Linux
: Normal normal
: ---
Assigned To: GTK Sourceview maintainers
GTK Sourceview maintainers
Depends on:
Blocks:
 
 
Reported: 2010-03-26 15:49 UTC by Michael Martin-Smucker
Modified: 2011-05-12 20:20 UTC
See Also:
GNOME target: ---
GNOME version: 2.27/2.28


Attachments
example of the highlighting (39.56 KB, image/png)
2010-03-26 15:49 UTC, Michael Martin-Smucker
Details

Description Michael Martin-Smucker 2010-03-26 15:49:02 UTC
Created attachment 157183 [details]
example of the highlighting

Syntax highlighting doesn't work as expected when an HTML comment is located within an HTML quote.  For example:

I'm editing an ASP/HTML document
ASP server-side includes are written as HTML comments
I stick an ASP include inside quotation marks, as I want to link to a file, but the location or name of the file dynamically changes.

Result:
The ASP include - written as an HTML comment - is colored pink, as if it were part of the quote, but only up to the first quotation mark located within the comment.  I would expect the comment to be colored blue, to match all other comments (a case could also be made for pink, to match other text within quotes, but only if the entire ASP include was colored in pink).

For the sake of clarity, I'll also attach a screenshot.
Comment 1 Paolo Borelli 2010-03-27 11:49:34 UTC
Is this using asp highlighting or plain html highlighting?

I do not think comment inside attributes are allowed in html, so probably asp.lang should be fixed to replace the html:attribute context with a custom context that allows comments
Comment 2 Michael Martin-Smucker 2010-03-27 12:33:31 UTC
(In reply to comment #1)
> Is this using asp highlighting or plain html highlighting?

I never manually chose one or the other, so I can't be positive, but the document is saved with the .asp extension, so I would assume gedit automatically switched to asp highlighting.  Actual asp code in the document - set apart by <% %> - is highlighted differently than html code, so I can only assume asp highlighting is on.


> I do not think comment inside attributes are allowed in html, so probably
> asp.lang should be fixed to replace the html:attribute context with a custom
> context that allows comments

I can't imagine there would ever be a legitimate reason to place a comment inside an attribute using strictly html, so I agree that this should probably be custom for server scripting languages.

For what it's worth, I also just checked php includes, and a similar issue happens with highlighting. With a php include in the form <?php include("file.php"); ?> placed inside an html attribute, the highlighting works correctly up until the first quotation mark inside include().  When that quotation mark is hit, syntax highlighting believes that the html attribute is finished, and it switches off the php highlighting.
Comment 3 Carnë Draug 2011-05-12 14:41:33 UTC
Hi!

this seems to be a duplicate of bug #565524

Could someone maybe mark it as such?
Comment 4 Michael Martin-Smucker 2011-05-12 20:20:36 UTC
(In reply to comment #3)
> Hi!
> 
> this seems to be a duplicate of bug #565524
> 
> Could someone maybe mark it as such?

Good catch -- I'll mark it as a duplicate.

*** This bug has been marked as a duplicate of bug 565524 ***