forked from farhoodlabs/paperclip
735bea5dee1aa6fa04b84bc3144fcf93930f2e33
The old approach used document.execCommand("insertText") to directly
manipulate the contentEditable DOM, but MDXEditor (Lexical) reverted
these changes during reconciliation causing the "blink" bug.
Fix: work at the markdown string level instead — find the @query in
the markdown, replace it with @Name, and update via setMarkdown().
Also add an input event listener alongside selectionchange for more
reliable mention detection (fixes space-to-dismiss).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Description
Languages
TypeScript
97.9%
JavaScript
1.1%
Shell
0.7%
CSS
0.2%