Markdown preview button missing for files in gitignored directories

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

When a markdown file is located inside a gitignored directory, Cursor no longer shows the preview button for that file. The preview button disappears entirely for any markdown file that is gitignored.

Steps to Reproduce

  1. Create a directory and add it to .gitignore
  2. Place one or more markdown (.md) files inside that gitignored directory
  3. Open any of those markdown files in Cursor
  4. Observe that the preview button is missing from the editor toolbar

Expected Behavior

The markdown preview button should appear regardless of whether the file is inside a gitignored directory or not. Gitignore status is a version control concern and should not affect editor features like markdown preview.

Operating System

MacOS

Version Information

Version: 3.8.11 (Universal)
VS Code Extension API: 1.105.1
Commit: e56ad3440df06d22ca7501e65fd518e905486ef0
Date: 2026-06-18T01:40:18.333Z
Layout: editor
Build Type: Stable
Release Track: Default
Electron: 40.10.3
Chromium: 144.0.7559.236
Node.js: 24.15.0
V8: 14.4.258.32-electron.0
xterm.js: 6.1.0-beta.256
OS: Darwin arm64 25.3.0

Additional Information

The root cause appears to be that Cursor ties the availability of the markdown preview button to git tracking status. In this case, the output directory for generated markdown documentation files is gitignored intentionally, which causes all markdown files within it to lose the preview button. A simple workaround is not available since the directory must remain gitignored.

Does this stop you from using Cursor

No - Cursor works, but with this issue

Hey, thanks for the report. Quick clarification: the Preview button is not tied to git tracking or gitignore. There’s no link like that in the code.

What’s actually happening: Cursor has its own WYSIWYG Markdown editor (toggle Preview/Markdown in the tab), and it’s intentionally disabled for .md files whose path includes .cursor, .claude, or .codex. This is to avoid reformatting config or rules files in those folders, where the raw syntax matters (headings, frontmatter, indentation).

Most likely, your gitignored folder with generated docs sits under a path that includes one of those segments. That’s why it looks like it matches gitignore. To confirm:

  1. Does the path for the broken files include .cursor, .claude, or .codex anywhere? Please share an example full path.
  2. A screenshot of the toolbar for that file.

If yes, that’s expected behavior. Workarounds:

  • Open Preview to the Side via Cmd+K V or the command palette works for any .md, no matter the directory.
  • If you need docs in an excluded folder with rich preview, move them to a normal directory, or use a symlink to a folder without .cursor, .claude, or .codex in the name.

A request to make this list configurable has already been sent to the team, but I can’t share an ETA.

Hi @deanrie

yes i confirm that my files are under .claude and .cursor directory: .claude/plans/2026-06-26-report-untyped-dtos.md

i use my own plan/execution system with claude + cursor, i guess i have to wait for the configurable setting. Thanks

Got it, that explains everything. .claude/plans/... falls under the excluded directories, so the WYSIWYG editor doesn’t turn on there.

Until the list is configurable, you can use Cmd+K V Open Preview to the Side or the Command Palette. They work for any .md file no matter the directory. So you can still get a preview, just not via the toolbar button.

If anything else comes up, feel free to reach out.