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 226942 - Do not pass JSF code from <script text="text/javascript"> into JS embedded source. [was:Formatting JS code with JSF tags breaks code]
Summary: Do not pass JSF code from <script text="text/javascript"> into JS embedded so...
Status: NEW
Alias: None
Product: javascript
Classification: Unclassified
Component: Formatting & Indentation (show other bugs)
Version: 7.3
Hardware: PC Linux
: P3 normal (vote)
Assignee: Petr Pisl
URL:
Keywords:
: 242603 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-03-03 14:28 UTC by Vladimir Riha
Modified: 2015-09-09 11:27 UTC (History)
2 users (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 2013-03-03 14:28:14 UTC
Extracted from issue 226937:


<script type="text/javascript">
this.jqEl.datepicker("option", 
                        <h:outputText
value="$.datepicker.regional[this.cfg.locale?(this.cfg.locale.length &gt;
5?(this.cfg.locale.substring(0,5).replace(/_/g,&quot;-&quot;)):(this.cfg.locale.replace(/_/g,&quot;-&quot;))):&quot;&quot;]"/>);

If you format this in JSF XHTML page, then for instance: 

<h:outputText 

is replaced with

< h:outputText

etc. Perhaps disabling formatting for "incorrect" code would at least a little help?



Product Version: NetBeans IDE Dev (Build web-main-10008-on-20130301)
Java: 1.7.0; Java HotSpot(TM) 64-Bit Server VM 21.0-b17
Runtime: Java(TM) SE Runtime Environment 1.7.0-b147
System: Linux version 3.5.0-25-generic running on amd64; UTF-8; en_US (nb)
Comment 1 Petr Hejl 2013-08-02 20:37:43 UTC
The problem is imo the <h:outputText is passed unchanged to JS parser. So it is actually parsed as "less than h" etc. Marku do you thing this is an error in embedding? Thanks for any help.
Comment 2 Marek Fukala 2013-09-02 09:36:56 UTC
The <h:outputText .../> should be preprocessed before passing the script content to the js embedded source.
Comment 3 Vladimir Riha 2014-03-06 08:39:46 UTC
*** Bug 242603 has been marked as a duplicate of this bug. ***