summaryrefslogtreecommitdiff
path: root/packages/markdown/remark/src/index.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/markdown/remark/src/index.ts')
-rw-r--r--packages/markdown/remark/src/index.ts9
1 files changed, 4 insertions, 5 deletions
diff --git a/packages/markdown/remark/src/index.ts b/packages/markdown/remark/src/index.ts
index 917976d5e..a11419474 100644
--- a/packages/markdown/remark/src/index.ts
+++ b/packages/markdown/remark/src/index.ts
@@ -99,14 +99,13 @@ export async function renderMarkdown(
parser
.use(isMDX ? [rehypeJsx, rehypeExpressions] : [rehypeRaw])
.use(rehypeEscape)
- .use(rehypeIslands);
+ .use(rehypeIslands)
+ .use([rehypeCollectHeaders])
+ .use(rehypeStringify, { allowDangerousHtml: true })
let result: string;
try {
- const vfile = await parser
- .use([rehypeCollectHeaders])
- .use(rehypeStringify, { allowDangerousHtml: true })
- .process(input);
+ const vfile = await parser.process(input);
result = vfile.toString();
} catch (err) {
// Ensure that the error message contains the input filename