fix strong line height - #130
Closed
szuwest wants to merge 2 commits into
Closed
Conversation
Build strutStyle from paragraph style to enforce consistent line height across spans with different font weights.
Update builder.dart
Merged
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. |
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Build strutStyle from paragraph style to enforce consistent line height across spans with different font weights.