the sequence "/>" in a string breaks javascript syntax highlighting within HTML
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
gtksourceview2 (Ubuntu) |
Expired
|
Low
|
Unassigned |
Bug Description
Binary package hint: gedit
Try pasting this code into an html file and open it in gedit:
---------sample text that breaks syntax highlight---------
<html>
<script type="text/
//<![CDATA[
var f="/>"; //this breaks syntax highlight
for (var i=0;i<10;i++) {} //just some more code with fucked up highlight
//]]>
</script>
</html>
--------end of sample text-----
Expected result: the "/>" characters shouldn't break syntax highlight, since they are within a string, so it is valid javascript, and the javascript code is within a CDATA, so it is all valid HTML.
Observed result: syntax highlights are messed up starting from the "/>" character string.
Incidentally, note that this seems to be a problem with javascript syntax, or the way javascript interacts with html. It is not just a problem with HTML. I say this because the following example is highlighted properly and does not break gedit's html highlighting:
---- sample text that works fine ------
<html>
<div>
<![CDATA[
/>
/>/>/>/>/> "/>"
]]>
</div>
</html>
---- end of sample text ----
Also, the javascript code in the first example works fine when it is pasted in a javascript-only file without html.
Thank you for your bug report. The issue is an upstream one and it would be nice if somebody having it could send the bug the to the people writting the software (https:/ /wiki.ubuntu. com/Bugs/ Upstream/ GNOME)