Make Markdown preview paragraph line-height configurable (currently hardcoded to 1.3, too tight for CJK) #56111
Replies: 6 comments
-
|
Need for english too. |
Beta Was this translation helpful? Give feedback.
-
|
The current value for latin (English) is also by far too tight. Not being dyslexic but paragraphs of text is simply easier to read from the editor than the current viewer. 1.5 should be the default value and configurable as well if anyone cares to have it more compact or more readable for CJK languages. |
Beta Was this translation helpful? Give feedback.
-
|
I think this configuration is very much needed across the board |
Beta Was this translation helpful? Give feedback.
-
|
Please add some basic configuration for markdown preview |
Beta Was this translation helpful? Give feedback.
-
|
+1. Current Markdown preview styling is not great:
|
Beta Was this translation helpful? Give feedback.
-
|
I'm old, I need this 😂 |
Beta Was this translation helpful? Give feedback.

Uh oh!
There was an error while loading. Please reload this page.
-
Motivation
The Markdown preview uses a hardcoded paragraph
line-heightofrems(1.3). For Latin scripts this is acceptable, but for CJK text (Japanese, Chinese, Korean) it makes paragraphs feel cramped and noticeably hurts readability. Latin glyphs use only part of the em-box and have ascenders/descenders that create visual breathing room; CJK glyphs fill the em-box with flat tops/bottoms, so the same multiplier collapses the space between baselines.For comparison, GitHub's Markdown rendering uses
1.5for paragraphs, and typographic guidelines for body CJK text typically recommend1.7–2.0.Current behavior
line_height(rems(1.3))incrates/markdown/src/markdown.rsaround L1164–1165.MarkdownStyle::default()setsheight_is_multiple_of_line_height: false, and theMarkdownFont::Previewbranch does not flip it. The hardcoded path is always taken in the preview.buffer_line_heightfromThemeSettingsis consumed only incrates/markdown_preview/src/markdown_preview_view.rs::line_scroll_amount— it controls scrolling, not rendering.buffer_line_height,languages.Markdown.buffer_line_height, or the newmarkdown_preview_themefrom markdown_preview: Independent font family and theme #54003) changes the preview's paragraph spacing.Workarounds today
Increasing
buffer_font_sizewidens the gap as a side effect (gap = font_size × 1.3), but text size grows in lockstep. There is no other knob.Proposal
In rough order of scope:
rems(1.3)torems(1.5)to match GitHub. Improves CJK readability immediately, no new setting.markdown_preview_line_height— parallel tomarkdown_preview_themeandmarkdown_preview_font_family(markdown_preview: Independent font family and theme #54003), accepting the same shape asbuffer_line_height:"standard" | "comfortable" | { "custom": <number> }. Default unchanged. Preview-only, leaves code editing untouched.buffer_line_height— flipheight_is_multiple_of_line_heighttotruefor the preview path so the existing setting applies. Simpler, but couples preview prose readability to code editor line-height.Option 2 follows the precedent set by #54003 and keeps preview tuning independent from code.
Related
markdown_preview_themeandmarkdown_preview_font_family.Environment
Beta Was this translation helpful? Give feedback.
All reactions