如何在詹金斯的描述中添加新行

How to add new line to description in Jenkins

当我以编程方式更改描述时,如何在 Jenkins 中向描述添加新行?

我试过这样的事情:

job.builds[0].description = "hello" << '\n' << "world"

并且控制台脚本打印良好:

hello

world

但在 Jenkins 的描述中,此作业 "hello world" 在 helloworld

之间没有换行符

有什么办法吗?

好的, 我找到了答案。

描述是原始的Html。

要创建新行,我们必须写:

job.builds[0].description = "hello<br> world"

控制台将其打印为 hello<br> world,但在描述中将换行。