R
fn

toggleBlockType

tested

Toggle the focused block between `type` (with `attrs`) and a fallback type (default `paragraph`). Powers heading shortcuts and conversion toggles.

Signature

ts
export function toggleBlockType(type: string, attrs?: Attrs, fallback = 'paragraph'): Command{ ... }

Parameters

ParameterTypeDescription
typestring
attrs?Readonly<Record<string, import("..").AttrValue>> | undefined
fallback?string

Returns

Command