mirror of
https://github.com/zed-industries/zed.git
synced 2026-11-22 00:20:23 +01:00
a4b39c38e0
## Summary Closes #65311 Images in the Markdown preview were always drawn with rounded corners, because `MarkdownElement` applied `.rounded_md()` to every image. Badges such as shields.io looked different from how GitHub and browsers render them. The rounding was added on purpose for images in the agent panel (#56427), so this PR doesn't remove it everywhere. It adds a `rounded_images` field to `MarkdownStyle`, which defaults to `true`. The preview style overrides set it to `false`. Other uses of `MarkdownStyle`, including the agent panel, look the same as before. If reviewer prefer that images stay square everywhere, the alternative is to drop the `.rounded_md()` call and the new field. That's simpler but also changes the agent panel. I can change current apporach to this if needed. ### Before <img width="1920" height="1080" alt="Screenshot from 2026-10-11 17-55-18" src="https://github.com/user-attachments/assets/6e96bfd2-b516-4c8e-815e-fb49b7a394af" /> ### After <img width="1920" height="1080" alt="image" src="https://github.com/user-attachments/assets/07d7ca1b-69ff-4a5d-a66b-1a2026c6e561" /> ## Testing - `cargo check -p markdown -p markdown_preview` passes. - `cargo test -p markdown`: all 186 existing tests pass. No new test was added because this is a visual change. To manual test, create a Markdown file containing:  Open the Markdown preview. The badge should have square corners. Then paste an image into the agent panel and check that it's still rounded there. ## Self-review - [x] I've reviewed my diff for quality, security, reliability, and performance. - [x] UI changes follow the [checklist](https://zed.dev/docs/development/ui-checklist). - [x] Tests cover the new or changed behavior. Release Notes: - Fixed images in the Markdown preview being rendered with rounded corners.