View as Markdown

API reference: @salmonui/rich-text

htmlToTextfunction

import { htmlToText } from '@salmonui/rich-text';
function htmlToText(html: string, options?: HtmlToTextOptions): string;

Text content of HTML as the editors count it: the sanitized content, block boundaries become blockSeparator, <br> a newline, table cells are separated by tabs, whitespace outside <pre> collapses as it renders. Mentions and labels count as their visible text (@Alice).