Cursor Markdown Rendering & Formatting (tables / mermaid)

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

Cursor Markdown Rendering & Formatting Bug Reports

Bug Report #1: Mermaid Diagrams Not Rendering in Preview Mode

Environment:

  • OS: macOS 25.1.0 (Darwin)
  • Cursor Version: [Current version]
  • File Type: Markdown (.md)

Description:
Mermaid diagram code blocks are not rendering as visual diagrams in Cursor’s markdown preview mode. Instead, the raw mermaid syntax is displayed as plain text.

Steps to Reproduce:

  1. Create or open a markdown file in Cursor
  2. Add a mermaid code block with valid syntax:
    ```mermaid
    graph TB
        A[Start] --> B[Process]
        B --> C[End]
    ```
    
  3. Switch to preview mode (Cmd+Shift+V or preview button)
  4. Observe the output

Expected Behavior:
The mermaid code block should render as a visual diagram/flowchart in preview mode, similar to how GitHub, GitLab, and other modern markdown viewers render mermaid diagrams.

Actual Behavior:
The raw mermaid syntax is displayed as plain text within a code block. No visual diagram is generated.

Example Code:

graph TB
    kVersionH[kVersion.h]
    pythonGen[Python Generator]
    
    kVersionH -->|Preprocessor| pythonGen
    
    subgraph bit32opt [32-bit Optional]
        v1XML[version.xml<br/>v1.x]
        v2XML[version2.xml<br/>v2.x]
    end
    
    pythonGen -->|optional| v1XML
    pythonGen -->|optional| v2XML

Impact:

  • High - Mermaid is a widely-adopted standard for diagram-as-code
  • Reduces documentation quality when working within Cursor
  • Forces users to use external tools (mermaid.live, GitHub) to visualize diagrams
  • Breaks parity with other modern markdown editors

Workarounds:

  • Copy/paste mermaid code to https://mermaid.live for rendering
  • View markdown files on GitHub/GitLab
  • Export diagrams as images and embed them
  • Use ASCII art diagrams instead

Feature Request:
Add native mermaid rendering support to Cursor’s markdown preview, similar to VSCode extensions like “Markdown Preview Mermaid Support” or built-in support in GitHub/GitLab.


Bug Report #2: Markdown Tables Auto-Collapsing on Save

Environment:

  • OS: macOS 25.1.0 (Darwin)
  • Cursor Version: [Current version]
  • File Type: Markdown (.md)

Description:
Properly formatted markdown tables are automatically collapsed into a single line when the file is saved, making them unreadable in both edit mode and preview mode. This appears to be caused by an auto-formatter or linter running on save.

Steps to Reproduce:

  1. Create or open a markdown file in Cursor
  2. Add a properly formatted markdown table:
    | Column 1 | Column 2 | Column 3 |
    |----------|----------|----------|
    | Data A   | Data B   | Data C   |
    | Data D   | Data E   | Data F   |
    
  3. Save the file (Cmd+S)
  4. Observe the file contents after save

Expected Behavior:
The markdown table should remain on multiple lines with proper formatting, preserving readability in both edit and preview modes.

Actual Behavior:
The entire table is collapsed into a single line:

| Column 1 | Column 2 | Column 3 ||----------|----------|----------|| Data A   | Data B   | Data C   || Data D   | Data E   | Data F   |

This makes the table:

  • Completely unreadable in edit mode
  • Improperly rendered in preview mode (appears as single row or malformed)
  • Impossible to maintain or update

Reproducibility:

  • 100% reproducible
  • Occurs consistently across multiple markdown files
  • Affects both simple and complex tables
  • Even HTML tables get partially collapsed (opening tag merged with content)

Example - Before Save:

| Build Configuration | Published Editions | Version Files |
|---------------------|-------------------|---------------|
| **Baseline**        | 2 editions        | 1 file        |
| **Maximum**         | 8 editions        | 5 files       |

Example - After Save:

| Build Configuration | Published Editions | Version Files ||---------------------|-------------------|---------------|| **Baseline**        | 2 editions        | 1 file        || **Maximum**         | 8 editions        | 5 files       |

Impact:

  • Critical - Makes markdown tables completely unusable
  • Destroys readability and maintainability of documentation
  • Forces workarounds like using HTML tables or external formatting
  • Breaks standard markdown syntax
  • Likely caused by overly aggressive formatter/linter

Suspected Cause:
One of the following may be causing this behavior:

  • Built-in Cursor markdown formatter running on save
  • Prettier or similar formatter with aggressive settings
  • Markdown linter with incorrect table formatting rules
  • Auto-save conflict causing line collapse

Workarounds:

  • Use HTML <table> elements instead of markdown tables
  • Disable auto-format on save (if possible)
  • Use external markdown editors for table-heavy documents
  • Manually re-format after every save (not sustainable)

Feature Request / Fix Needed:

  1. Identify and fix the formatter/linter causing table collapse
  2. Add settings to control markdown formatting behavior
  3. Respect standard markdown table syntax
  4. Add option to disable auto-formatting for specific file types or sections
  5. Follow Prettier/CommonMark standards for markdown table formatting

Additional Notes:
This issue also affects other markdown formatting:

  • Spacing between sections gets collapsed (e.g., content--- instead of content\n\n---)
  • Multiple blank lines are sometimes removed
  • May be related to a “compact” or “minify” setting being enabled

System Information

Operating System: macOS 25.1.0 (Darwin)
Shell: /bin/bash
Project Type: Multi-root workspace with C++/Qt and Python code
File Encoding: UTF-8

Logs/Additional Information

If logs are available showing the formatter/linter being executed on save, they would be helpful for debugging.

Priority

  • Bug #1 (Mermaid): Medium-High - Feature gap, workarounds exist
  • Bug #2 (Tables): Critical - Actively breaks existing functionality, no reliable workaround

Report Generated: December 28, 2025

Steps to Reproduce

Bug Report #1: Mermaid Diagrams Not Rendering in Preview Mode

Create or open a markdown file in Cursor
Add a mermaid code block with valid syntax:

graph TB
    A[Start] --> B[Process]
    B --> C[End]

Switch to preview mode (Cmd+Shift+V or preview button)
Observe the output

Bug Report #2: Markdown Tables Auto-Collapsing on Save
Create or open a markdown file in Cursor
Add a properly formatted markdown table:

Column 1 Column 2 Column 3
Data A Data B Data C
Data D Data E Data F
Save the file (Cmd+S)
Observe the file contents after save

Expected Behavior

they look good

Operating System

MacOS

Current Cursor Version (Menu → About Cursor → Copy)

Version: 2.2.44 (Universal)
VSCode Version: 1.105.1
Commit: 20adc1003928b0f1b99305dbaf845656ff81f5d0

For AI issues: which model did you use?

n/a

Does this stop you from using Cursor

No - Cursor works, but with this issue

Hey, thanks for the report.

Bug #1 - Mermaid diagrams:
Mermaid is supported in Cursor, but it needs an extension. Please install “Markdown Preview Mermaid Support” by bierner:

  1. Open the Extensions tab Cmd+Shift+X
  2. Search for “Markdown Preview Mermaid”
  3. Install the extension by bierner

After that, diagrams should render in Preview. More details: Mermaid Diagrams | Cursor Docs

Bug #2 - Tables collapse on save:
This looks like a new issue I haven’t seen in other reports. It’s likely related to auto-formatting. Could you check:

  1. Which extensions you have installed (especially Prettier and any Markdown formatters)?
  2. Settings > Text Editor > “Format On Save”, try turning it off
  3. Your .vscode/settings.json or .cursor/settings.json for any Markdown-specific formatting settings
  4. Whether the bug still happens if you disable all extensions

Share what you find and we can narrow it down.

1 Like
•Install the extension “Markdown Preview Mermaid”

probably should be built-in, or auto installed the first time someone shows a preview with mermaid in it?

oh yeah, it works perfectly, by the way, thanks!

Bug #2 - Tables collapse on save:
• Which extensions you have installed (especially Prettier and any Markdown formatters)?
just "markdown editor” by zaaack.

• Settings > Text Editor > “Format On Save”, try turning it off

it was already off

i DO have "Trim Trailing Whitespace In Regex And Strings” turned on?

• Your .vscode/settings.json

does not exist

or .cursor/settings.json
also does not exist

• Whether the bug still happens if you disable all extensions

Same result with extensions off and pure markdown - blank lines inserted between every row:

748: | Enum | 32-bit | 64-bit | TEST |
749: (blank)
750: |—|—|—|—|
751: (blank)
752: | kVersLinkType_VERS | “vers” | “vers_perpetual” | ✓ |
753: (blank)
754: | kVersLinkType_VERS2 | “vers_2” | “vers_2_perpetual” | ✓ |

The bug occurs regardless of spacing. It’s inserting blank lines between table rows during the save operation, whether the table uses space padding or pure minimal markdown.

says cursor:
• Occurs in larger/complex markdown files (~1000+ lines)
• Does NOT occur in small test files (~50 lines)
• Occurs with ALL extensions disabled
• Affects pure markdown tables (not tables inside code fences)

And now, for some reason, we can no longer reproduce the bug where it gets compressed onto one line. But inserting blank lines definitely happens.

Share what you find and we can narrow it down.

Summary of the bug:
• Raw markdown tables get corrupted on save (blank lines inserted between rows, or entire table compressed to one line)
• Tables inside code fences ( `` ) are protected and save correctlyThe workaround: Wrap tables in code fences. The downside is they won’t render as fancy HTML tables in preview - they’ll just be monospaced preformatted text. But they’ll look correct in both editor AND preview.This is definitely a Cursor/VS Code formatting bug affecting raw markdown tables. Would you like me to: 1. Document this bug in your cursor_markdown_bugs.md file? 2. Check your workspace settings for any formatters that might be causing this?

-dave

Glad Mermaid is working.

About the table bug, it’s interesting that it only happens in large files (1,000+ lines). A couple of things to check:

  1. Try disabling “Trim Trailing Whitespace In Regex And Strings” - it might affect table formatting.
  2. Temporarily disable the “markdown editor” extension by zaaack - it may have its own Markdown formatting logic on save.

Let me know if the behavior changes after these tests.