From 5eee318b4f9b47cbfff7167cbab67a7531469dc5 Mon Sep 17 00:00:00 2001 From: Kian Newman-Hazel Date: Wed, 13 Nov 2024 17:22:45 +0000 Subject: [PATCH] [Docs Site] Fix anchor link headings --- plugins/rehype/heading-slugs.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/rehype/heading-slugs.ts b/plugins/rehype/heading-slugs.ts index 9989dd13c2689f..154d54ab9142f3 100644 --- a/plugins/rehype/heading-slugs.ts +++ b/plugins/rehype/heading-slugs.ts @@ -28,10 +28,10 @@ export default function () { const text = element.children.at(-2) as MdxTextExpression; text.value = text.value.trimEnd(); element.children.with(-2, text); - } else { - if (!element.properties.id) { - element.properties.id = slugs.slug(toString(element)); - } + } + } else { + if (!element.properties.id) { + element.properties.id = slugs.slug(toString(element)); } } }