Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-72866

Fix truncated build description for non-HTML based markup formatters

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • core
    • 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:

      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.

            Unassigned Unassigned
            danielbeck Daniel Beck
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: