Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

How to add linefeed or newline in description?

Hi,

This is RAM version is v7.2.0.1, I have a long string with line feeds characters in it to break the string into a few lines, I have it print the string out on the java console and it appears the linefeed works. But when assign it to newAsset.setDescription(String), on the web client, the description section appear not having any linefeeds or new lines, it appear to be one long string. I have tried both "\n" and "\r\n" and both failed to appear.

Thanks!

JR.

0 votes



6 answers

Permanent link
Have you tried encoding it in hex?


<ram>
BUILD_LABEL = ${build.label}

BUILD_URL = <a href='${build.url}' target='_blank' > Build Info<a>

SOURCE_REPOSITORY_ADDRESS = <a href='${src.repository}' target='_blank' > Source Repository<a>

BUILD_RESULT_UUID = ${build.id}

BUILD_DEFINITION_ID = ${build.def.id}

</ram>



Hi,

This is RAM version is v7.2.0.1, I have a long string with line feeds characters in it to break the string into a few lines, I have it print the string out on the java console and it appears the linefeed works. But when assign it to newAsset.setDescription(String), on the web client, the description section appear not having any linefeeds or new lines, it appear to be one long string. I have tried both "\n" and "\r\n" and both failed to appear.

Thanks!

JR.

0 votes


Permanent link
You can include HTML in your description. For a new line, you could use a <br> tag.

newAsset.setDescription("line 1<br>line 2");

0 votes


Permanent link
Reply to Chris message:
Did you try it yourself before you suggest this?

I just tried it, it got worst, all appear in Hex codes.






Have you tried encoding it in hex?


<ram>
BUILD_LABEL = ${build.label}

BUILD_URL = <a href='${build.url}' target='_blank' > Build Info<a>

SOURCE_REPOSITORY_ADDRESS = <a href='${src.repository}' target='_blank' > Source Repository<a>

BUILD_RESULT_UUID = ${build.id}

BUILD_DEFINITION_ID = ${build.def.id}

</ram>



Hi,

This is RAM version is v7.2.0.1, I have a long string with line feeds characters in it to break the string into a few lines, I have it print the string out on the java console and it appears the linefeed works. But when assign it to newAsset.setDescription(String), on the web client, the description section appear not having any linefeeds or new lines, it appear to be one long string. I have tried both "\n" and "\r\n" and both failed to appear.

Thanks!

JR.

0 votes


Permanent link
Yes Sheehan, your suggestion works but not Chris's.
Thanks SheeHan



You can include HTML in your description. For a new line, you could use a <br> tag.

newAsset.setDescription("line 1<br>line 2");

0 votes


Permanent link
No, sorry I didn't try it. It came straight out of one of the examples.

Silly me... :-)

-Chris

Reply to Chris message:
Did you try it yourself before you suggest this?

I just tried it, it got worst, all appear in Hex codes.






Have you tried encoding it in hex?


<ram>
BUILD_LABEL = ${build.label}

BUILD_URL = <a href='${build.url}' target='_blank' > Build Info<a>

SOURCE_REPOSITORY_ADDRESS = <a href='${src.repository}' target='_blank' > Source Repository<a>

BUILD_RESULT_UUID = ${build.id}

BUILD_DEFINITION_ID = ${build.def.id}

</ram>



Hi,

This is RAM version is v7.2.0.1, I have a long string with line feeds characters in it to break the string into a few lines, I have it print the string out on the java console and it appears the linefeed works. But when assign it to newAsset.setDescription(String), on the web client, the description section appear not having any linefeeds or new lines, it appear to be one long string. I have tried both "\n" and "\r\n" and both failed to appear.

Thanks!

JR.

0 votes


Permanent link
Remember that on the web, the description is rendered as HTML ... so line feeds and such are ignored by the browser.

0 votes

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details

Question asked: Oct 28 '11, 4:18 p.m.

Question was seen: 6,451 times

Last updated: Oct 28 '11, 4:18 p.m.

Confirmation Cancel Confirm