# plainTextToHtml (@salmonui/rich-text)

> The plainTextToHtml function of @salmonui/rich-text: HTML for plain text (plain-text paste): paragraphs on blank lines, &lt;br> on single newlines, runs of spaces kept as no-break spaces, all text escaped. Empty input gives ''.

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

```ts
import { plainTextToHtml } 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 plainTextToHtml(text: string): string;
```

HTML for plain text (plain-text paste): paragraphs on blank lines,
`<br>` on single newlines, runs of spaces kept as no-break spaces, all text
escaped. Empty input gives `''`.
