diff options
author | href <href@random.sh> | 2021-09-01 10:30:18 +0200 |
---|---|---|
committer | href <href@random.sh> | 2021-09-01 10:30:18 +0200 |
commit | 75687711f35355bc30e4829439384aab28fcac6d (patch) | |
tree | 8f3256f472893c39720a684d390e890a152f7303 /lib/lsg_web/controllers/irc_controller.ex | |
parent | link: post_* callbacks; html & pdftitle. (diff) |
Commit all the changes that hasn't been committed + updates.
Diffstat (limited to 'lib/lsg_web/controllers/irc_controller.ex')
-rw-r--r-- | lib/lsg_web/controllers/irc_controller.ex | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/lsg_web/controllers/irc_controller.ex b/lib/lsg_web/controllers/irc_controller.ex index e0bf24d..317bb27 100644 --- a/lib/lsg_web/controllers/irc_controller.ex +++ b/lib/lsg_web/controllers/irc_controller.ex @@ -52,11 +52,16 @@ defmodule LSGWeb.IrcController do conn.assigns[:chan] -> "/#{conn.assigns.network}/#{LSGWeb.format_chan(conn.assigns.chan)}" true -> "/-" end - if Map.has_key?(data, txt) do + if lines = Map.get(data, txt) do + lines = Enum.map(lines, fn(line) -> + line + |> String.split("\\\\") + |> Enum.intersperse(Phoenix.HTML.Tag.tag(:br)) + end) conn |> assign(:breadcrumbs, [{"txt", "#{base_url}/txt"}]) |> assign(:title, "#{txt}.txt") - |> render("txt.html", name: txt, data: data[txt], doc: nil) + |> render("txt.html", name: txt, data: lines, doc: nil) else conn |> put_status(404) |