Hey, thanks for the detailed report and steps. This is a confirmed bug on our side. In Cursor Preview, clicking a relative link with a #fragment anchor does not split the #... part from the path, so the file looks like it cannot be found. The issue is already tracked, but I can’t share an ETA for the fix yet.
A couple of workarounds for now:
A link without a fragment opens fine: [import-body.js](import-body.js).
If you need to jump to a specific line, use the built-in preview: Command Palette → Markdown: Open Preview or Ctrl+Shift+V. There the path and fragment are parsed correctly and the file opens.
Note that the GitHub range syntax #L12-L15 is not supported in any Markdown preview. Only a single line anchor like #L12 works.
Once there’s an update on the fix, I’ll reply in the thread.
that’s the code I have in .md file. Clicking it in Markdown view works. It follows the link and focuses on the line. Clicking this in Preview - doesn’t.
instead it throws
ERR V0: The editor could not be opened because the file was not found.
at P_n.handleSetInputError (workbench.desktop.main.js:25084:37758)
at async P_n.setInput (workbench.desktop.main.js:25084:36767)
at async hhh.doSetInput (workbench.desktop.main.js:21277:195819)
at async hhh.doOpenEditor (workbench.desktop.main.js:21277:193559)
at async hhh.openEditor (workbench.desktop.main.js:21277:192484)
at async workbench.desktop.main.js:21389:39428
at async uwh.doOpenCodeEditor (workbench.desktop.main.js:24272:37819)
at async uwh.openCodeEditor (workbench.desktop.main.js:24272:26742)
at async y0h.open (workbench.desktop.main.js:24728:3373)
at async w0h.open (workbench.desktop.main.js:24728:5666)
at async cCk (workbench.desktop.main.js:20497:46033)
it’s rather annoying bug. I am using Cursor to explain me some things through .md
This bug prevents me from following links to code when I Am reading generated documentation. Reading Markdown view is obv. is not a great experience.
For now, my workaround would be - keeping VSCode open with their Preview since there is no bug there.
Hey, thanks for clarifying. This was a misunderstanding because there are two different kinds of Preview.
You’re right. In Cursor Preview (the one you switch with the Preview/Code toggle in the tab), links with #fragment don’t work at all. That includes both #L3207 and ranges like #L12-L15. That’s the bug. The #... fragment isn’t separated from the path, so the file “can’t be found”. There’s no difference between a single line and a range there.
What I said about #L12 working was about the other preview, the built-in Markdown preview. Open it via Command Palette → Markdown: Open Preview or Ctrl+Shift+V. It’s inside Cursor, so you don’t need a separate VS Code. In that preview, the path and fragment are parsed correctly, and a single anchor like #L3207 opens the file at the right line. Ranges like #L12-L15 aren’t supported anywhere, not in Cursor and not in VS Code. Only single-line anchors work.
So the workaround without using a separate VS Code is to read the docs via Ctrl+Shift+V, not via the Preview toggle.
The Preview toggle bug is known and tracked. There’s no ETA for a fix yet. I’ll post an update in the thread when there’s news.