aboutsummaryrefslogtreecommitdiffstats
path: root/src/utils
diff options
context:
space:
mode:
authorArmand Philippot <git@armandphilippot.com>2023-11-20 11:06:01 +0100
committerArmand Philippot <git@armandphilippot.com>2023-11-20 19:20:21 +0100
commit9a481f066e1427d53a06cf7aeec525a745abf03f (patch)
tree790504f3baaea8af191f50e1e396f46cc03d8936 /src/utils
parentd5ade2359539648845a5854ed353b29367961d74 (diff)
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.
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/helpers/rehype.ts2
1 files changed, 0 insertions, 2 deletions
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<string> => {
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();