У меня есть данные json, у которых есть символы линий, которые присутствуют, но когда я визуализую это на html, он добавляет новый символ строки с свойством style="white-space: pre-line"
, вместо этого я хотел добавить 2 новых символа строки
Мои данные json
[{"id":1,"title":"Israels desert city of Beersheba is turning into a cybertech oasis","description":"morphing into a tech oasis.\r\nThe militarys 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, thats the idea. For my day job at HappyFunCorp I do a lot of interviews, and almost every junior develope.\r\nI dont necessarily blame them. You can make go.","pub_date":"2016-03-20T10:50:07.965930Z"}]
Чтобы быть более понятным, описание в json выглядит так
morphing into a tech oasis.\r\nThe militarys 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, поэтому здесь я хотел снова вставить новую строку, чтобы отобразить 2 новых строковых символа
Мой контроллер
<div class="blog-post">
<p class="blog-post-title">{{ post.title }}</p>
<p class="blog-post-meta"><i class="fa fa-clock-o">  {{ post.pub_date|date }}</i> </p>
<span style="white-space: pre-line">{{ post.description }}</span>
что нужно сделать, чтобы сделать вывод с двумя новыми символами для {{ post.description }}
?
Мой ожидаемый результат будет таким
morphing into a tech oasis.
The militarys massive relocation of its prestigious technology units.
Beersheba has all of the ingredients of a vibrant security technology ecosystem,
"All in all, projections are that 20,000-30,000
The commercial sector has teamed up cyber attacks.
заранее спасибо
Удалить все /r/n в JSON из Controller с помощью regex ::
post.description.replace(/(?:\\[rn]|[\r\n]+)+/g, "")
post.description.replace(/\n/g, '\n\n')