Skip to content

fix strong line height - #130

Closed
szuwest wants to merge 2 commits into
foresightmobile:mainfrom
szuwest:main
Closed

fix strong line height#130
szuwest wants to merge 2 commits into
foresightmobile:mainfrom
szuwest:main

Conversation

@szuwest

@szuwest szuwest commented Mar 30, 2026

Copy link
Copy Markdown

Build strutStyle from paragraph style to enforce consistent line height across spans with different font weights.

szuwest added 2 commits March 30, 2026 14:44
Build strutStyle from paragraph style to enforce consistent line height across spans with different font weights.
@gazreese gazreese mentioned this pull request Jul 6, 2026
@gazreese

gazreese commented Jul 6, 2026

Copy link
Copy Markdown
Member

Thanks @szuwest! 🙏 The strong-text line-height fix shipped in 1.0.8 (just published to pub.dev). It was integrated locally rather than merged directly, so this PR didn't auto-close — you're credited in the CHANGELOG. Closing as resolved.

@gazreese gazreese closed this Jul 6, 2026
luccasclezar pushed a commit to Estudio-Pirilampo-Mestre/flutter_markdown_plus that referenced this pull request Aug 16, 2026
Bold (strong) spans previously altered the line height of a paragraph
because the rich text used the per-span font metrics. Build a forced
strut height from the paragraph style and pass it to both the
SelectableText.rich and Text.rich constructors so line height stays
consistent regardless of font weight.

Recreated from PR foresightmobile#130 by @szuwest.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
luccasclezar pushed a commit to Estudio-Pirilampo-Mestre/flutter_markdown_plus that referenced this pull request Aug 16, 2026
_buildRichText is the generic rich-text builder, also used for headers,
blockquotes and list items. Deriving the strut from styleSheet.p forced
large headers down to the paragraph line height, vertically clipping
them. Build the strut from the span's own base style instead, falling
back to styleSheet.p for size/height when the span omits them. This keeps
headers/blockquotes at their correct height while still keeping line
height consistent across mixed font weights within a block.

Adds a regression test proving a header's strut follows the header size,
not the (smaller) paragraph size.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
luccasclezar pushed a commit to Estudio-Pirilampo-Mestre/flutter_markdown_plus that referenced this pull request Aug 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants