Bug 260011 - [formatter] Formatting of html in javadoc comments doesn't work with style attributes
Summary: [formatter] Formatting of html in javadoc comments doesn't work with style at...
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.4.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.5 M6   Edit
Assignee: Frederic Fusier CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-01-05 19:19 EST by Brett Mising name CLA
Modified: 2009-03-09 12:20 EDT (History)
1 user (show)

See Also:


Attachments
Proposed patch (7.73 KB, patch)
2009-02-24 06:15 EST, Frederic Fusier CLA
no flags Details | Diff
Better patch (17.53 KB, patch)
2009-02-26 12:34 EST, Frederic Fusier CLA
no flags Details | Diff

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