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 - Javascript operator marked as unescaped entity in XHTML
Summary: Javascript operator marked as unescaped entity in XHTML
Status: NEW
Alias: None
Product: javascript
Classification: Unclassified
Component: Editor (show other bugs)
Version: 7.3
Hardware: PC Linux
: P3 normal (vote)
Assignee: Petr Pisl
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-11-16 14:32 UTC by Vladimir Riha
Modified: 2013-07-19 12:31 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.