@mocanvas/mocanvas · function

renderHtmlFromRichTextWithExtensions

declare function renderHtmlFromRichTextWithExtensions(richText: RichTextSource, extensions: readonly RichTextExtension[]): string

Render a rich-text value to HTML with an **explicit** extension list.

The sibling of renderHtmlFromRichTextForMeasurement for callers that have no editor to read the extensions off: a server rendering a board's text into a page, a search indexer, a test. Because the extension list is the argument rather than something looked up, the same document renders the same way outside the editor as inside it — which is the point of exporting it.

Pass tipTapDefaultExtensions for the set mocanvas itself uses.

mocanvas is built by Symbio. Free for non-commercial, non-profit and development use; commercial use needs an agreement. Not affiliated with or endorsed by tldraw.