Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 355748 - [formatting] Formatter ignores inline setting for tag a (as in <a href=...); results in newline and unwanted spaces in rendered page.
Summary: [formatting] Formatter ignores inline setting for tag a (as in <a href=...); ...
Status: RESOLVED WORKSFORME
Alias: None
Product: WTP Source Editing
Classification: WebTools
Component: wst.html (show other bugs)
Version: unspecified   Edit
Hardware: Macintosh Mac OS X - Carbon (unsup.)
: P3 normal with 1 vote (vote)
Target Milestone: Future   Edit
Assignee: wst.html CLA
QA Contact: Nick Sandonato CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-24 12:35 EDT by Zach Toups CLA
Modified: 2013-09-11 09:51 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.