GNOME Bugzilla – Bug 614022
HTML comments within quotes are not correctly colored
Last modified: 2011-05-12 20:20:36 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.
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
(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.
Hi! this seems to be a duplicate of bug #565524 Could someone maybe mark it as such?
(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 ***