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.
Given a statement such as the following: <a href="#" onclick="edit(${a.id});return false;">Edit</a> Upon performing a format (Tools > Format) a new-line is placed after the semi-colon. This is undesirable behaviour and should be left to the author to decide in this situation where new-lines are inserted. A very annoying secondary side-affect of this is when formatting script blocks that appear after such a line as above. Consider the following: <div> <div></div> </div> <script> x(); </script> When auto formatting the above remains as is, however, if we were to add an onclick inside the div element the script is indented by four spaces instead of two. <div> <div onclick="x();"></div> </div> <script> x(); </script> If there are further element nesting the indent level of the script becomes deeper and somewhat seemingly unpredictable in some circumstances. Please note my HTML/Javascript indent level is two spaces.
*** Bug 228140 has been marked as a duplicate of this bug. ***
I suspect this bug also cause this behaviour: Before formatting I had this attribute on a div in an Agular view: ng-class="($first ? '' : 'hidden-xs hidden-sm')" After formatting, NetBeans changed it into this: ng-class="($first ? '' : 'hidden - xs hidden - sm')" This happens on NetBeans 8.0.2 and is pretty serious IMO. Since this bug not only causes ugly formatting but actually affects how the page works, a higher priority might be suitable.
Actually that is a pretty serious bug but would be a seperate issue and should be raised under web/angularjs. Not that in your example it only affects ng- attributes which are processed by the angular module in netbeans.
Reported as: https://netbeans.org/bugzilla/show_bug.cgi?id=251057
Changeset: 2a3ffe5982cd Author: Roman Svitanic <rsvitanic@netbeans.org> Date: 2015-03-10 16:46 Message: #225749: Formatting HTML inserts blank lines after semi-colon in attribute event handlers - fixed
Integrated into 'main-silver', will be available in build *201503110001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/2a3ffe5982cd User: Roman Svitanic <rsvitanic@netbeans.org> Log: #225749: Formatting HTML inserts blank lines after semi-colon in attribute event handlers - fixed Task #225749 - Formatting HTML inserts blank lines after semi-colon in attribute event handlers.