summaryrefslogtreecommitdiff
path: root/packages/markdown/remark/src
diff options
context:
space:
mode:
authorGravatar FredKSchott <FredKSchott@users.noreply.github.com> 2022-07-19 05:23:28 +0000
committerGravatar fredkbot <fred+astrobot@astro.build> 2022-07-19 05:23:28 +0000
commit91e4ba03da51d018a597399ca861c52ed315b818 (patch)
tree978eb87bafdb282345260bd90ec8201b5416f987 /packages/markdown/remark/src
parentba11b33996d79c32da947986edb0f32dbcc04aaf (diff)
downloadastro-91e4ba03da51d018a597399ca861c52ed315b818.tar.gz
astro-91e4ba03da51d018a597399ca861c52ed315b818.tar.zst
astro-91e4ba03da51d018a597399ca861c52ed315b818.zip
Diffstat (limited to 'packages/markdown/remark/src')
-rw-r--r--packages/markdown/remark/src/rehype-collect-headers.ts10
1 files changed, 5 insertions, 5 deletions
diff --git a/packages/markdown/remark/src/rehype-collect-headers.ts b/packages/markdown/remark/src/rehype-collect-headers.ts
index 9b9a43730..50a9c5da1 100644
--- a/packages/markdown/remark/src/rehype-collect-headers.ts
+++ b/packages/markdown/remark/src/rehype-collect-headers.ts
@@ -53,11 +53,11 @@ export default function createCollectHeaders() {
node as any
).value = `<${node.tagName} id={${node.properties.id}}>${raw}</${node.tagName}>`;
} else {
- let slug = slugger.slug(text);
-
- if (slug.endsWith('-')) slug = slug.slice(0, -1);
-
- node.properties.id = slug;
+ let slug = slugger.slug(text);
+
+ if (slug.endsWith('-')) slug = slug.slice(0, -1);
+
+ node.properties.id = slug;
}
}