Repair plugins
Repair plugins post-process the Markdown AST before it becomes HAST. They can repair incomplete syntax, tidy node boundaries, or add temporary presentation without changing the source string.
Declare a plugin
Add a small indicator after the content while a response is arriving, then remove it when the response finishes:
After the built-in repairs, this plugin appends an HTML node with the indicator class to the current trailing block. stop() ends the traversal so it is inserted just once.
Connect to Core
Add repairs to the Core inputs from the quick start, and enable build.repair and build.repairEnding.
ending: true limits the plugin to the last block while it is still being generated. Set repairEnding to false when the response finishes to remove the indicator. The original Markdown stays unchanged.
The built-in HTML processing already allows the class attribute on span. With an HTML renderer, a little CSS gives the indicator its shape:
Put traversal settings in
configand keep constructor options in a separate field. Core runs the plugin and manages its lifecycle.
Built-in plugins
Core includes these plugins by default; no registration is needed.
PRESET_REPAIR_PLUGINS, exported from @fluxdown/core-presets/repair.
build.repair controls repairs. The first group below handles temporary states at the end of a stream and also requires build.repairEnding.
The streaming tail
Formatting boundaries
These plugins run when build.repair is enabled and do not require repairEnding.
Repairs affect the current presentation, not the original Markdown stored by your app.