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 251226 - Commenting not working correctly with script tag
Summary: Commenting not working correctly with script tag
Status: RESOLVED WONTFIX
Alias: None
Product: javascript
Classification: Unclassified
Component: Editor (show other bugs)
Version: 8.0.2
Hardware: PC Linux
: P4 normal (vote)
Assignee: Roman Svitanic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-03-17 08:24 UTC by ravi228
Modified: 2015-03-23 14:41 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
IDE log (101.00 KB, text/plain)
2015-03-17 08:24 UTC, ravi228
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ravi228 2015-03-17 08:24:05 UTC
Product Version = NetBeans IDE 8.0.2 (Build 201408251540)
Operating System = Linux version 3.13.0-43-generic running on amd64
Java; VM; Vendor = 1.8.0_25
Runtime = Java HotSpot(TM) 64-Bit Server VM 25.25-b02


Hi All,

1)
I write code 
<script type="text/javascript">
   window.onload = drawChart();
    window.onresize = drawChart
 i want to comment these three line of code with  cntrl+shft+c is not works while in Source-> toggle comment is there on click on it still it not comment these three lines
I need to give comment separatly.
While I found it is due to no end script tag hence in IDE you can hide that Source-> 'toggle comment'. It will be good for all.

2)And one more thing that if  I want to comment </script> only in .html page see what happen it not comment at all.
first it add <!--</script>--> so it not comment not if i again comment it then gives //<!--</script>--> which is also not comment in html

So please try to 
1) hide toogle comment option for such a cases
2) else provide commenting to that (i.e. provide commeting these three line or </script> tag only)
Comment 1 ravi228 2015-03-17 08:24:13 UTC
Created attachment 152669 [details]
IDE log
Comment 2 Vladimir Riha 2015-03-17 13:24:29 UTC
Reproducible

Product Version: NetBeans IDE Dev (Build 201503160001)
Java: 1.8.0_40; Java HotSpot(TM) Client VM 25.40-b25
Runtime: Java(TM) SE Runtime Environment 1.8.0_40-b25
System: Linux version 3.13.0-35-generic running on i386; UTF-8; en_US (nb)
Comment 3 Petr Pisl 2015-03-23 12:51:47 UTC
Assigning to Roman. Thanks.
Comment 4 Roman Svitanic 2015-03-23 14:41:13 UTC
1. Such commenting would result in an invalid code: JS placed directly in the HTML and ending </script> tag without opening <script> tag.
2. If you comment out </script> and then toggle comment on the same line, you are inside JS embedding, therefore current behavior (comment the line using JS comment) is expected and correct.