I have some json that I want to display in a web page. However, the pre tag is stripping out and honoring the breaks in the output?
How can I display some json as such and keep all the text as is?
NOTE: i don't have control over the syntax. that is what is coming into my service so I'm just taking it and injecting it in the html into a pre.
<div>
<pre>
{
"text:" "testing line breaks<br/>new line"
}
</pre>
</div>
Output:
{
"text:" "testing line breaks
new line"
}
Expected Output:
{
"text:" "testing line breaks<br/>new line"
}