Configuration
This page will tell you which configuration options are available for the rehype plugin and marked extension.
Properties
Section titled “Properties”editorsOnly
Section titled “editorsOnly”When true, code blocks without the editor
property are ignored, but you can still create code blocks by adding the editor=false
meta property. This is useful if you’re using another plugin to highlight code blocks.
defaultEditorProps
Section titled “defaultEditorProps”Default properties for fenced code blocks with the editor
meta property. Useful to avoid repeating the same meta properties on every code block.
defaultCodeBlockProps
Section titled “defaultCodeBlockProps”Default properties for fenced code blocks without the editor
meta property, or with editor=false
. Useful to avoid repeating the same meta properties on every code block.
customRenderer
Section titled “customRenderer”Method that allows you to wrap the default render function or completely override it. This method gets called with the following arguments:
props: CodeBlockProps
: Props used to render the editor or code block.defaultRenderer: (props: CodeBlockProps) => string
: The default render function.isEditor: boolean
: Whether or not an editor is being rendered.
The features page shows an example.
inline
Section titled “inline”Options for highlighting inline code between backticks. If this option is omitted, inline highlighting will be disabled. The features page explains this feature in more detail.
silenceWarnings
Section titled “silenceWarnings”These plugins will warn you when a code block has a language without a registered grammar. Set this option to true
to disable the warnings.