preserve line breaks

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
This commit is contained in:
Arthur Schiwon 2017-10-30 11:10:04 +01:00
parent 76c803f0af
commit 61db8615f4
No known key found for this signature in database
GPG Key ID: 7424F1874854DF23
1 changed files with 10 additions and 0 deletions

View File

@ -587,6 +587,16 @@
$inserted.html('@' + $this.find('.avatar').data('username'));
});
var oldHtml;
var html = $comment.html();
do {
// replace works one by one
oldHtml = html;
html = oldHtml.replace("<br>", "\n"); // preserve line breaks
console.warn(html)
} while(oldHtml !== html);
$comment.html(html);
return $comment.text();
},