Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

markdown_preview: Improve heading spacing (#59291)

Danilo Leal29b90dc4e883
diff --git a/crates/markdown/src/markdown.rs b/crates/markdown/src/markdown.rs
index 99b3fd20118..464a6e757fc 100644
--- a/crates/markdown/src/markdown.rs
+++ b/crates/markdown/src/markdown.rs
@@ -1311,7 +1311,11 @@ impl MarkdownElement {
builder.pop_text_style();
builder.pop_text_style();
} else {
- builder.push_text_style(self.style.inline_code.clone());
+ let mut code_style = self.style.inline_code.clone();
+ if builder.link_depth > 0 {
+ code_style.color = self.style.link.color.or(code_style.color);
+ }
+ builder.push_text_style(code_style);
builder.push_text(text, range);
builder.pop_text_style();
}
@@ -2763,6 +2767,11 @@ fn apply_heading_style(
pulldown_cmark::HeadingLevel::H6 => heading.text_sm(),
};
+ heading = match level {
+ pulldown_cmark::HeadingLevel::H1 => heading,
+ _ => heading.mt_6(),
+ };
+
if let Some(border_color) = border_color
&& matches!(
level,