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
Which html is supported in Jenkins job description
提问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 MarkupFormatter
interface.
Jenkins 允许您使用各种标记语言来编写职位描述;插件可以定义如何通过MarkupFormatter
接口解析描述。
By default, the RawHtmlMarkupFormatter
is 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. target
isn'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:
对于您的用例,替代方案是安装和配置另一个标记格式化程序插件,或编写您自己的。一些例子包括:
- Escaped Markup Plugin: escapes all HTML tags (probably not so useful for you)
- "Anything Goes" Formatter: allows anyHTML 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"
)
- Escaped Markup Plugin:转义所有 HTML 标签(可能对你没多大用处)
- “Anything Goes” Formatter:完全允许任何HTML 输入(具有相关的安全风险)
- PegDown Formatter Plugin:让你用Markdown写你的描述(可能是这里最好的选择,但可能不支持类似的东西
target="_blank"
)