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 696851 - HTML/JS mode highlights /> in String/RegExp literals
HTML/JS mode highlights /> in String/RegExp literals
Status: RESOLVED DUPLICATE of bug 670803
Product: gedit
Classification: Applications
Component: general
3.4.x
Other Linux
: Normal minor
: ---
Assigned To: Gedit maintainers
Gedit maintainers
Depends on:
Blocks:
 
 
Reported: 2013-03-29 13:33 UTC by godffrey0
Modified: 2013-11-01 22:44 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Screenshot of the example (81.49 KB, image/png)
2013-03-29 13:33 UTC, godffrey0
Details
"Real" screenshot (156.43 KB, image/png)
2013-03-29 13:35 UTC, godffrey0
Details

Description godffrey0 2013-03-29 13:33:43 UTC
Created attachment 240114 [details]
Screenshot of the example

The HTML (with JavaScript) highlighter matches "/>" even in JS String literals.
Also in RegExp, when the regexp starts with ">", forming a "/>".

Steps to reproduce:

1. Change highlight mode to HTML
View > Highlight mode > Markup > HTML
2. Type <script> tags, inside them, type a String literal with "/>" inside.
Example: <script>"abc/>def"</script>

JS highlighting stops after the />, and becomes HTML highlighting, even when in <script> tags.

Example .html file:

<script>
var a = "abc"; &amp;
var b = "abc/>abc"; // JS highlighter stops here
var c = "abc"; &amp; // &amp is highlighted, HTML highlighter here
</script>

<script>
var a = /regex/; &amp;
var b = />regex/; // JS highlighting stops every time there is this string "/>"
var c = /regex/; &amp;
</script>

<div id="xyz/>xyz" />
<!-- No problems here in HTML -->
<div />
Comment 1 godffrey0 2013-03-29 13:35:30 UTC
Created attachment 240116 [details]
"Real" screenshot

See, JS stops at the "/>".
Then below, in Strings, HTML is highlighted.
Comment 2 Sébastien Wilmet 2013-11-01 22:44:05 UTC
Syntax highlighting is done by GtkSourceView.

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