# markdown_preview: Add heading_font_weight setting \(\#64421\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/28d5832adb440795a47a1ca1ebd2226ad6c9fea6)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 28d5832adb440795a47a1ca1ebd2226ad6c9fea6

Requested commit: 28d5832adb440795a47a1ca1ebd2226ad6c9fea6

Commit: 28d5832adb440795a47a1ca1ebd2226ad6c9fea6

Tree: c23197054fe9724bb91f884df0bb97837713c9f1

Author: andrew

Committer: GitHub

## Message

````
markdown_preview: Add heading_font_weight setting (#64421)

Headings in the Markdown preview are hardcoded to semibold (600). Users
who set a lighter UI font, or who simply prefer lighter headings, have
no way to change this.

This adds `markdown_preview.heading_font_weight`, applied to H1 through
H6 in the preview. It defaults to `600`, so existing rendering is
unchanged unless the setting is set.

```jsonc
{
  "markdown_preview": {
    "heading_font_weight": 500
  }
}
```

The value flows through `ThemeSettings` alongside the existing preview
typography settings, so the generic `markdown` crate gains no dependency
on `markdown_preview`. Because notebook Markdown cells share the preview
typography, they follow the setting too. Bold text inside headings and
table header cells keep their own weights. The setting is also exposed
in the settings editor under Markdown Preview Font, and documented in
the visual customization docs.

## Before / after

| Default (`600`) | `"heading_font_weight": 500` |
| --- | --- |
| <img width="2000" height="1299" alt="heading-weight-600-default"
src="https://github.com/user-attachments/assets/403d29bb-34ed-4cb1-b333-920ec5ee65f0"
/> | <img width="2000" height="1299" alt="heading-weight-500"
src="https://github.com/user-attachments/assets/9fbdd7f9-2d56-4815-a39e-fd1325ba7cd2"
/> |


## Testing

- New tests in `crates/markdown` assert every preview heading level
resolves to `600` by default and to the configured weight when set, and
that the weight does not leak into editor or agent Markdown.
- Verified manually in a dev build with `SF Pro` at weights 500 and 600;
the open preview re-renders on settings save.

Release Notes:

- Added `markdown_preview.heading_font_weight` to configure the font
weight of headings in the Markdown preview.
````

## Parents

- [54edefa0832e4728bcf077e4a48b25912eea5433](https://git.cafe/gitcafe/zed/commit/54edefa0832e4728bcf077e4a48b25912eea5433?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/28d5832adb440795a47a1ca1ebd2226ad6c9fea6?format=markdown)
