Skip to content

Commit ae2f3c9

Browse files
chrisbobbegnprice
authored andcommitted
content: Stop accidentally dropping paragraph text style in user mentions
In c7be9c3 we specified some text style properties to follow web (including using the Source Sans 3 font). That didn't get applied to user mentions, so those were conspicuously different from surrounding text. Fixed now. Fixes: #430
1 parent 8f43bc6 commit ae2f3c9

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

lib/widgets/content.dart

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,12 @@ class Paragraph extends StatelessWidget {
9898

9999
final ParagraphNode node;
100100

101+
static TextStyle getTextStyle(BuildContext context) => const TextStyle(
102+
fontFamily: 'Source Sans 3',
103+
fontSize: 14,
104+
height: (17 / 14),
105+
).merge(weightVariableTextStyle(context));
106+
101107
@override
102108
Widget build(BuildContext context) {
103109
// Empty paragraph winds up with zero height.
@@ -106,11 +112,7 @@ class Paragraph extends StatelessWidget {
106112

107113
final text = _buildBlockInlineContainer(
108114
node: node,
109-
style: const TextStyle(
110-
fontFamily: 'Source Sans 3',
111-
fontSize: 14,
112-
height: (17 / 14),
113-
).merge(weightVariableTextStyle(context)),
115+
style: getTextStyle(context),
114116
);
115117

116118
// If the paragraph didn't actually have a `p` element in the HTML,
@@ -594,7 +596,7 @@ class UserMention extends StatelessWidget {
594596
// One hopes an @-mention can't contain an embedded link.
595597
// (The parser on creating a UserMentionNode has a TODO to check that.)
596598
linkRecognizers: null,
597-
style: null,
599+
style: Paragraph.getTextStyle(context),
598600
nodes: node.nodes));
599601
}
600602

0 commit comments

Comments
 (0)