fn
normalizeDocument
Bring a document to canonical form against a schema: coerce attrs, normalize inline content, drop marks that are unknown or disallowed in their block, and drop blocks of unknown type. This is the single funnel every document passes through before it becomes editor state.
Signature
ts
export function normalizeDocument(doc: EditorDocument, schema: Schema): EditorDocument{ ... }Parameters
| Parameter | Type | Description |
|---|---|---|
doc | EditorDocument | — |
schema | Schema | — |
Returns
EditorDocument