Implementation:0xranx OpenContext ListCompatNormalize
| Knowledge Sources | |
|---|---|
| Domains | Editor, Normalization, React |
| Last Updated | 2026-10-24 00:00 GMT |
Overview
⚠ DEPRECATED: Plate editor normalizer that handles compatibility edge cases between list-classic lists and code blocks, including moving code blocks out of lists, splitting lists, ordered list continuation, and trailing paragraph insertion. Only used by the dead PlateMarkdown component. See Heuristic:0xranx_OpenContext_Warning_Deprecated_Plate_Editor.
Description
The listCompatNormalize.js module in src/ui/src/editor/normalize/ exports installListCompatNormalize, which patches editor.normalizeNode with four normalization rules: (1) code blocks inside list containers are moved out or the list is split at the code block position; (2) code blocks inside list item content are moved to sibling positions; (3) ordered lists split by code blocks get continuation numbering; (4) trailing paragraphs are appended after code blocks, lists, or tables at document end. The installation is idempotent.
Usage
Call installListCompatNormalize(editor) in a useEffect after creating the Plate editor, then run Editor.normalize(editor, { force: true }).
Code Reference
Source Location
- Repository: 0xranx_OpenContext
- File: src/ui/src/editor/normalize/listCompatNormalize.js
- Lines: 1-277
Signature
export function installListCompatNormalize(editor) // → editor (for chaining)
Import
import { installListCompatNormalize } from './editor/normalize/listCompatNormalize';
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| editor | PlateEditor | Yes | Plate editor instance |
Outputs
| Name | Type | Description |
|---|---|---|
| editor | PlateEditor | The same editor with patched normalizeNode |
Usage Examples
Installing the Normalizer
import { installListCompatNormalize } from './editor/normalize/listCompatNormalize';
import { Editor } from 'slate';
useEffect(() => {
installListCompatNormalize(editor);
Editor.normalize(editor, { force: true });
}, [editor]);