jenkins job description safe html font color设置后无效

查下了原因是以为 最新版本的插件 antisamy-markup-formatter.jpi 为了安全更新导致的:
将 Jenkins 升级到最新的 LTS 版本 2.263.1 后,将 HTML 放入工作描述或构建描述以某种方式在服务器端进行处理并删除一些内容,例如:
After upgrading Jenkins to the latest LTS version 2.263.1 the HTML put in job description, or build description is somehow processed server side and stuff is removed, like:

"font" tags are removed completely
IMPACT:   lost all formatting (color, font size, font effects)
workarround is to set the font as a style  
source:           <li><font size="2" color="purple"> MESSAGE </font></li>
rendered:        <li> MESSAGE </li>
solution:          <li style="color:purple!important; font-size:20px"> MESSAGE </li>
"title" attributes are removed from all tags
IMPACT:   no more tooltips on our tables
No workaround
source:         <td title="TOOLTIP"> MESSAGE </td>
rendered:      <td> MESSAGE </td>
"rowspan" / "colspan" attributes are removed from "td" and "th" tags
IMPACT:   pre-existent tables are now misaligned 
No workaround
source:        <th rowspan="2" colspan="3">Build</th>
rendered:     <th>Build</th>

jenkins issue 地址

解决办法删除下最新的插件,下载之前的版本如1.8重启即可:

https://updates.jenkins.io/download/plugins/antisamy-markup-formatter/1.8/antisamy-markup-formatter.hpi

Logo

技术共进,成长同行——讯飞AI开发者社区

更多推荐