144

I have two Jenkins instances running. An old (legacy) one at version 1.614 and a new one with 1.633.

In the old one it is possible to use HTML in the job description (it even does syntax highlighting editing it). The new one doesn't. HTML content is escaped and shown as plain text. I could not find a change in the release notes explaining this behavior. Is there a configuration that I'm missing?

approxiblue
  • 6,982
  • 16
  • 51
  • 59
user1587852
  • 1,567
  • 2
  • 11
  • 15
  • 1
    You might also want to take a look at different markups: https://wiki.jenkins.io/display/JENKINS/Markup+formatting – hardmooth Sep 22 '17 at 07:12

2 Answers2

314

In the Global security menu:

enter image description here

Select this value to display HTML:

enter image description here

Bruno Lavit
  • 10,184
  • 2
  • 32
  • 38
  • 2
    ref: https://stackoverflow.com/questions/18867232/which-html-is-supported-in-jenkins-job-description – qxo Jul 05 '17 at 09:38
  • 1
    Thanks! For those, like me, behind a firewall and does not have this option available at the ComboBox... install one of these plugins manually, like this one: https://wiki.jenkins.io/display/JENKINS/PegDown+Formatter+Plugin#PegDownFormatterPlugin-install – Ualter Jr. Dec 02 '17 at 12:44
  • 9
    You need to Install [OWASP Markup Formatter Plugin](https://wiki.jenkins.io/display/JENKINS/OWASP+Markup+Formatter+Plugin) before. – Symon Feb 07 '18 at 14:15
  • Thanks for the answer. I wonder how one can enable Safe Html as a code inside Jenkins configuration? Any examples? – Shahnur Isgandarli May 27 '21 at 14:22
  • @ShahnurIsgandarli I'm sorry, I have no idea on how to do that – Bruno Lavit May 28 '21 at 15:18
  • For html code(description) in "pipeline(or jenkinsfile) code" check this out - https://stackoverflow.com/questions/68041201/jenkins-parameterised-build-description-in-html-format?noredirect=1&lq=1 – Robert Ranjan Dec 27 '21 at 19:39
  • 1
    Very helpful one @BrunoLavit – Sriharsha Kalluru Oct 06 '22 at 16:05
1

For enabling it via config: you have to install the configuration as code (CASC) plugin (https://plugins.jenkins.io/configuration-as-code/) , and add the following entries to your config file(s - I guess, it is better to have multiple files for a better overview):

    markupFormatter:
      rawHtml:
        disableSyntaxHighLighting: false

If you don't need highlighting, change it to true