|
Re: HTML/JSP Formatting [message #510990 is a reply to message #510871] |
Fri, 29 January 2010 13:17 |
|
The behavior you are seeing in the HTML/JSP formatting is the expected behavior. I am a little fuzzy on the details but I know a few years back the community was telling the developers that is how they wanted HTML/JSP pages formatted with only some tags automatically indented (I think block tags?, but I know table tags are) . I do know presently that the sentiment from the community has changed and there have been more requests to see HTML/JSP formatting like that of XML.
There are already many bugs open in Bugzilla, see search here, that are requests for improving the JSP/HTML formatting experience. The team has not yet decided the best course of action for this issue but it is certainly one that is not being ignored. I suggest if you want to show your support for a fix in this area that you cast your vote on one of the bugs/enhancements that seems most like what you are looking for.
Blue Skies,
~Ian
Ian Tewksbury
WTP JavaScript Tools
IBM Rational
-----
“When once you have tasted flight, you will forever walk the earth with your eyes turned skyward, for there you have been, and there you will always long to return.” ~Leonardo da Vinci
|
|
|
Re: HTML/JSP Formatting [message #511049 is a reply to message #510871] |
Fri, 29 January 2010 16:13 |
Eclipse User |
|
|
|
Originally posted by: nowhere.a.com
farrelly.john@gmail.com wrote :
> Eclipse isn't formatting/indenting HTML/JSP files as I expect. I will
> illustrate with a simple HTML.
>
> If I create a file 1.xml, with the content:
>
> <html><body><h1>This is a test</h1></body></html>
>
> And the press Ctrl-f to format the code, it formats it as I expect:
>
>
> <html>
> <body>
> <h1>This is a test</h1>
> </body>
> </html>
>
>
> However, if I do the same thing with a file 1.html, after hitting Ctrl-f, I
> am left with:
>
>
> <html>
> <body>
> <h1>This is a test</h1>
> </body>
> </html>
>
>
> No indentation. This makes large HTML files difficult to read. This
> situation is often worst with JSP files, where after formatting parts of tags
> get merged onto the same line. Sometimes the above code gets in a .jsp file
> gets formatted as:
>
>
> <html>
> <body><h1>This is a test</h1></body>
> </html>
I do not use auto-formatting in JSP files at all. Because of the way
some browsers interpret HTML, having extra white space could cause an
un-planned line break in the rendered page.
<soan><%= value1 %>&bnsp;<%= value2 %></span>
looks quite different than
<span>
<%= value1 %>
&bnsp;
<%= value2 %>
</span>
For the auto-formatter to determine when it is ok to break up lines
approaches AI capabilities.
And it is worse when you have code snippets interspersed.
--
Wojtek :-)
|
|
|
|
|
Re: HTML/JSP Formatting [message #647071 is a reply to message #510871] |
Tue, 04 January 2011 13:18 |
|
I can't seem to find the bug number but the formatting was recently revamped in WTP 3.2.x and 3.3 streams to work the way you would expect along with more options for controlling what gets indented.
The one thing I know the changes do not do is indent <body> or <head> under <html> but all other indenting happens as you describe it now.
~Ian
Ian Tewksbury
WTP JavaScript Tools
IBM Rational
-----
“When once you have tasted flight, you will forever walk the earth with your eyes turned skyward, for there you have been, and there you will always long to return.” ~Leonardo da Vinci
|
|
|
Powered by
FUDForum. Page generated in 0.03189 seconds