docs/plans/2026-04-10-autoformat-runtime-alignment-and-extension-plan.md
Executed.
Closed ownership result:
Create the real implementation plan for the newly specified autoformat lane:
@platejs/autoformat engineThis plan assumes the current editor-behavior law and research are the source of truth and that some runtime support will require extending shared infrastructure instead of piling more folklore into the app kits.
insertText triggers, first-match-wins ordering, and
text-only undo-on-delete.The law is finally honest, but the runtime still has three different shapes mixed together:
@platejs/autoformat already modelsIf we try to force all of that into the current package without drawing boundaries first, we will just re-invent a bigger pile of app-local rules.
insertText-only autoformat engine.Not all "autoformat" belongs in @platejs/autoformat.
Use this split:
@platejs/autoformat ownsinsertText-driven block shorthandenableUndoOnDelete)$$ then Enter promotionEnter behavior, if we decide
to match it instead of keeping current immediate conversionThat may live in shared input-rule infrastructure under @platejs/autoformat,
in @platejs/core key behavior, or in the owning feature package, but not in
the plain AutoformatPlugin dispatch loop itself.
Goal: stop arguing abstractly about what is "autoformat" versus what is current kit behavior.
Implementation units:
Primary files:
Why first:
Goal: move obviously shared behavior out of app folklore, but only where the shared package API can own it cleanly.
Implementation units:
@platejs/autoformat exported helpers or presets.Primary files:
Deliverable:
Goal: extend @platejs/autoformat only where the current engine shape is the
real blocker.
Likely extensions:
==query / format callbacks
Primary files:
Important constraint:
Goal: handle the cases that are not honestly single-keystroke autoformat.
Candidate surfaces:
$$ then Enter block-math promotion``` then Enter code-fence promotion if we choose Typora-style
behavior laterEnter if we choose that shape laterRecommended approach:
@platejs/autoformat package extension unless a
very small shared seam makes them trivial.@platejs/autoformatWhy:
AutoformatPlugin is built around one inserted character and local
text matchingEnter-coupled promotions are a different class of interactionGoal: sync the public /docs/autoformat story with the new law/runtime.
Implementation units:
These are the next implementation slices in order, not just loose follow-ups.
Own:
==Why first:
Own:
Target rows:
Own:
Target rows:
EDIT-PROFILE-AUTOFMT-TEXT-001EDIT-PROFILE-AUTOFMT-TEXT-002EDIT-PROFILE-AUTOFMT-TEXT-003EDIT-PROFILE-AUTOFMT-TEXT-004Own:
[text](url) out of the plain autoformat familiesTarget row:
EDIT-INTERACT-LINK-AUTOMD-001Own:
[] / [x] explicit as Plate-owned condensed todo convenience unless
product deliberately wants to narrow it laterTarget rows:
EDIT-PROFILE-AUTOFMT-BLOCK-004EDIT-PROFILE-AUTOFMT-BLOCK-005EDIT-PROFILE-AUTOFMT-BLOCK-006packages/autoformat/src/lib/AutoformatPlugin.spec.tsxpackages/autoformat/src/lib/transforms/*.spec.tspackages/autoformat/src/lib/__tests__/withAutoformat/**/*.spec.tsxAdd or extend:
apps/www/src/__tests__/package-integration/autoformat/blockquote.slow.tsxapps/www/src/__tests__/package-integration/autoformat/list.slow.tsxAdd:
/docs/autoformat and examples against actual current runtimeThe architecture doc already wants a profile-aware rewrite, but doing the whole thing now would balloon scope.
Mitigation:
The app kits already ship real behavior, even when it is quirky.
Mitigation:
This is the easiest conceptual bug.
Mitigation:
insertText-driven behavior and Enter-driven promotion in separate
workstreamsSome symbol tables are mostly local current contract right now.
Mitigation:
@platejs/autoformat if the tests show it is actually needed.If you want a consensus pass on this plan:
$ralplan --consensus --direct docs/plans/2026-04-10-autoformat-runtime-alignment-and-extension-plan.md
If you want to start execution directly:
$ralph "Execute docs/plans/2026-04-10-autoformat-runtime-alignment-and-extension-plan.md"