Jelly is trimming my line endings

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Jelly is trimming my line endings

tiharris-2
Hi,

I have an ArrayList of Strings that I want to show in the summary view
using the foreach element.

<j:forEach trim="false" var="List" items="${it.getSomething()}">
    ${List}<br/><br/>
</j:forEach>

The line endings in my entries seem to be stripped away even though I
set trim to false.

Any ideas as how to overcome this?
Reply | Threaded
Open this post in threaded view
|

Re: Jelly is trimming my line endings

kohsuke Kawaguchi (CB)

What's called as "ignorable whitespace" in XML jargon is removed. To
avoid that, use <j:whitespace>, like

<pre>
   <j:forEach ...>
     <j:whitespace>${text}
</j:whitespace>
   </j:forEach>
</pre>

By having <j:whitespace> contain NL, it'll be preserved and the output
will include NL.

On 03/09/2011 05:57 AM, tiharris wrote:

> Hi,
>
> I have an ArrayList of Strings that I want to show in the summary view
> using the foreach element.
>
> <j:forEach trim="false" var="List" items="${it.getSomething()}">
>      ${List}<br/><br/>
> </j:forEach>
>
> The line endings in my entries seem to be stripped away even though I
> set trim to false.
>
> Any ideas as how to overcome this?
>


--
Kohsuke Kawaguchi | CloudBees, Inc. | http://cloudbees.com/
Reply | Threaded
Open this post in threaded view
|

Re: Jelly is trimming my line endings

Sven Strittmatter
In reply to this post by tiharris-2
Hello,

Am 09.03.11 14:57, schrieb tiharris:
> Any ideas as how to overcome this?
Would suggest:

<j:forEach trim="false" var="List" items="${it.getSomething()}">
        <p>${List}</p>
</j:forEach>

IMHO better HTML

-Sven

Reply | Threaded
Open this post in threaded view
|

Re: Jelly is trimming my line endings

tiharris
This post has NOT been accepted by the mailing list yet.
In reply to this post by kohsuke Kawaguchi (CB)
Many thanks :-)