Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 355748

Summary: [formatting] Formatter ignores inline setting for tag a (as in <a href=...); results in newline and unwanted spaces in rendered page.
Product: [WebTools] WTP Source Editing Reporter: Zach Toups <toupsz>
Component: wst.htmlAssignee: wst.html <wst.html-inbox>
Status: RESOLVED WORKSFORME QA Contact: Nick Sandonato <nsand.dev>
Severity: normal    
Priority: P3 CC: thatnitind, toupsz, zalapa
Version: unspecified   
Target Milestone: Future   
Hardware: Macintosh   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:

Description Zach Toups CLA 2011-08-24 12:35:46 EDT
Build Identifier: 20110615-0604

Formatting an HTML page results in additional, unwanted spaces because the formatter introduces a newline after the </a> tag. The tag is specified as inline in the formatter settings. The same thing does not happen, for example, with the </i> tag, which is also listed as inline.

example:
PRE-format:
Please click <a href="hi.html">this link</a>.

POST-format:
Please click
<a href="hi.html">this link</a>
.

Reproducible: Always

Steps to Reproduce:
1. Create an HTML file and open with the HTML editor.
2. Create a pair of <a> tags that should NOT have a space after the closing tag.
3. Run Source > Format
Comment 1 Salvador Zalapa CLA 2013-07-25 10:29:11 EDT
This particular example works as design since a newLine should be add if the parent Node is the DOCUMENT_NODE. On the other hand if you have the following: 

<html>
<a>test</a>.
</html>

the format will honor the inline element, and do not add an extra new line. I think that this bug should be marked as resolved.
Comment 2 Salvador Zalapa CLA 2013-09-11 09:51:18 EDT
Resolving due to my last comment.