Keep large bracket-heavy pastes from stalling the server
A pasted run of `]` made the server's validation re-parse quadratic in micromark, and the canonical serializer was quadratic in the number of escaped characters. A 128 KB paste of "[a]" held the event loop for over five minutes, so the storage writer lease expired and the server shut down. Escape every closing bracket in prose and patch the serializer's escape bookkeeping so both stay linear. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Parent6caaa51
6 files changed+108-2
StackedSplit