Markdown render problem

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

The Markdown file is cut mid file after a renderer error. I can not give the real .md file but this is the error:
workbench.desktop.main.js:1734 linkifyjs: already initialized - will not register custom scheme “file” until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.
workbench.desktop.main.js:486 Uncaught RangeError: Invalid collection of marks for node text: italic,italic
at Koa.check (workbench.desktop.main.js:486:44009)
at workbench.desktop.main.js:486:44143
at JJ.forEach (workbench.desktop.main.js:486:33005)
at qoa.check (workbench.desktop.main.js:486:44130)
at workbench.desktop.main.js:486:44143
at JJ.forEach (workbench.desktop.main.js:486:33005)
at qoa.check (workbench.desktop.main.js:486:44130)
at workbench.desktop.main.js:486:44143
at JJ.forEach (workbench.desktop.main.js:486:33005)
at qoa.check (workbench.desktop.main.js:486:44130)

The same file works fine in the Classic preview and Notepad++.
Grok’s analyze said :
Cursor’s in-editor Preview does not treat that $$ block as math first, so Markdown reads the underscores as emphasis and pairs them as nested . ProseMirror’s schema allows italic once, not italic,italic, and the rest of the catalog never renders.

Steps to Reproduce

Cursor’s in-editor Preview does not treat that $$ block as math first, so Markdown reads the underscores as emphasis and pairs them as nested . ProseMirror’s schema allows italic once, not italic,italic, and the rest of the catalog never renders.

Operating System

Windows 10/11

Version Information

3.20.23 (user setup)

Does this stop you from using Cursor

Sometimes - I can sometimes use Cursor

Hey @TByte007, thanks for the report!

This is a known issue with the built-in Preview renderer that we’re already tracking, and I’ve added your report to it. Your read of the cause is right on two counts: the current Preview does not treat $$ … $$ blocks as math yet (that is coming in 3.21), and when text inside them, or anywhere else in the file, ends up as emphasis nested inside emphasis, the Preview stops rendering at that point instead of skipping it. That is why everything after that block is missing.

If you can, the few lines right around where the Preview cuts off (with the actual text replaced by placeholders is fine) would help us confirm it is the same trigger, but no worries if not..

I asked Grok to fix it. Don’t have the original block anymore and then added a rule for the agents not to use LaTeX math syntax. :neutral_face:

Hey @TByte007,

Quick update on this one. A fix that keeps the Preview from stopping partway when emphasis ends up nested inside emphasis (the italic,italic error you saw) is coming in Cursor 3.25 (releasing soon)

Also, $$ ... $$ math blocks now render as math in the Preview on the latest version, so the LaTeX inside them is no longer read as emphasis. Once you’re on 3.25 you should be able to drop the no-LaTeX rule for your agents.

Let me know if the Preview still cuts a file off after that.