-
Bug
-
Resolution: Unresolved
-
Minor
-
None
The build history sidepanel widget calls Run#getTruncatedDescription to render a subset of a build's description inside itself: https://github.com/jenkinsci/jenkins/blob/d2a4a44a5c10ff9f32632fdd628deed275ea39a1/core/src/main/resources/hudson/widgets/HistoryWidget/entry.jelly#L81
This method is bad as explained in its Javadoc: https://github.com/jenkinsci/jenkins/blob/d2a4a44a5c10ff9f32632fdd628deed275ea39a1/core/src/main/java/hudson/model/Run.java#L696
A different, better approach would be to do the following:
- Have the configured MarkupFormatter render the entire description of the build as HTML.
- Truncate that (using similar rules)
- Pipe the result through an HTML formatter to ensure valid HTML (e.g., all tags that were opened are closed)
- Use that.