提交 9eae46de 编写于 作者: B bap2000

[FIXED JENKINS-10509] Make syntax highlighting optional

上级 7228d6f0
......@@ -55,7 +55,9 @@ Upcoming changes</a>
<!-- Record your changes in the trunk here. -->
<div id="trunk" style="display:none"><!--=TRUNK-BEGIN=-->
<ul class=image>
<li class=>
<li class=rfe>
Make syntax highlighting optional
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-10509">issue 10509</a>)
</ul>
</div><!--=TRUNK-END=-->
......
......@@ -13,8 +13,16 @@ import java.io.Writer;
* @author Kohsuke Kawaguchi
*/
public class RawHtmlMarkupFormatter extends MarkupFormatter {
final boolean disableSyntaxHighlighting;
@DataBoundConstructor
public RawHtmlMarkupFormatter() {
public RawHtmlMarkupFormatter(final boolean disableSyntaxHighlighting) {
this.disableSyntaxHighlighting = disableSyntaxHighlighting;
}
public boolean isDisableSyntaxHighlighting() {
return disableSyntaxHighlighting;
}
@Override
......@@ -23,7 +31,7 @@ public class RawHtmlMarkupFormatter extends MarkupFormatter {
}
public String getCodeMirrorMode() {
return "htmlmixed";
return disableSyntaxHighlighting ? null : "htmlmixed";
}
public String getCodeMirrorConfig() {
......@@ -38,5 +46,5 @@ public class RawHtmlMarkupFormatter extends MarkupFormatter {
}
}
public static MarkupFormatter INSTANCE = new RawHtmlMarkupFormatter();
public static MarkupFormatter INSTANCE = new RawHtmlMarkupFormatter(false);
}
......@@ -4,4 +4,7 @@
<f:description>
${%blurb}
</f:description>
<f:entry field="disableSyntaxHighlighting">
<f:checkbox title="${%disableSyntaxHighlighting}"/>
</f:entry>
</j:jelly>
blurb=Treat the text as HTML and use it as is without any translation
\ No newline at end of file
blurb=Treat the text as HTML and use it as is without any translation
disableSyntaxHighlighting=Disable syntax highlighting
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册