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: | Better indentation for html tags with optional ends | ||
---|---|---|---|
Product: | web | Reporter: | zikmund <zikmund> |
Component: | HTML Editor | Assignee: | Milutin Kristofic <mkristofic> |
Status: | NEW --- | ||
Severity: | blocker | CC: | jkovalsky |
Priority: | P3 | ||
Version: | 4.x | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | ENHANCEMENT | Exception Reporter: |
Description
zikmund
2004-05-18 15:30:18 UTC
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. |