aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/waev_web/templates/exports/show.html.eex2
-rw-r--r--lib/waev_web/views/exports_view.ex5
2 files changed, 6 insertions, 1 deletions
diff --git a/lib/waev_web/templates/exports/show.html.eex b/lib/waev_web/templates/exports/show.html.eex
index 15a1360..052ced8 100644
--- a/lib/waev_web/templates/exports/show.html.eex
+++ b/lib/waev_web/templates/exports/show.html.eex
@@ -26,7 +26,7 @@
<% _ -> %>
<% end %>
- <div><%= highlight_urls(message.text) %></div>
+ <div><%= message.text |> highlight_urls() |> nl_to_br() %></div>
<div class="message-date">
<%= message.date %>
</div>
diff --git a/lib/waev_web/views/exports_view.ex b/lib/waev_web/views/exports_view.ex
index f0cfa0d..d4b8a11 100644
--- a/lib/waev_web/views/exports_view.ex
+++ b/lib/waev_web/views/exports_view.ex
@@ -39,6 +39,11 @@ defmodule WaevWeb.ExportsView do
end)
end
+ def nl_to_br(text) do
+ String.replace(text, "\n", "<br />")
+ |> raw()
+ end
+
def pagination_bar(assigns, page, size) do
prev = if page == 0, do: 0, else: page - 1
# TODO max