AngularJS - Remove \n from data

后端 未结 6 1858
时光取名叫无心
时光取名叫无心 2021-02-07 20:07

What is the best way to catch and format the \"\\n\\n\" inside of text being passed from the server to display line breaks? Fiddle is here: http://jsfiddle.net/nicktest2222/2vYB

6条回答
  •  一个人的身影
    2021-02-07 20:14

    You have the following options:

    • use pre tag and keep \n
    • use white-space:pre css rule and keep \n
    • replace \n with
      tag as @sza offered.

提交回复
热议问题