feat(pastes): add support for markdown

Signed-off-by: SphericalKat <amolele@gmail.com>
This commit is contained in:
sphericalkat committed 2021-10-07 06:18:10 +05:30
1 parent 1d0b8cc4d5
commit dd089f13f9
5 files changed
+195 -21

No files matched your search

+5 -1
View File
@@ -8,5 +8,9 @@
</a>
<% end %>
</div>
<code class="break-word px-6 py-4 h-full w-full nomarkdown overflow-y-auto"><%= raw Ketbin.Utils.Syntax.highlight_text(@paste.content, @extension) |> HtmlSanitizeEx.html5 %></code>
<%= if @extension == "md" do%>
<div class="break-word px-6 py-4 h-full w-full markdown overflow-y-auto"><%= raw Earmark.as_html!(@paste.content, escape: false, gfm_tables: true) %></div>
<% else %>
<code class="break-word px-6 py-4 h-full w-full overflow-y-auto"><%= raw Ketbin.Utils.Syntax.highlight_text(@paste.content, @extension) |> HtmlSanitizeEx.html5 %></code>
<% end %>
</div>