I'm creating new UserRequest in iTop through the API. The description of the Request contains carriage returns (\n).
Once the request is created and I open it in iTop, the description does not contain any carriage return, everything is on one line.
Is there a way to keep them ? Do I need a specific encoding or something like it ?
Thanks!
Nicolas
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I'm creating new UserRequest in iTop through the API. The description of the Request contains carriage returns (\n).
Once the request is created and I open it in iTop, the description does not contain any carriage return, everything is on one line.
Is there a way to keep them ? Do I need a specific encoding or something like it ?
Thanks!
Nicolas
My api calls with line breaks are in fact formatted as \r\n.
Hello Nicolas,
I don't recall exactly how it works, but did you try sending the description as HTML? (using
<br/>
for line returns)Hope it helps,
Guillaume
Hi Guillaume,
Thank you for your help !
While doing
str_replace("\r\n", "<br/>", $description)
is a bit dirty, it works...If it works, it works ;-)
Thanks again !
Last edit: mls.nicolas 2024-08-19