@mocanvas/mocanvas · function

richTextToText

declare function richTextToText(source: RichTextSource): string

The plain string a label reads as, whatever it was given.

Marks and unknown wrappers are flattened away; hardBreak becomes a newline and top-level blocks are joined by newlines. Delegates to the editor's richTextToPlainText so the load path and the render path agree character for character.

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.