Skip to content

Commit

Permalink
fix(nextra/server): Prevent overwriting of transformer (#3565)
Browse files Browse the repository at this point in the history
* fix(next/server): overwritten transformers

* Create thirty-seahorses-bathe.md

---------

Co-authored-by: Dimitri POSTOLOV <dmytropostolov@gmail.com>
  • Loading branch information
Zih0 and dimaMachina authored Oct 27, 2024
1 parent 615888c commit 9c78588
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/thirty-seahorses-bathe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"nextra": patch
---

fix(loader): Prevent overwriting of `rehypePrettyCodeOptions.transformer`
7 changes: 4 additions & 3 deletions packages/nextra/src/server/loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,13 +160,14 @@ ${themeConfigImport && '__nextra_internal__.themeConfig = __themeConfig'}`
outputFormat: 'program',
format: 'detect',
rehypePrettyCodeOptions: {
...mdxOptions?.rehypePrettyCodeOptions,
transformers: [
transformerTwoslash({
renderer: twoslashRenderer(),
explicitTrigger: true
})
],
...mdxOptions?.rehypePrettyCodeOptions
}),
...(mdxOptions?.rehypePrettyCodeOptions?.transformers || [])
]
}
},
readingTime: _readingTime,
Expand Down

0 comments on commit 9c78588

Please sign in to comment.