Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Implementation:0xranx OpenContext ListCompatNormalize

From Leeroopedia
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

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]);

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment