How to add new line in jelly file

15 views
Skip to first unread message

selva vignesh

unread,
Jun 24, 2019, 1:11:20 PM6/24/19
to Jenkins Developers
Hi ,
I am working in Jenkins plug-in and I want to show some content
in UI where I am using jelly.And I tried many ways even I have given <br/> tag appended in string. Still no use in Jenkins version 2.150.3. But It’s working upper version.
Can anyone help me to how to add new line.

Gavin Mogan

unread,
Jun 24, 2019, 2:13:20 PM6/24/19
to jenkin...@googlegroups.com
So when asking questions, its usually good to follow these rules:
1) What have I tried?
2) What do I expect it to do?
3) What does it do?

so for 1) you mention <br/> but not how you use it, nor do you mention what your template looks like.
2) Other than "Expect it to work" i don't really know what you are expecting,
3) No idea (does the <br/> show up in view source?)

I'm guessing you are using a variable and outputting the variable with a new line. By default jelly will now escape any html in variables to prevent security issues. So if you are adding <br /> inside a variable, it'll probably not work.
IF you are just wanting newlines to work, you could wrap your content in a PRE tag, and then newlines should work.
But generally you shouldn't have formatting in your variables.

If i made the wrong guess and you are trying something else, then I need 1,2,3 answered again.



--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/992c5057-fb67-4edf-b537-4d3d7a9686c4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

selva vignesh

unread,
Jun 25, 2019, 2:10:51 AM6/25/19
to jenkin...@googlegroups.com
Hi Gavin,
You guessed correctly. 
Thanks for your answer and i'll try to wrap the content. In future, i will properly explain my question

Reply all
Reply to author
Forward
0 new messages