From 91f1025c9a58690cffc124ee2e72221f49825255 Mon Sep 17 00:00:00 2001 From: Pascal Fischer Date: Wed, 10 May 2023 02:02:11 +0200 Subject: [PATCH] add tag --- src/pages/_app.jsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pages/_app.jsx b/src/pages/_app.jsx index 2cf0edd2..8d92d512 100644 --- a/src/pages/_app.jsx +++ b/src/pages/_app.jsx @@ -48,6 +48,7 @@ function collectHeadings(sections, slugify = slugifyWithCounter()) { if (section.tagName === 'h2' || section.tagName === 'h3') { let title = section.title let id = section.id + let tag = section.tag if (section.tagName === 'h3') { if (!output[output.length - 1]) { throw new Error( @@ -57,9 +58,10 @@ function collectHeadings(sections, slugify = slugifyWithCounter()) { output[output.length - 1].children.push({ id, title, + tag, }) } else { - output.push({ id, title, children: [] }) + output.push({ id, title, tag, children: [] }) } }