diff --git a/src/transformers/filters/index.js b/src/transformers/filters/index.js index 83e7e94b..5efcb127 100644 --- a/src/transformers/filters/index.js +++ b/src/transformers/filters/index.js @@ -29,7 +29,12 @@ module.exports = async (html, config = {}, direct = false) => { ] if (get(config, 'safeClassNames') !== false) { - posthtmlPlugins.push(safeClassNames()) + posthtmlPlugins.push(safeClassNames({ + replacements: { + '{': '{', + '}': '}' + } + })) } return posthtml(posthtmlPlugins) diff --git a/src/transformers/safeClassNames.js b/src/transformers/safeClassNames.js index 7987d69a..13b1bbe8 100644 --- a/src/transformers/safeClassNames.js +++ b/src/transformers/safeClassNames.js @@ -19,7 +19,10 @@ module.exports = async (html, config = {}, direct = false) => { } const posthtmlOptions = merge(defaultConfig, get(config, 'build.posthtml.options', {})) - const replacements = direct ? config : get(config, 'safeClassNames', {}) + const replacements = direct ? config : get(config, 'safeClassNames', { + '{': '{', + '}': '}' + }) return posthtml([safeClassNames({replacements})]).process(html, posthtmlOptions).then(result => result.html) }