Plan preview parses markdown links ([text](url)) inside fenced code blocks, corrupting Scala/generic signatures

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

In the Plan panel’s inline markdown preview, inline link syntax is being parsed inside fenced code blocks. Any code containing [...](...) adjacency — e.g. a Scala method with type parameters followed by a value-parameter list — is misrendered: the [...] is treated as link text and everything up to the next ) is treated as a (hidden) link destination, so most of the snippet disappears.

Per CommonMark, inline content inside a fenced code block must be treated as literal text — no link/emphasis/HTML parsing. Cmd+Shift+V (standard VS Code preview) renders the same file correctly, so the bug is specific to the plan-pane renderer.

Cause (analysis): inline link parsing is not disabled inside fenced code blocks in the plan preview. Trigger is the ]( adjacency — def foo[T](...) breaks, def foo(...) does not; a space (] () also avoids it, confirming it’s link parsing.

Steps to Reproduce

  1. Create a .plan.md in .cursor/plans/ containing:

    def forMessage[T <: Message](
      messageClass: Class[T],
      keyColumn: String
    ): MyGenericClass[T]
    
  2. View it in the Plan panel preview.

Expected Behavior

Expected: the whole snippet should render verbatim with proper syntax highlighting

Actual: Renders as

def forMessage T <: Message

): MyGenericClass[T]

Operating System

MacOS

Version Information

Version: 3.9.16
VS Code Extension API: 1.105.1
Commit: 042b3c1a4c53f2c3808067f519fbfc67b72cad80
Date: 2026-06-27T06:41:01.941Z (1 wk ago)
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.5.0

Does this stop you from using Cursor

No - Cursor works, but with this issue

Hi @markkohspot Thank you very much for the bug report and the clear steps to reproduce. This made it fast for me to reproduce on my side and raise a bug report for the team.

For now, switch Editor Mode to Markdown or use Cmd+Shift+V for the standard Markdown preview. Adding a space between ] and ( also avoids the issue, but Markdown mode does not require changing the source.

Will keep you updated !

Thanks @kevinn the Markdown mode workaround helps for the mean time! Will keep an eye on the thread for when a proper fix comes around (or I’ll just see it in my editor haha).

One thing to note — this isn’t specific to Scala. The trigger is purely lexical: any ] immediately followed by ( inside a fenced code block gets parsed as a markdown link [text](destination), so the […] becomes link text and everything up to the next ) is swallowed as a hidden destination. That adjacency appears in the normal syntax of many languages, so the fix should disable inline markdown parsing inside fences wholesale rather than special-casing one language.

A space (] () makes it render fine, which confirms it’s link-parsing.

Repro — put any of these in a fenced code block in a .plan.md and view it in the plan preview:

C++ (lambda capture list + params — very common):

auto add = [](int a, int b) { return a + b; };
std::sort(v.begin(), v.end(), [&](auto a, auto b) { return a < b; });

Expected: renders verbatim. Actual: [](int a, int b) is eaten, leaving a broken auto add = ;.

Go (generics — square-bracket type params):

func Map[T any](xs []T, f func(T) T) []T {
    return nil
}
result := Map[int](nums, double)

Expected: verbatim. Actual: [T any](...) and [int](...) get consumed as links.

Python / TypeScript / PHP / C# / Swift / Rust (indexing or computed access of a callable):

handlers[event_type](payload)
this.handlers[type](event);
$handlers[$type]($event);

Expected: verbatim. Actual: [event_type](payload) / [type](event) / [$type]($event) collapse into link text + hidden destination.

Python typed constructor also triggers it:

counts = Dict[str, int]()

[str, int]() gets parsed as a link.

Summary: the common culprits are C++ lambdas, Go/Scala generics, and any arr[key](args) callable-indexing pattern. The general rule: fenced code containing ] adjacent to ( breaks. Ideally inline parsing (links, emphasis, HTML) should be fully disabled inside code fences, per CommonMark.

Thank you @markkohspot! I’ve added this as additional context to the Bug Report.