Skip to content

Use of rehypePlugins in react-markdown #1278

Answered by wooorm
PuneetPunamiya asked this question in Q&A
Discussion options

You must be logged in to vote

a) it explains whether you need it
b) c) if you look at the 2 code examples, you see that the list of plugins is an array, and to pass a plugin with options, you also put it in an array: rehypePlugins={[pluginWithoutOptions, [pluginWithOptions, theOptions], anotherPluginWithoutOptions]}. So: rehypePlugins={[[rehypeExternalLinks, {target: '_blank'}]]}.

Replies: 4 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@wooorm
Comment options

Comment options

You must be logged in to vote
1 reply
@wooorm
Comment options

Answer selected by PuneetPunamiya
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants