Reputation: 349
i want to break a line and used \n but its not working. creating Lambda function.
callback(buildFulfilmentResult('Fulfilled',"Thanks, for using our services " +item.Name+ " Your Flight status is Confirmed \n Arrival city: " +item.Arrival_city));
how to do then?
Upvotes: 0
Views: 359
Reputation: 1090
we need more information about how the text is being displayed to give you a really good answer.
Handling line breaks is the responsibility of the entity handling the display, and so, what you need to send depends greatly on how the text is being displayed.
For example, if your chat bot is for the web, you might be able to get it to display line breaks by sending <br> instead of \n, since that is the line break code for HTML.
That said -- accepting and displaying raw HTML from your back end could represent a serious security risk.
If I was designing a this whole thing, I would use \n to represent the line break in NodeJS, and on the web where I displayed the text, I would
display: block
, and .textContent
property.This final step avoids making the browser parse HTML, mitigating that security risk.
Upvotes: 1