From 138c335d7c1f36f82c3f365b55ded866c0d368f7 Mon Sep 17 00:00:00 2001 From: Danilo Leal <67129314+danilo-leal@users.noreply.github.com> Date: Wed, 14 Jan 2026 18:42:00 -0300 Subject: [PATCH] markdown_preview: Fix wide tables not being fully visible (#46834) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes https://github.com/zed-industries/zed/issues/44630 Content in markdown preview tables now wraps so you can see it all when it's a table with very long content: Screenshot 2026-01-14 at 6  23@2x Release Notes: - Fixed a bug with very wide tables not being fully visible in markdown previews. --- crates/markdown_preview/src/markdown_renderer.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/crates/markdown_preview/src/markdown_renderer.rs b/crates/markdown_preview/src/markdown_renderer.rs index 15dda91740f17bdd63c07b39045fe815caf1697c..264e112baee364b7b31bde8b94cd05a5c586fcd5 100644 --- a/crates/markdown_preview/src/markdown_renderer.rs +++ b/crates/markdown_preview/src/markdown_renderer.rs @@ -9,7 +9,7 @@ use gpui::{ AbsoluteLength, AnyElement, App, AppContext as _, Context, Div, Element, ElementId, Entity, HighlightStyle, Hsla, ImageSource, InteractiveText, IntoElement, Keystroke, Modifiers, ParentElement, Render, Resource, SharedString, Styled, StyledText, TextStyle, WeakEntity, - Window, div, img, px, rems, + Window, div, img, rems, }; use settings::Settings; use std::{ @@ -561,14 +561,16 @@ fn render_markdown_table(parsed: &ParsedMarkdownTable, cx: &mut RenderContext) - .when_some(parsed.caption.as_ref(), |this, caption| { this.children(render_markdown_text(caption, cx)) }) + .border_1() + .border_color(cx.border_color) + .rounded_sm() + .overflow_hidden() .child( div() + .min_w_0() + .w_full() .grid() .grid_cols(max_column_count as u16) - .border(px(1.5)) - .border_color(cx.border_color) - .rounded_sm() - .overflow_hidden() .children(cells), ) .into_any()