Fix truncated build description for non-HTML based markup formatters

This issue is archived. You can view it, but you can't modify it. Learn more

XMLWordPrintable

      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:

      1. Have the configured MarkupFormatter render the entire description of the build as HTML.
      2. Truncate that (using similar rules)
      3. Pipe the result through an HTML formatter to ensure valid HTML (e.g., all tags that were opened are closed)
      4. Use that.

            Assignee:
            Unassigned
            Reporter:
            Daniel Beck
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Archived: