Skip to content

Markdown (marked)

Render finished assistant messages as Markdown, powered by marked. This is the one-shot provider — it re-renders a whole message to HTML once it is complete (pair it with streaming-markdown for the live token stream).

Terminal window
npm install @aparte/plugin-marked @aparte/core marked

@aparte/core and marked are peer dependencies — you control the marked version.

import { setupMarkedProvider } from '@aparte/plugin-marked';
setupMarkedProvider();

Call it once at startup. It registers a function on AparteConfig.setMarkdownProvider that parses raw Markdown to sanitised HTML. Pass a MarkedExtension to customise the parser:

setupMarkedProvider({ gfm: true, breaks: true });

Core sanitises the returned HTML before inserting it, so the provider only has to produce markup.