From 884ba7c38649be91457e095290143ba3b0e0cc87 Mon Sep 17 00:00:00 2001 From: Cosmin Popovici Date: Fri, 7 Oct 2022 19:46:53 +0300 Subject: [PATCH] fix: disabling safeClassNames transformer --- src/transformers/filters/index.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/transformers/filters/index.js b/src/transformers/filters/index.js index 91ee1b94..495ccb16 100644 --- a/src/transformers/filters/index.js +++ b/src/transformers/filters/index.js @@ -22,11 +22,16 @@ module.exports = async (html, config = {}, direct = false) => { filters.postcss = css => PostCSS.process(css, maizzleConfig) filters.tailwindcss = css => Tailwind.compile(css, html, tailwindConfig, maizzleConfig) - return posthtml([ + const posthtmlPlugins = [ styleDataEmbed(), - posthtmlContent(filters), - safeClassNames() - ]) + posthtmlContent(filters) + ] + + if (get(config, 'safeClassNames') !== false) { + posthtmlPlugins.push(safeClassNames()) + } + + return posthtml(posthtmlPlugins) .process(html, posthtmlOptions) .then(result => result.html) }