@@ -333,25 +333,20 @@ class _InlineContentBuilder {
333
333
}
334
334
335
335
InlineSpan _buildNode (InlineContentNode node) {
336
- InlineSpan styled (List <InlineContentNode > nodes, TextStyle style) =>
337
- _buildNodes (nodes, style: style);
338
-
339
336
if (node is TextNode ) {
340
337
return TextSpan (text: node.text);
341
338
} else if (node is LineBreakInlineNode ) {
342
339
// Each `<br/>` is followed by a newline, which browsers apparently ignore
343
340
// and our parser doesn't. So don't do anything here.
344
341
return const TextSpan (text: "" );
345
342
} else if (node is StrongNode ) {
346
- return styled (node.nodes, const TextStyle (fontWeight : FontWeight .w600) );
343
+ return _buildStrong (node);
347
344
} else if (node is EmphasisNode ) {
348
- return styled (node.nodes, const TextStyle (fontStyle: FontStyle .italic));
345
+ return _buildEmphasis (node);
346
+ } else if (node is LinkNode ) {
347
+ return _buildLink (node);
349
348
} else if (node is InlineCodeNode ) {
350
349
return _buildInlineCode (node);
351
- } else if (node is LinkNode ) {
352
- // TODO make link touchable
353
- return styled (node.nodes,
354
- TextStyle (color: const HSLColor .fromAHSL (1 , 200 , 1 , 0.4 ).toColor ()));
355
350
} else if (node is UserMentionNode ) {
356
351
return WidgetSpan (alignment: PlaceholderAlignment .middle,
357
352
child: UserMention (node: node));
@@ -369,6 +364,18 @@ class _InlineContentBuilder {
369
364
}
370
365
}
371
366
367
+ InlineSpan _buildStrong (StrongNode node) => _buildNodes (node.nodes,
368
+ style: const TextStyle (fontWeight: FontWeight .w600));
369
+
370
+ InlineSpan _buildEmphasis (EmphasisNode node) => _buildNodes (node.nodes,
371
+ style: const TextStyle (fontStyle: FontStyle .italic));
372
+
373
+ InlineSpan _buildLink (LinkNode node) {
374
+ // TODO make link touchable
375
+ return _buildNodes (node.nodes,
376
+ style: TextStyle (color: const HSLColor .fromAHSL (1 , 200 , 1 , 0.4 ).toColor ()));
377
+ }
378
+
372
379
InlineSpan _buildInlineCode (InlineCodeNode node) {
373
380
// TODO `code` elements: border, padding -- seems hard
374
381
//
0 commit comments