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 Markdown Rules

From Leeroopedia
Knowledge Sources
Domains Editor, Markdown_Serialization
Last Updated 2026-10-24 00:00 GMT

Overview

⚠ DEPRECATED: Plate markdown serialization and deserialization rules plugin, converting between Slate node trees and markdown strings. Only used by the dead PlateMarkdown component. See Heuristic:0xranx_OpenContext_Warning_Deprecated_Plate_Editor.

Description

The markdownRules.js module in src/ui/src/editor/plugins/ exports a createMarkdownPlugin factory that creates a Plate plugin for markdown serialization/deserialization. It defines rules for converting Slate nodes (headings, paragraphs, lists, code blocks, tables, links, blockquotes, etc.) to markdown and back, handling the full Plate node type system including list-classic variants.

Usage

Import and register this plugin in PlateMarkdown.jsx to enable markdown import/export.

Code Reference

Source Location

Signature

export function createMarkdownPlugin() // → Plate plugin config
// Also exports serializeMarkdown and deserializeMarkdown functions

Import

import { createMarkdownPlugin } from './editor/plugins/markdownRules';

I/O Contract

Inputs

Name Type Required Description
editor PlateEditor Yes (serialize) Editor for context
fragment Node[] Yes (serialize) Slate nodes to convert
markdown string Yes (deserialize) Markdown text to parse

Outputs

Name Type Description
serializeMarkdown string Markdown string from nodes
deserializeMarkdown Node[] Slate nodes from markdown

Usage Examples

Creating and Using the Plugin

import { createMarkdownPlugin } from './editor/plugins/markdownRules';

const markdownPlugin = createMarkdownPlugin();

// Register with Plate
const editor = createPlateEditor({
  plugins: [markdownPlugin, ...otherPlugins]
});

// Serialize selection to markdown
const md = serializeMarkdown(editor, fragment);

// Deserialize pasted markdown to nodes
const nodes = deserializeMarkdown(editor, pastedText);

Related Pages

Page Connections

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