Dev.to
5/12/2026

My AI agent saved the first paragraph and the last. It dropped 41 in between.
Short summary
An AI agent lost 94% of content when cross-posting to Hashnode because ProseMirror's input rules silently rejected lines starting with markdown-shortcut characters. The author debugged through four incorrect hypotheses before discovering the root cause and implementing a verify-after-fill pattern with insertHTML fallback to bypass the input rules.
- •Browser automation can silently fail in rich-text editors without raising errors
- •ProseMirror input rules reject character-by-char inserts but accept bulk HTML pastes
- •Always verify editor state after fill operations and use insertHTML as a fallback
Generated with AI, which can make mistakes.
Is this a good recommendation for you?



