Jenkins 职位描述中支持哪些 html

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/18867232/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-29 13:32:22  来源:igfitidea点击:

Which html is supported in Jenkins job description

htmljenkins

提问by Niek

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

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

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

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

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

回答by Christopher Orr

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

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

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

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

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

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

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

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