Cursor in-editor Markdown Preview truncates after a nested code fence

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

The in-editor Markdown Preview toggle (top-right of a .md tab: Preview / Markdown) silently truncates the document. Everything after a certain heading disappears. There is no error.

Cmd+Shift+V (VS Code Markdown Preview) shows the full file, so the source is valid.

This is Cursor’s TipTap/ProseMirror preview (markdownChunkedRender.js). It splits the file at headings, renders the first segment with setContent, then appends later segments with insertContentAt. If a later segment fails, the loop stops and all remaining sections are dropped.

The failing content is a fenced code block nested under a list item (the fence indented with two spaces). If that nested fence is in the first segment, it can still render. If it is in a later segment (after the first ~600 characters, when a new ## heading starts a new chunk), Preview stops at the previous heading.

Steps to Reproduce

  1. Create a new .md file with this content (the first section must be long enough to exceed the ~600-character first-segment threshold):
## Section A

Filler paragraph 1 with enough text to push this first segment past the six hundred character threshold that Cursor uses.

Filler paragraph 2 with enough text to push this first segment past the six hundred character threshold that Cursor uses.

Filler paragraph 3 with enough text to push this first segment past the six hundred character threshold that Cursor uses.

Filler paragraph 4 with enough text to push this first segment past the six hundred character threshold that Cursor uses.

Filler paragraph 5 with enough text to push this first segment past the six hundred character threshold that Cursor uses.

Filler paragraph 6 with enough text to push this first segment past the six hundred character threshold that Cursor uses.

## Section B

- a list item that introduces a block:

  ```hcl
  prod_environment = {
    prevent_self_review = true
  }
  ```

  continuation paragraph inside the same list item.

K-MARKER-VISIBLE: this file rendered fully.
  1. Open the file and click the in-editor Preview button (not Cmd+Shift+V).
  2. Scroll to the bottom.

Control: copy the same file, un-indent the fence so it is at column 0 (not inside the list). Preview then shows Section B and K-MARKER-VISIBLE.

Expected Behavior

Preview should render the whole document, including Section B, the nested fence, and K-MARKER-VISIBLE.

If a chunk fails to parse, Preview should still show the rest of the file, or at least surface an error instead of truncating with no message.

Cmd+Shift+V already behaves correctly on the same source.

Operating System

MacOS

Version Information

Version: 3.21.18
VS Code Extension API: 1.128.0
Commit: c4730f7d93d787d9ab120af715999f0345ee5bc0
Date: 2026-09-22T02:04:34.641Z
Layout: IDE
Build Type: Stable
Release Track: Default
Electron: 42.10.0
Chromium: 148.0.7778.280
Node.js: 24.18.1
V8: 14.8.178.38-electron.0
xterm.js: 6.1.0-beta.291
OS: Darwin arm64 27.0.0

Does this stop you from using Cursor

No - Cursor works, but with this issue

Hey @Anvar_Sosnitski, thanks for the clear repro and the control file.

This is a known issue with the built-in Preview that we’re already tracking, and I’ve added your report to it. You’re right that it only bites once, after the first chunk, when a new section starts. The part that actually trips it is the continuation paragraph after the code block, inside the same list item.

In the meantime, either of these gets the full file rendering:

  1. End the list item with the code block: move “continuation paragraph inside the same list item.” out of the list (no indent), or fold it into the line above the fence.
  2. Use the classic preview (Cmd+Shift+V, “Cmd + Shift + P > Markdown: Open Preview”), which renders the file as-is.

In general, the Preview currently struggles with any bullet item that has more than one block after its first line (a second paragraph, or a quote or code block followed by more text). Keeping those items to one block avoids it.