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.
See reformatted code: <table> <tr> <td> </table> The <td> tag should be indented. Now it is probably because of <br>, <p>, <hr>, ... tags without closing tag pair handling. It could be improved to distinguish between tags of category A) <br>, <p>, <hr>, ... -- user doesn't want to have next tags indented B) <table>, <tr>, <td>, <dl>, <li>, ... -- user wants to have next tags indented until the same tag appears as a sibling Notice: source is nbusers mailing list.
I am the original poster of this issue to the nb alias. I am not sure that it has anything to do with the tags listed below. <code> <table> <tr> <td align="right"> <fmt:message key="login.username"/> : </td> <td> <input type="text" name="<fmt:message key="login.username.field"/>"> </td> <tr> <td align="right"> <fmt:message key="login.password"/>: </td> <td> <input type="password" name="<fmt:message key="login.password.field"/>"> </td> </tr> </table> </code> As you can see the first table row (<TR>) has one <TD> element in it but is not indented correctly. I have even removed the custom tag inclosed in the <TD> and still the formater will not work. Nathan
Though the formatting issue has already been fixed, this is a nice description of the problem with HTML end-tag autocompletion and indentation. The only html tags with required end tags are autocompleted and indented. The problem is that widely and often used tags like <tr> <td> etc. has optional end so they are not indented when user types them and presses enter. One possible solution is to create a list of tags with wants to behave like they have required end and take this list into account when resolving the end-tag-requireness in the indentation code.
We can divide tags into 3 categories (also using HTMLSyntaxSupport) : 1) end tag is required (<table>) 2) end tag is optional (<tr>) 3) end tag is not allowed (<br>) For now our policy is to encourage users to close tags with optional ending and have a more consistent formatting ruleset
In light of HTML5 I would vote for <br> not leading to an ident of next line. Now I have to use <br /> to avoid crappy formatting in my code.