From 14f0a254ebee5189fd64f3793e7089c705cb9e49 Mon Sep 17 00:00:00 2001 From: Kento Yamamoto Date: Wed, 22 Apr 2026 14:38:47 +0900 Subject: [PATCH] markdown: Apply theme syntax color to inline code in rendered markdown (#54475) ## Summary Inline code in rendered markdown previously used only the default foreground color with a subtle background tint, which made it visually indistinguishable from surrounding prose in some themes. This change looks up the `text.literal` syntax style from the active theme and applies its color to inline code, matching the treatment used for inline code elsewhere in the editor (e.g. syntax highlighting in source buffers). When the theme does not define `text.literal`, the color falls back to the previous default. Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [x] Unsafe blocks (if any) have justifying comments - [x] The content is consistent with the [UI/UX checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) - [x] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable Release Notes: - Improved inline code in rendered markdown to use the theme's `text.literal` syntax color --- crates/markdown/src/markdown.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/crates/markdown/src/markdown.rs b/crates/markdown/src/markdown.rs index c2d8e45f16ea6f8dbe788cffae00a0bf7fc2b640..6751d2f78618e4759df5ebb1243e97f770f9dcc7 100644 --- a/crates/markdown/src/markdown.rs +++ b/crates/markdown/src/markdown.rs @@ -196,6 +196,11 @@ impl MarkdownStyle { font_size: Some(buffer_font_size.into()), font_weight: Some(buffer_font_weight), background_color: Some(colors.editor_foreground.opacity(0.08)), + color: cx + .theme() + .syntax() + .style_for_name("text.literal") + .and_then(|style| style.color), ..Default::default() }, link: TextStyleRefinement {