diff --git a/templates/zephyr/index.html b/templates/zephyr/index.html index e13079aa61..04c81d16e6 100644 --- a/templates/zephyr/index.html +++ b/templates/zephyr/index.html @@ -26,7 +26,7 @@ {% endif %} {{ zephyr.sender.user.username }}
-{{ zephyr.content }} +{{ zephyr.content|linebreaksbr }}

{% endfor %} diff --git a/zephyr/static/js/zephyr.js b/zephyr/static/js/zephyr.js index dac8c04bc2..f29c687d6b 100644 --- a/zephyr/static/js/zephyr.js +++ b/zephyr/static/js/zephyr.js @@ -183,6 +183,10 @@ $(function() { setInterval(get_updates, 1000); }); +function newline2br(content) { + return content.replace(/\n/g, '
'); +} + function add_message(index, zephyr) { var new_str = "" + "

" + @@ -200,7 +204,7 @@ function add_message(index, zephyr) { } new_str += "" + zephyr.sender + "
" - + zephyr.content + + + newline2br(zephyr.content) + "

" + ""; $("#table tr:last").after(new_str);