This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 222275

Summary: Javascript operator marked as unescaped entity in XHTML
Product: javascript Reporter: Vladimir Riha <vriha>
Component: EditorAssignee: Petr Pisl <ppisl>
Status: NEW ---    
Severity: normal CC: mfukala
Priority: P3    
Version: 7.3   
Hardware: PC   
OS: Linux   
Issue Type: DEFECT Exception Reporter:

Description Vladimir Riha 2012-11-16 14:32:52 UTC
Try to paste this snippet into xhtml file (I tried HTML5 and Java Web project):

<script>
            for (var i = 0; i < data.length; i++) {
            }
</script>


The "less than" in for statement is marked as not being well formed.


Product Version: NetBeans IDE Dev (Build 201211160001)
Java: 1.7.0_10-ea; Java HotSpot(TM) Client VM 23.6-b04
Runtime: Java(TM) SE Runtime Environment 1.7.0_10-ea-b15
System: Windows XP version 5.1 running on x86; Cp1252; en_US (nb)
Comment 1 Marek Fukala 2012-11-27 13:58:10 UTC
The sample code is erroneous itself as xhtml file cannot contain the start tag symbol unescaped.

Correct code is:
<script>
            for (var i = 0; i &lt; data.length; i++) {
            }
</script>

which however causes the javascript parser to complain about the character entity. 

Apparently the JsEmbeddingProvider doesn't translate these ch.entities to the target characters in the virtual js source.