GNOME Bugzilla – Bug 696851
HTML/JS mode highlights /> in String/RegExp literals
Last modified: 2013-11-01 22:44:05 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"; & var b = "abc/>abc"; // JS highlighter stops here var c = "abc"; & // & is highlighted, HTML highlighter here </script> <script> var a = /regex/; & var b = />regex/; // JS highlighting stops every time there is this string "/>" var c = /regex/; & </script> <div id="xyz/>xyz" /> <!-- No problems here in HTML --> <div />
Created attachment 240116 [details] "Real" screenshot See, JS stops at the "/>". Then below, in Strings, HTML is highlighted.
Syntax highlighting is done by GtkSourceView. *** This bug has been marked as a duplicate of bug 670803 ***