Jenkins 职位描述中支持哪些 html [英] Which html is supported in Jenkins job description

查看:24
本文介绍了Jenkins 职位描述中支持哪些 html的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

In the Job description you can use Html tags. I have something like:

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

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

But the target="_blank" seems to get scrubbed somewhere. Is there another way? Any doc on whats supported and what's not?

推荐答案

Jenkins 允许您使用各种标记语言来编写工作描述;插件可以通过 MarkupFormatter 接口.

Jenkins allows you to use various markup languages to write job descriptions; plugins can define how the description should be parsed via the MarkupFormatter interface.

默认情况下,RawHtmlMarkupFormatter 被使用,它应用了 HTML 清理策略(来自 OWASP AntiSamy 项目) —Myspace 政策.

By default, the RawHtmlMarkupFormatter is used, which applies an HTML sanitisation policy (from the OWASP AntiSamy Project) — the Myspace policy.

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

In the Myspace policy, you'll see that only certain tags and attributes are allowed. target isn't one of them, which is why you see it being stripped from your input.

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

For your use case, the alternatives are to install and configure another markup formatter plugin, or to write your own. Some examples include:

  • Escaped Markup Plugin: escapes all HTML tags (probably not so useful for you)
  • "Anything Goes" Formatter: allows any HTML input at all (with the associated security risks)
  • PegDown Formatter Plugin: lets you write your descriptions in Markdown (probably the nicest option here, but likely doesn't support things like target="_blank")

这篇关于Jenkins 职位描述中支持哪些 html的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆