Bug 159328 - [formatter] Formatting <PRE> tag in JavaDoc using Source->Format
Summary: [formatter] Formatting <PRE> tag in JavaDoc using Source->Format
Status: RESOLVED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P5 minor (vote)
Target Milestone: 3.3   Edit
Assignee: Frederic Fusier CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-09-29 13:52 EDT by Naga Karavadi CLA
Modified: 2009-01-27 05:09 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Naga Karavadi CLA 2006-09-29 13:52:27 EDT
In JavaDoc everything in the <PRE> tag should be preserved when we auto format the code.

A simple test:
/**
 * Class Desc.
 * <BR>
 * History:<BR>
 * <PRE>
 * -------------------------------------------------------------------------
 * Date      Author          Description
 * -------------------------------------------------------------------------
 * 09-28-06  a               a-desc
 * 09-29-06  b               b-desc
 * -------------------------------------------------------------------------
 * </PRE>
 * @author test
 */
public class Test {
}

Formatting this with Ctrl+Shift+F will mangle the stuff inside the <PRE> tags to give you:
/**
 * Class Desc. <BR>
 * History:<BR>
 * 
 * <PRE>
 * 
 * -------------------------------------------------------------------------
 * Date Author Description
 * -------------------------------------------------------------------------
 * 09-28-06 a a-desc 09-29-06 b b-desc
 * -------------------------------------------------------------------------
 * 
 * </PRE>
 * 
 * @author test
 */
Comment 1 Wim Jongman CLA 2007-01-17 12:37:39 EST
I use as a workaround <code></code> which does what I expect from <pre></pre> which is to leave the enclosed stuff as it is. 
Comment 2 Frederic Fusier CLA 2008-08-18 08:07:34 EDT
Ownership has changed for the formatter, but I surely will not have enough time to fix your bug during the 3.5 development process, hence set its priority to P5.
Please provide a patch if you definitely need the bug to be fixed in this version and I'll have a look at it...
TIA
Comment 3 Frederic Fusier CLA 2008-08-18 12:57:41 EDT
Packages for JDT/Core formatting are:
org.eclipse.jdt.core.formatter
org.eclipse.jdt.core.internal.formatter
org.eclipse.jdt.core.internal.formatter.*

However, the interesting code for this is mainly located in the Scribe class.
Note that you surely need to look at other bugs related to the format of <pre>...</pre> html tags, but also to those related to <code>...</code> tags (especially bug 229580).

Please use the bug for further discussion, instead of mails. Then everybody interested by this issue can follow the work progress on it :-)
Comment 4 Wim Jongman CLA 2009-01-11 11:24:27 EST
I wanted to work on this (really i did) but i found it to be solved already. It can be closed.
Comment 5 Frederic Fusier CLA 2009-01-12 05:39:39 EST
Agreed, I cannot reproduce the problem using 3.5M4, 3.4.1, 3.4.0, 3.3.2 or 3.3.0...!
So, closed as WORKSFORME.

Thanks Wim for the feedback :-)
Comment 6 Srikanth Sankaran CLA 2009-01-27 01:39:50 EST
Verified for 3.5M5 using I20090125-2000 build