# htmlToText (@salmonui/rich-text)

> The htmlToText function of @salmonui/rich-text: Text content of HTML as the editors count it: the sanitized content, block boundaries become blockSeparator, &lt;br> a newline, table cells are separated by tabs, whitespace outside &lt;pre> collapses as it renders. Mentions and labels count as their visible text (@Alice).

Canonical: https://salmonui.dev/docs/reference/rich-text/htmlToText

```ts
import { htmlToText } from '@salmonui/rich-text';
```

Entry index: https://salmonui.dev/docs/reference/rich-text (Markdown with every symbol of the entry: https://salmonui.dev/docs/reference/rich-text.md).

## Reference

Kind: function

```ts
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`).
