Community
Participate
Working Groups
Build Identifier: M20110909-1335 The HTML editor inserts extra line brakes before inline closing tag if there is some other inline tag inside. Reproducible: Always Steps to Reproduce: 1. Create an HTML file and open it with HTML editor. 2. Add some inline tag with a some other inline tag inside, for example: <table> <tr> <td>One <b>Two</b> Three</td> </tr> </table> 3. Apply formating (Source -> Format) The result is next: <table> <tr> <td>One <b>Two</b> Three </td> </tr> </table> But should be: <table> <tr> <td>One <b>Two</b> Three</td> </tr> </table> because of "td" is listed in the Inline Elements list in the Preferences -> Web -> HTML Files -> Editor.
<td>One <b>Two</b> Three</td> is not formatted correctly but <td><b>Two</b> Three</td> is. The thing is that the wallowsNewlineAfter() just honor the isInline() property when the firstChildType is an ELEMENT_NODE, and not when is a TEXT_NODE. I am adding an extra condition to handle this issue. I am also extended a junit to cover this. junit: https://github.com/zalapa/webtools.sourceediting.tests/commit/101563c9c38d95ad07941519171037660b8a1aff source: https://github.com/zalapa/webtools.sourceediting/commit/6739b13b93dd22b31139c0f4839e6080507e6d1a
Looks good. Thanks for including a unit test for this as well.
Hey, Chava. After looking a little closer, I think there might be a case where this might need touched up. You can see this if you run the jsp.core unit tests. It seems like it's not properly adding indentation if it's just whitespace text at the end of an element.
Thanks for your review Nick. In the next commit, i am using a different approach to just keep the inline the nodes are in the same line, I already run the HTML and the JSP test unit buckets. https://github.com/zalapa/webtools.sourceediting/commit/e292281e6438434e231badfcbb19aebaa19f776a
Created attachment 233678 [details] Patch for the jsp.iu.test plugin
The patch from comment #4 still works, i also added the patch for the jsp.iu.test plugin.
Yes, I am in compliance with the Certifacte of Origin
3.5.2 is pretty much shut down at this point. Moving to Luna.