docs/plans/2026-04-10-autoformat-input-rules-first-slice.md
Create a shared input-rules runtime in @platejs/autoformat that can own both:
insertText-driven autoformat dispatchwithout lying that math is just another plain autoformat rule.
AutoformatPlugin currently owns a text-only rule loop in
AutoformatPlugin.ts.insertText and insertBreak, which
makes it a bad fit for plain text-only autoformat rules but a good fit for a
shared autoformat-owned input-rule lane.AutoformatPlugin rule union pretending Enter promotion is text
autoformat.@platejs/autoformat.AutoformatPlugin to use the shared insertText input-rule
runner.AutoformatPlugin through
autoformat-owned insertTextRules and insertBreakRules.AutoformatPlugin still owns plain block/mark/text autoformat.@platejs/autoformat owns the reusable input-rule runtime and the math
delimiter input rules.AutoformatPlugin + autoformatMathInputinsertText / insertBreak input rules through the shared runtime.@platejs/autoformat infrastructure without pretending math is plain
autoformat.pnpm --filter @platejs/autoformat test -- inputRules.spec.ts AutoformatPlugin.spec.tsxpnpm --filter @platejs/autoformat test -- autoformatMathInput.spec.tsxbun test packages/autoformat/src/lib/rules/math/autoformatMathInput.spec.tsx apps/www/src/__tests__/package-integration/math/math-trigger.slow.tsxpnpm installpnpm brlpnpm buildpnpm turbo typecheck --filter=./packages/autoformat --filter=./packages/math --filter=./packages/code-block --filter=./apps/wwwpnpm lint:fixhttp://127.0.0.1:3200/blocks/playground:
typing a unique ZZZMathStart $x$ sequence converted to an inline equation
node, removed the literal dollar-delimited text, and left KaTeX-backed inline
math markup in the editor DOM