# forEachBlock (@salmonui/rich-text)

> The forEachBlock function of @salmonui/rich-text: Calls fn on every block in document order.

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

```ts
import { forEachBlock } 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 forEachBlock(blocks: readonly Block[], fn: (block: Block, parent: Block | null, index: number) => void, parent?: Block | null): void;
```

Calls `fn` on every block in document order.
