Rehype plugins
Rehype plugins post-process HAST, the HTML syntax tree produced from Markdown. Use them to change element properties or normalize HTML before rendering.
Declare a plugin
This plugin uses image descriptions as hover titles:
Add rehypes to the Core inputs from the quick start. The transform runs again when a content block is recompiled.
The default sanitizer still processes the output. Properties and tags added by a plugin must be allowed by its schema.
Allow additional HTML tags
Embedded HTML passes through both syntax filtering and HAST sanitization. Configure both stages to allow an extra tag, such as mark:
toClosure turns each configuration object into a readable Core input. Pass both remarks and rehypes to Core. These options extend the existing tag lists. Use the sanitizer's fallback schema to allow additional attributes.
Pass options with a plugin class
You can express the same configuration as [PluginClass, options]. Core passes the options to the constructor and manages the instance:
Choose keyed options to keep built-in configuration together, or class tuples to register and configure plugins in one place. Pass the class; Core creates the instance.
Built-in plugins
Core includes these plugins by default; no registration is needed.
PRESET_REHYPE_PLUGINS, exported from @fluxdown/core-presets/rehype.
These stages work together to handle HTML embedded in Markdown. See Allow additional HTML tags for an example.