Javascript css为json数据添加两行字符

Javascript css为json数据添加两行字符,javascript,css,angularjs,json,Javascript,Css,Angularjs,Json,我有一个json数据,它有行字符,但是当我在html上呈现时,它确实使用style=“white space:pre line”属性添加了新行字符,而我想添加2个新行字符 我的json数据 [{"id":1,"title":"Israel’s desert city of Beersheba is turning into a cybertech oasis","description":"morphing into a tech oasis.\r\nThe military’s massive

我有一个json数据,它有行字符,但是当我在html上呈现时,它确实使用
style=“white space:pre line”
属性添加了新行字符,而我想添加2个新行字符

我的json数据

[{"id":1,"title":"Israel’s desert city of Beersheba is turning into a cybertech oasis","description":"morphing into a tech oasis.\r\nThe military’s massive relocation of its prestigious technology units.\r\nBeersheba has all of the ingredients of a vibrant security technology ecosystem, \r\n“All in all, projections are that 20,000-30,000 \r\nThe commercial sector has teamed up  cyber attacks.","pub_date":"2016-03-20T10:48:19.394643Z"},{"id":2,"title":"These are testing times: mavericks vs. ice people","description":"One of my earliest engineering jobs, before I fled hardware in favor of the (relative). \r\nThe practice of engineering soon teaches one that, .\r\nSo what do we do? We practice defense in depth. We follow the robustness principle. We “always code as \r\n…Yeah, well, that’s the idea. For my day job at HappyFunCorp I do a lot of interviews, and almost every junior develope.\r\nI don’t necessarily blame them. You can make  go.","pub_date":"2016-03-20T10:50:07.965930Z"}]
更清楚地说,json中的描述如下

morphing into a tech oasis.\r\nThe military’s massive relocation of its prestigious technology units.\r\nBeersheba has all of the ingredients of a vibrant security technology ecosystem, \r\n“All in all, projections are that 20,000-30,000 \r\nThe commercial sector has teamed up  cyber attacks.
正如我们可以看到的\r\n存在,因此我想在这里再次插入新行,以呈现两个新行字符

我的控制器

<div class="blog-post">
 <p class="blog-post-title">{{ post.title }}</p>
 <p class="blog-post-meta"><i class="fa fa-clock-o">&nbsp {{ post.pub_date|date  }}</i> </p>
 <span style="white-space: pre-line">{{ post.description }}</span>

提前感谢

通过正则表达式从控制器中删除JSON中的所有/r/n::

 post.description.replace(/(?:\\[rn]|[\r\n]+)+/g, "")

post.description.replace(/\n/g,'\n\n')
@azium..我应该在哪里添加它?或者在您的视图
{{post.description | extraNewLine}}
中创建一个过滤器并将其导入管道。
 post.description.replace(/(?:\\[rn]|[\r\n]+)+/g, "")