From 9a481f066e1427d53a06cf7aeec525a745abf03f Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Mon, 20 Nov 2023 11:06:01 +0100 Subject: fix: remove rehype-sanitize to avoid broken layouts The `rehype-sanitize` plugin was removing some tags inside the post contents coming from WordPress so the layout was broken. This plugin is useful to avoid DOM clobbering but I trust rehype-slug and myself so it is safe to remove it. --- src/utils/helpers/rehype.ts | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/utils') diff --git a/src/utils/helpers/rehype.ts b/src/utils/helpers/rehype.ts index 2716c62..fc51da1 100644 --- a/src/utils/helpers/rehype.ts +++ b/src/utils/helpers/rehype.ts @@ -9,14 +9,12 @@ export const updateContentTree = async (content: string): Promise => { const { unified } = await import('unified'); const rehypeParse = (await import('rehype-parse')).default; - const rehypeSanitize = (await import('rehype-sanitize')).default; const rehypeSlug = (await import('rehype-slug')).default; const rehypeStringify = (await import('rehype-stringify')).default; return unified() .use(rehypeParse, { fragment: true }) .use(rehypeSlug) - .use(() => rehypeSanitize({ clobberPrefix: 'h-' })) .use(rehypeStringify) .processSync(content) .toString(); -- cgit v1.2.3