Skip to content

fix blockquote styling and tests for bold text rendering - #128

Closed
vsaase wants to merge 1 commit into
foresightmobile:mainfrom
vsaase:fix-blockquote-formatting
Closed

fix blockquote styling and tests for bold text rendering#128
vsaase wants to merge 1 commit into
foresightmobile:mainfrom
vsaase:fix-blockquote-formatting

Conversation

@vsaase

@vsaase vsaase commented Mar 26, 2026

Copy link
Copy Markdown

Fix blockquote inline formatting (bold, italic, links)

Blockquotes were ignoring inline styles — bold, italic, and link colors inside a > blockquote all rendered without their expected formatting.

Root cause: In MarkdownBuilder.visitText, the blockquote check short-circuited to styleSheet.blockquote instead of _inlines.last.style, discarding any styles accumulated by nested strong/em/a elements.

Changes:

builder.dart — _addParentInlineIfNeeded now seeds the inline element with the blockquote base style when inside a blockquote; visitText always uses _inlines.last.style (the accumulated style chain).
blockquote_test.dart — Updated the "should work with styling" test to assert correct bold/italic/link rendering; added a dedicated test for bold text inside a blockquote.

Note: this merge request was almost completely made with Claude and Github CoPilot

@jcpsantiago

Copy link
Copy Markdown

There's a nice reviewed fix at: https://github.com/jusbrasil/flutter_markdown_plus/pull/1/changes. Comparing both PRs, the one linked is neater (fewer code changes, no changes to deps).

FYI to the maintainers here.

@vsaase

vsaase commented Mar 31, 2026

Copy link
Copy Markdown
Author

Your linked PR is shorter because it simply ignores stylesheet.blockquote

@gazreese gazreese mentioned this pull request Jul 6, 2026
@gazreese

gazreese commented Jul 6, 2026

Copy link
Copy Markdown
Member

Thanks @vsaase! 🙏 The blockquote inline-formatting 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
…resightmobile#128, foresightmobile#42)

Recreated from PR foresightmobile#128 by @vsaase (blockquote inline bold/italic/link
rendering + tests) and PR foresightmobile#42 by @domhel (theme-aware blockquote
decoration); contributor lockfile changes dropped.

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.

3 participants