html css 返回行?

Not*_*let -4 html javascript css

我有来自服务器的 JSON 响应,在此数据中,我在文本中有一个“返回行”。

{text: "I am in the first line ? and I am in the second line"}
Run Code Online (Sandbox Code Playgroud)

但是当我在 html 中显示它时,没有显示“返回行”。

"I am in the first line and I am in the second line"
Run Code Online (Sandbox Code Playgroud)

代替:

I am in the first line
and I am in the second line
Run Code Online (Sandbox Code Playgroud)

任何使用 HTML 或 CSS(可能是 JavaScript)的解决方案?

谢谢 !

Not*_*let 5

添加这个css类解决问题!

white-space: pre-line;
Run Code Online (Sandbox Code Playgroud)