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.
Product Version: NetBeans IDE 8.0 (Build 201403101706) Updates: NetBeans IDE is updated to version NetBeans 8.0 Patch 1.1 Java: 1.8.0_05; Java HotSpot(TM) 64-Bit Server VM 25.5-b02 Runtime: Java(TM) SE Runtime Environment 1.8.0_05-b13 System: Windows 7 version 6.1 running on amd64; Cp1252; en_CA (nb) User directory: C:\Users\Gili\AppData\Roaming\NetBeans\8.0 Cache directory: C:\Users\Gili\AppData\Local\NetBeans\Cache\8.0 1. Given: <th> <div class="ui checkbox"> <input type="checkbox"><label class="label">Select</label> </div> </th> 2. Netbeans produces the following code formatting: <th> <div class="ui checkbox"> <input type="checkbox"><label class="label">Select</label> </div> </th> Meaning, it is applying an indentation level of -2 instead of +1 for unknown reasons.
reproducible Product Version: NetBeans IDE 8.0 (Build 201403101706) Updates: NetBeans IDE is updated to version NetBeans 8.0 Patch 1.1 Java: 1.8.0_05; Java HotSpot(TM) Client VM 25.5-b02 Runtime: Java(TM) SE Runtime Environment 1.8.0_05-b13 System: Linux version 3.2.0-60-generic-pae running on i386; UTF-8; en_US (nb)
This looks like <th> is not a valid HTML5 tag? It re-indents the document fine if HTML version of the document is changed to 4.0 or if <th> is changed into <td>.
It is a valid element, table cell header. The "full" code is <table> <thead> <tr> <th> <div class="ui checkbox"> <input type="checkbox"><label class="label">Select</label> </div> </th> </tr> </thead>
Then the mistake is not in the indenter but in the HTML's DTD(??)(or in NetBeans support for it?) because it reports <th> as erroneous.
I'm sorry I left out the closing </table> in the code from comment #3. Which DTD do you have? I have <!DOCTYPE html> and it does not show any errors (when the </table> is present)
Sorry Lada, I'm pretty cryptic too. Here is what I did: I removed "<!DOCTYPE html>" from the top of the HTML document. That makes "HTML version cannot be determined" light bulb come up. Now if I change (using this light bulb) "project default to HTML 4.*" then re-indentation works; if I switch it to "HTML 5" then re-indentation is broken. So my quick conclusion is that HTML 5 DTD (or whatever it is for HTML5) tells indenter that combination of tags is invalid and hence the indentation gets broken. I can be wrong of course.
I checked current version of Netbeans and this is already fixed. <!DOCTYPE html> <html> <head> <title>TODO supply a title</title> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> </head> <body> <table> <thead> <tr> <th> <div class="ui checkbox"> <input type="checkbox"><label class="label">Select</label> </div> </th> </tr> </thead> </table> </body> </html> Probably Netbeans DTD for HTML5 missed that th can be child of tr. I updated current version of Netbeans HTML5 dtd. Product Version: NetBeans IDE Dev (Build 201508280002) Java: 1.8.0_51; Java HotSpot(TM) 64-Bit Server VM 25.51-b03 Runtime: Java(TM) SE Runtime Environment 1.8.0_51-b16