Skip to content

fix blockquote styling and tests for bold text rendering#128

Open
vsaase wants to merge 1 commit intoforesightmobile:mainfrom
vsaase:fix-blockquote-formatting
Open

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

Conversation

@vsaase
Copy link
Copy Markdown

@vsaase vsaase commented Mar 26, 2026

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
Copy link
Copy Markdown
Author

vsaase commented Mar 31, 2026

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

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