Skip to content
Permalink
Browse files

[FIXED JENKINS-18427] use MarkupFormater

  • Loading branch information
ndeloof committed Jun 21, 2013
1 parent 9108ab7 commit 0449e79c0e760438eb59967bbe8b145f68e8974b
@@ -201,6 +201,10 @@ <h3><a name=v1.517>What's new in 1.517</a> (2013/06/02)</h3>
<li class=bug>
Using proper directory separator character for permalinks on Windows.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-17681">issue 17681</a>)
<li class="bug">
Use markup formater to display parameter description.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-18427">issue 18427</a>)
</li>
</ul>
<h3><a name=v1.516>What's new in 1.516</a> (2013/05/27)</h3>
<ul class=image>
@@ -137,6 +137,14 @@ public String getDescription() {
return description;
}

public String getSafeDescription() {

This comment has been minimized.

Copy link
@kutzi

kutzi Jun 21, 2013

Member

@SInCE missing. Also Javadoc would be nice - especially to describe in which way this description is 'safe'

try {
return Jenkins.getInstance().getMarkupFormatter().translate(description);
} catch (IOException e) {
return "failed to translate description using configured markup formatter";

This comment has been minimized.

Copy link
@kutzi

kutzi Jun 21, 2013

Member

exception details should not be swallowed IMO. Log them to the log file

}
}

/**
* {@inheritDoc}
*/
@@ -26,8 +26,8 @@ THE SOFTWARE.
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define"
xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form"
xmlns:i="jelly:fmt" xmlns:p="/lib/hudson/project">
<f:entry title="${it.name}" description="${it.description}">
<div name="parameter" description="${it.description}">
<f:entry title="${it.name}" description="${it.safeDescription}">
<div name="parameter">
<input type="hidden" name="name" value="${it.name}" />
<f:textbox name="value" value="${it.defaultValue}" />
</div>
@@ -1724,7 +1724,7 @@ function shortenName(name) {
// see http://wiki.jenkins-ci.org/display/JENKINS/Structured+Form+Submission
function buildFormTree(form) {
try {
// I initially tried to use an associative array with DOM elemnets as keys
// I initially tried to use an associative array with DOM elements as keys
// but that doesn't seem to work neither on IE nor Firefox.
// so I switch back to adding a dynamic property on DOM.
form.formDom = {}; // root object

1 comment on commit 0449e79

@jglick

This comment has been minimized.

Copy link
Member

@jglick jglick commented on 0449e79 Aug 1, 2013

Normally this is done directly in Jelly with no helper method, by replacing ${text} with ${app.markupFormatter.translate(text)}. That is simpler and avoids the need for discussing whether this should be documented with @since, use @Restricted(NoExternalUse.class), etc.

Please sign in to comment.
You can’t perform that action at this time.