24

在职位描述中,您可以使用 Html 标签。我有类似的东西:

blabla.. on <a href="http://vms029/wa_shdw" target="_blank">http://vms029/wa_shdw</a>

target="_blank"似乎在某处被擦洗了。还有其他方法吗?关于支持什么和不支持什么的任何文档?

4

2 回答 2

38

Jenkins 允许你使用各种标记语言来编写工作描述;插件可以定义如何通过MarkupFormatter接口解析描述。

默认情况下,RawHtmlMarkupFormatter使用的是 HTML 清理策略(来自OWASP AntiSamy 项目)—— Myspace 策略

在 Myspace 策略中,您会看到只允许某些标签和属性。target不是其中之一,这就是为什么您看到它被从您的输入中剥离。

对于您的用例,替代方法是安装和配置另一个标记格式化程序插件,或者编写您自己的。一些例子包括:

于 2013-09-18T08:46:05.003 回答
1

Because I had the fun of trying to figure out what exactly should work, documentation is light on usable details, and I don't want to have to do this again in a year or two, here goes:

Any references to RawHtmlMarkupFormatter are obsolete by now. As a comment said, the "safe html" markup is now provided by OWASP Markup Formatter Plugin (antisamy-markup-formatter). The actual tags it permits are visible indirectly in the BasicPolicy which uses org.owasp.html.Sanitizers. These two references together allow figuring out what's really supposed to be ok.

For example <font color=...> used to work back in the day (see MyspacePolicy in the other answer), but appears to no longer be allowed, but enough simple <span style="color:..."> styles are permitted to get somewhere equivalent. This matches the observed behavior of OWASP Markup Formatter 2.0 on a Jenkins instance.

于 2020-10-06T20:47:07.540 回答