View as Markdown

API reference: @salmonui/rich-text

insertBlocksfunction

import { insertBlocks } from '@salmonui/rich-text';
function insertBlocks(blocks: readonly Block[], inserted: readonly Block[], position?: BlockPosition): Block[];

Inserts blocks before or after the block before / after, or into parent's children at index (default: last). Without a position they go at the end. Returns the input unchanged when the anchor does not exist.