Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 196308 - [formatter] Don't escape entity when formatting in <pre> tags within javadoc comments
Summary: [formatter] Don't escape entity when formatting in <pre> tags within javadoc ...
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.3   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.5.1   Edit
Assignee: Frederic Fusier CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 204257 238547 (view as bug list)
Depends on:
Blocks: 280616
  Show dependency tree
 
Reported: 2007-07-12 09:29 EDT by Johannes Bialek CLA
Modified: 2009-08-27 14:05 EDT (History)
4 users (show)

See Also:


Attachments
Proposed patch (11.19 KB, patch)
2009-06-16 11:17 EDT, 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 Johannes Bialek CLA 2007-07-12 09:29:22 EDT
The feature to format java-doc comments is awesome. But I miss the feature to turn of the escaping of html entities like &at;. When writing example code for my java 5 application I need to write "&at;MyAnnotation"  inside a javadoc comment, which will end up as "&amp;at;MyAnnotation" in the javadoc.
Comment 1 Johannes Bialek CLA 2007-07-12 09:38:22 EDT
To reproduce the issue, activate "Format Java code snippets inside 'pre' tags" and write &at; inside a <pre> tag within a javadoc comment. Then format the file and see it has been transformed into &amp;at
Comment 2 Markus Keller CLA 2008-07-16 09:44:43 EDT
The formatter should not touch html entities at all. No new option needed. Adjusting summary. See also bug 238547.
Comment 3 Markus Keller CLA 2009-06-08 08:20:13 EDT
*** Bug 238547 has been marked as a duplicate of this bug. ***
Comment 4 Markus Keller CLA 2009-06-08 09:56:37 EDT
*** Bug 204257 has been marked as a duplicate of this bug. ***
Comment 5 Frederic Fusier CLA 2009-06-16 11:17:39 EDT
Created attachment 139305 [details]
Proposed patch

When text inside <pre> tag is not valid Java code then skip HTML tags transformation...
Comment 6 Frederic Fusier CLA 2009-06-16 11:18:06 EDT
Released for 3.6M1 in HEAD stream.
Comment 7 Frederic Fusier CLA 2009-06-16 11:23:03 EDT
Olivier,

After having heavily tested this change on Ganymede and JDKs full source workspace (~70,000 units formatted), I think this fix may be a good candidate for 3.5.1 as it fixes lot of invalid HTML tags transformation inside <pre> tags while formatting comments...

We have this issue since day 1 and I'm quite sure that many users have disabled comments formatting due to this issue as usage of <pre> is very common...

What do you think?
Comment 8 Olivier Thomann CLA 2009-06-16 11:28:46 EDT
I agree. This is really annoying.
+1 for 3.5.1.
Comment 9 Frederic Fusier CLA 2009-06-17 05:34:45 EDT
Released for 3.5.1 in R3_5_maintenance stream.
Comment 10 Srikanth Sankaran CLA 2009-08-03 05:44:19 EDT
Verified for 3.6M1 using build I20090802-2000
Comment 11 Frederic Fusier CLA 2009-08-03 08:26:27 EDT
Should not have been set as VERIFIED because target is not 3.6M1 but 3.5.1...
Comment 12 Frederic Fusier CLA 2009-08-03 08:27:01 EDT
...but it's still fixed.
Comment 13 Srikanth Sankaran CLA 2009-08-04 00:31:16 EDT
*** Bug 204257 has been marked as a duplicate of this bug. ***
Comment 14 Olivier Thomann CLA 2009-08-27 14:05:18 EDT
Verified for 3.5.1RC2 using M20090826-1100.