the sequence "/>" in a string breaks javascript syntax highlighting within HTML

Bug #682441 reported by Teo
6
This bug affects 1 person
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/javascript">
//<![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.

Revision history for this message
Sebastien Bacher (seb128) wrote :

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)

affects: gedit (Ubuntu) → gtksourceview2 (Ubuntu)
Changed in gtksourceview2 (Ubuntu):
importance: Undecided → Low
Revision history for this message
Pedro Villavicencio (pedro) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. The issue that you reported is one that should be reproducible with the live environment of the Desktop CD of the development release - Oneiric Ocelot. It would help us greatly if you could test with it so we can work on getting it fixed in the next release of Ubuntu. You can find out more about the development release at http://www.ubuntu.com/testing/ . Thanks again and we appreciate your help.

Changed in gtksourceview2 (Ubuntu):
status: New → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for gtksourceview2 (Ubuntu) because there has been no activity for 60 days.]

Changed in gtksourceview2 (Ubuntu):
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.