Bug 260011

Summary: [formatter] Formatting of html in javadoc comments doesn't work with style attributes
Product: [Eclipse Project] JDT Reporter: Brett Mising name <brett.graves>
Component: CoreAssignee: Frederic Fusier <frederic_fusier>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: david_audel
Version: 3.4.1   
Target Milestone: 3.5 M6   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Proposed patch
none
Better patch none

Description Brett Mising name CLA 2009-01-05 19:19:49 EST
Build ID: M20080911-1700

Steps To Reproduce:
1. Under the formatter settings, enable javadoc comment formatting and enable formatting of html tags.
2. Add a comment like the following:
    /**
     * some comment text here
     * <p style="font-variant:small-caps;">
     * some text to be styled a certain way
     * </p>
     */
3. Execute the formatter and the comment should not change, however the opening <p> tag is not recognized as html and gets wrapped up to the previous line, according to the comment line length settings, as if it was normal text.


More information:
By removing the style="" attribute from the paragraph tag it is recognized fine and formats as expected.  I just upgraded from eclipse 3.2 and this worked fine there, not sure exactly when it was broken.
Comment 1 Frederic Fusier CLA 2009-02-24 05:22:49 EST
That still happens using 3.5M5 and this is a regression comparing 3.3 formatter.
Comment 2 Frederic Fusier CLA 2009-02-24 05:30:47 EST
The formatter allows only a few tag to have attributes (currently 'table', 'tr' and 'td') although, looking at HTML 4.0.1 specifications, all may have some (e.g. id, class, lang, title, style, onclick, etc...).

So, I think the best thing to do is to remove the special tags introduced while fixing bug 229107 and accept that tag name may not be always followed by the closing '>' but may have other tokens before...
Comment 3 Frederic Fusier CLA 2009-02-24 06:15:23 EST
Created attachment 126535 [details]
Proposed patch
Comment 4 Frederic Fusier CLA 2009-02-26 12:34:28 EST
Created attachment 126874 [details]
Better patch

This patch fixes some side effects of initial patch discovered while running formatter massive tests...
Comment 5 Frederic Fusier CLA 2009-02-27 10:11:10 EST
Released for 3.5M6 in HEAD stream.
Comment 6 David Audel CLA 2009-03-09 12:20:43 EDT
Verified for 3.5M6 using I20090309-0100.