mirror of
https://github.com/zulip/zulip.git
synced 2025-11-07 15:33:30 +00:00
Turn newlines into linebreaks.
(imported from commit 67999641a8cff471be1430e421f259b1c558444d)
This commit is contained in:
@@ -26,7 +26,7 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<span onclick="prepare_personal('{{ zephyr.sender.user.username }}')" class="label zephyr_sender">{{ zephyr.sender.user.username }}</span><br />
|
<span onclick="prepare_personal('{{ zephyr.sender.user.username }}')" class="label zephyr_sender">{{ zephyr.sender.user.username }}</span><br />
|
||||||
{{ zephyr.content }}
|
{{ zephyr.content|linebreaksbr }}
|
||||||
</p></td>
|
</p></td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|||||||
@@ -183,6 +183,10 @@ $(function() {
|
|||||||
setInterval(get_updates, 1000);
|
setInterval(get_updates, 1000);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function newline2br(content) {
|
||||||
|
return content.replace(/\n/g, '<br />');
|
||||||
|
}
|
||||||
|
|
||||||
function add_message(index, zephyr) {
|
function add_message(index, zephyr) {
|
||||||
var new_str = "<tr id=" + zephyr.id + ">" +
|
var new_str = "<tr id=" + zephyr.id + ">" +
|
||||||
"<td class='pointer'><p></p></td>" +
|
"<td class='pointer'><p></p></td>" +
|
||||||
@@ -200,7 +204,7 @@ function add_message(index, zephyr) {
|
|||||||
}
|
}
|
||||||
new_str += "<span onclick=\"prepare_personal('" + zephyr.sender + "')\" class='label zephyr_sender'>"
|
new_str += "<span onclick=\"prepare_personal('" + zephyr.sender + "')\" class='label zephyr_sender'>"
|
||||||
+ zephyr.sender + "</span><br />"
|
+ zephyr.sender + "</span><br />"
|
||||||
+ zephyr.content +
|
+ newline2br(zephyr.content) +
|
||||||
"</p></td>" +
|
"</p></td>" +
|
||||||
"</tr>";
|
"</tr>";
|
||||||
$("#table tr:last").after(new_str);
|
$("#table tr:last").after(new_str);
|
||||||
|
|||||||
Reference in New Issue
Block a user