Skip to content

fix: normalize backslashes in markdown image paths on Windows#9174

Draft
mscolnick wants to merge 1 commit intomainfrom
ms/fix/9159
Draft

fix: normalize backslashes in markdown image paths on Windows#9174
mscolnick wants to merge 1 commit intomainfrom
ms/fix/9159

Conversation

@mscolnick
Copy link
Copy Markdown
Contributor

Closes #9159

Copilot AI review requested due to automatic review settings April 13, 2026 20:00
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 13, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
marimo-docs Ready Ready Preview, Comment Apr 28, 2026 3:59pm

Request Review

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes Markdown image rendering on Windows by normalizing Windows-style backslashes in saved image paths to URL-friendly forward slashes.

Changes:

  • Normalize savedFilePath backslashes (\) to forward slashes (/) before inserting the Markdown image link.
  • Add a unit test to ensure Windows-style paths are converted to forward-slash paths in the inserted Markdown.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
frontend/src/core/codemirror/markdown/commands.ts Normalizes saved image paths to forward slashes so Markdown image URLs work on Windows.
frontend/src/core/codemirror/markdown/tests/commands.test.ts Adds coverage for Windows-style path normalization behavior in insertImage.

@mscolnick mscolnick requested a review from Light2Dark April 13, 2026 20:07
@mscolnick mscolnick added the bug Something isn't working label Apr 13, 2026
@mscolnick mscolnick enabled auto-merge (squash) April 13, 2026 20:07
@mscolnick mscolnick marked this pull request as draft April 14, 2026 13:21
auto-merge was automatically disabled April 14, 2026 13:21

Pull request was converted to draft

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 28, 2026

Bundle Report

Changes will decrease total bundle size by 24.1kB (-0.1%) ⬇️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
marimo-esm 25.12MB -24.1kB (-0.1%) ⬇️

Affected Assets, Files, and Routes:

view changes for bundle: marimo-esm

Assets Changed:

Asset Name Size Change Total Size Change (%)
assets/react-*.js -24.13kB 725.17kB -3.22%
assets/cells-*.js 27 bytes 704.32kB 0.0%
assets/dist-*.js 65 bytes 169 bytes 62.5% ⚠️
assets/dist-*.js 6 bytes 183 bytes 3.39%
assets/dist-*.js -73 bytes 183 bytes -28.52%
assets/dist-*.js -111 bytes 276 bytes -28.68%
assets/dist-*.js -56 bytes 104 bytes -35.0%
assets/dist-*.js 2 bytes 104 bytes 1.96%
assets/dist-*.js 171 bytes 335 bytes 104.27% ⚠️
assets/dist-*.js -2 bytes 102 bytes -1.92%
assets/dist-*.js -99 bytes 160 bytes -38.22%
assets/dist-*.js -17 bytes 259 bytes -6.16%
assets/dist-*.js -46 bytes 137 bytes -25.14%
assets/dist-*.js -158 bytes 177 bytes -47.16%
assets/dist-*.js -7 bytes 176 bytes -3.83%
assets/dist-*.js 218 bytes 387 bytes 128.99% ⚠️
assets/dist-*.js -33 bytes 104 bytes -24.09%
assets/dist-*.js 227 bytes 403 bytes 128.98% ⚠️
assets/dist-*.js 33 bytes 137 bytes 31.73% ⚠️
assets/dist-*.js 119 bytes 256 bytes 86.86% ⚠️
assets/dist-*.js -239 bytes 164 bytes -59.31%

Files in assets/cells-*.js:

  • ./src/core/codemirror/markdown/commands.ts → Total Size: 8.58kB

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Images from /public are not displayed in markdown

2 participants