chore: Move comment rendering to helper
This commit is contained in:
parent
aa761d4112
commit
5d97a4f1d3
2 changed files with 5 additions and 1 deletions
|
@ -1,4 +1,8 @@
|
||||||
defmodule BdfrBrowser.RenderUtils do
|
defmodule BdfrBrowser.RenderUtils do
|
||||||
|
def comment(cmt) do
|
||||||
|
Earmark.as_html!(cmt)
|
||||||
|
end
|
||||||
|
|
||||||
def message(msg) do
|
def message(msg) do
|
||||||
img_replacement = "<img src=\"/chat_media/\\1\" style=\"max-width: 500px;\" alt=\"Image\" />"
|
img_replacement = "<img src=\"/chat_media/\\1\" style=\"max-width: 500px;\" alt=\"Image\" />"
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<%= if comment.author == "AutoModerator" do %>
|
<%= if comment.author == "AutoModerator" do %>
|
||||||
<p><small>Hidden AutoModerator comment</small></p>
|
<p><small>Hidden AutoModerator comment</small></p>
|
||||||
<% else %>
|
<% else %>
|
||||||
<%= Earmark.as_html!(comment.body) %>
|
<%= BdfrBrowser.RenderUtils.comment(comment.body) %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<footer class="blockquote-footer">
|
<footer class="blockquote-footer">
|
||||||
|
|
Reference in a new issue