From ae8cee8ccf251f9c61cd8217563f261d20fe9fd1 Mon Sep 17 00:00:00 2001 From: SphericalKat Date: Thu, 7 Oct 2021 09:06:08 +0530 Subject: [PATCH] fix(build): don't purge used styles Signed-off-by: SphericalKat --- assets/build.js | 2 +- assets/tailwind.config.js | 1 + lib/ketbin_web/templates/page/show.html.heex | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/assets/build.js b/assets/build.js index de3a66b..f4d56d7 100644 --- a/assets/build.js +++ b/assets/build.js @@ -13,7 +13,7 @@ fs.copySync("static/", "../priv/static/"); console.log("[build.js] [info] Copying static files from static/"); if (!productionBuild) { - console.log("[build.js] [info] Starting to watching assets for changes"); + console.log("[build.js] [info] Starting to watch assets for changes"); } else { console.log("[build.js] [info] Building assets in production mode"); } diff --git a/assets/tailwind.config.js b/assets/tailwind.config.js index cb0e1dd..871c9fa 100644 --- a/assets/tailwind.config.js +++ b/assets/tailwind.config.js @@ -3,6 +3,7 @@ module.exports = { "../lib/**/*.ex", "../lib/**/*.leex", "../lib/**/*.eex", + "../lib/**/*.heex", "./js/**/*.js", ], darkMode: false, // or 'media' or 'class' diff --git a/lib/ketbin_web/templates/page/show.html.heex b/lib/ketbin_web/templates/page/show.html.heex index 6030f30..2022e51 100644 --- a/lib/ketbin_web/templates/page/show.html.heex +++ b/lib/ketbin_web/templates/page/show.html.heex @@ -9,7 +9,7 @@ <% end %> <%= if @extension == "md" do%> -
<%= raw Earmark.as_html!(@paste.content, escape: true, gfm_tables: true) %>
+
<%= raw Earmark.as_html!(@paste.content, escape: true, gfm_tables: true) |> HtmlSanitizeEx.html5 %>
<% else %> <%= raw Ketbin.Utils.Syntax.highlight_text(@paste.content, @extension) |> HtmlSanitizeEx.html5 %> <% end %>