Inline edits broken for MDX files

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

Any and I mean ANY inline code changes in mdx files always results in deleting the selected content.
Cursor cannot edit mdx files it looks like. No matter what you tell the AI to change it to it will always delete the selected content.

Steps to Reproduce

  • create a new mdx file with .mdx extension.
  • add some basic markdown content
  • open the inline editor ctrl + k.
  • select some content
  • ask inline chat to make a change
  • cursor removes the selected content

Expected Behavior

Edit the file like any other file

Operating System

Windows 10/11

Version Information

Version: 2.5.25 (user setup)
VSCode Version: 1.105.1
Commit: 7150844152b426ed50d2b68dd6b33b5c5beb73c0
Date: 2026-02-24T07:17:49.417Z
Build Type: Stable
Release Track: Default
Electron: 39.4.0
Chromium: 142.0.7444.265
Node.js: 22.22.0
V8: 14.2.231.22-electron.0
OS: Windows_NT x64 10.0.26200

For AI issues: which model did you use?

gemini-2.0-flash, claude haiku 4.5

Does this stop you from using Cursor

No - Cursor works, but with this issue

Hey, thanks for the report. I tried to reproduce it on my side, and inline edit in MDX files works fine.

Could you clarify:

  1. Is this only happening in .mdx files, or in other file types too (.md, .tsx, .js)?
  2. Share a minimal MDX example where it breaks consistently.
  3. Please try with extensions disabled. Run cursor --disable-extensions and check if it still happens.

Let me know how it goes.

It depends on the content of the file, an empty one works fine. But certain syntax breaks it.

For example here is my mdx file:

test.mdx.txt (1007 Bytes)

Possibly problems with the markdown syntax as alot of ai models output in markdown for the most part with the ```