aboutsummaryrefslogtreecommitdiff
path: root/packages/integrations/markdoc/src/nodes/heading.ts
diff options
context:
space:
mode:
authorGravatar Ben Holmes <hey@bholmes.dev> 2023-05-23 12:16:50 -0400
committerGravatar GitHub <noreply@github.com> 2023-05-23 12:16:50 -0400
commit57e65d247f67de61bcc3a585c2254feb61ed2e74 (patch)
treec3919841a2814969e34c108239c2a55634256613 /packages/integrations/markdoc/src/nodes/heading.ts
parentcbdb0fdbd6dd2d19237eccab40d9253f0909bf35 (diff)
downloadastro-57e65d247f67de61bcc3a585c2254feb61ed2e74.tar.gz
astro-57e65d247f67de61bcc3a585c2254feb61ed2e74.tar.zst
astro-57e65d247f67de61bcc3a585c2254feb61ed2e74.zip
revert: markdoc asset bleed (#7178)
* revert: markdoc asset bleed * chore: changeset
Diffstat (limited to 'packages/integrations/markdoc/src/nodes/heading.ts')
-rw-r--r--packages/integrations/markdoc/src/nodes/heading.ts7
1 files changed, 3 insertions, 4 deletions
diff --git a/packages/integrations/markdoc/src/nodes/heading.ts b/packages/integrations/markdoc/src/nodes/heading.ts
index cb50dd231..0210e9b90 100644
--- a/packages/integrations/markdoc/src/nodes/heading.ts
+++ b/packages/integrations/markdoc/src/nodes/heading.ts
@@ -37,14 +37,13 @@ export const heading: Schema = {
const slug = getSlug(attributes, children, config.ctx.headingSlugger);
const render = config.nodes?.heading?.render ?? `h${level}`;
-
const tagProps =
// For components, pass down `level` as a prop,
// alongside `__collectHeading` for our `headings` collector.
// Avoid accidentally rendering `level` as an HTML attribute otherwise!
- typeof render === 'string'
- ? { ...attributes, id: slug }
- : { ...attributes, id: slug, __collectHeading: true, level };
+ typeof render === 'function'
+ ? { ...attributes, id: slug, __collectHeading: true, level }
+ : { ...attributes, id: slug };
return new Markdoc.Tag(render, tagProps, children);
},