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.
Summary: | Incorrect formatting for div nested inside th element | ||
---|---|---|---|
Product: | web | Reporter: | _ gtzabari <gtzabari> |
Component: | HTML Editor | Assignee: | Milutin Kristofic <mkristofic> |
Status: | RESOLVED WORKSFORME | ||
Severity: | normal | ||
Priority: | P3 | ||
Version: | 8.0 | ||
Hardware: | PC | ||
OS: | Windows 7 | ||
Issue Type: | DEFECT | Exception Reporter: |
Description
_ gtzabari
2014-05-18 04:07:26 UTC
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 |