@mdwrk/markdown-editor-core
v1.2.1
Published
Portable source-mode markdown editor state, selection transforms, command model, and undo/redo history for MdWrk.
Maintainers
Readme
@mdwrk/markdown-editor-core
Headless markdown editing primitives
This package exposes the command, selection, transform, and history logic behind the MdWrk editing experience.
Why
Use it when you need markdown editing semantics without committing to a specific UI implementation.
What
- Built-in markdown editing commands.
- Selection and transform helpers.
- Undo and redo history state management.
Installation
Node.js 20.x through 22.x, matching the workspace engine contract in the root package manifest.
npm install @mdwrk/markdown-editor-coreUsage
import { applyBuiltinMarkdownCommand, createSelection } from "@mdwrk/markdown-editor-core";
const result = applyBuiltinMarkdownCommand(
"bold",
"hello",
createSelection(0, 5),
);Surface
- Editor commands include
ordered-list,bullet-list,task-list,move-line-up,move-line-down,move-block-up, andmove-block-down. - Command descriptors are exported through
listBuiltinMarkdownEditorCommands()with scope, category, and CM/GFM/CFM ormdwrk-operatorapplicability metadata. - Explicit keyboard navigation is exported as pure selection helpers through
computeNavigatedSelection().
Related
- Packages index - family and package navigation
- Root README - repo overview
