@@ -97,7 +97,7 @@ class Paragraph extends StatelessWidget {
97
97
// The paragraph has vertical CSS margins, but those have no effect.
98
98
if (node.nodes.isEmpty) return const SizedBox ();
99
99
100
- final text = InlineContent (nodes : node.nodes , style: null );
100
+ final text = _buildBlockInlineContainer (node : node, style: null );
101
101
102
102
// If the paragraph didn't actually have a `p` element in the HTML,
103
103
// then apply no margins. (For example, these are seen in list items.)
@@ -122,9 +122,9 @@ class Heading extends StatelessWidget {
122
122
assert (node.level == HeadingLevel .h6);
123
123
return Padding (
124
124
padding: const EdgeInsets .only (top: 15 , bottom: 5 ),
125
- child: InlineContent (
125
+ child: _buildBlockInlineContainer (
126
126
style: const TextStyle (fontWeight: FontWeight .w600, height: 1.4 ),
127
- nodes : node.nodes ));
127
+ node : node));
128
128
}
129
129
}
130
130
@@ -297,6 +297,36 @@ class _SingleChildScrollViewWithScrollbarState
297
297
// Inline layout.
298
298
//
299
299
300
+ Widget _buildBlockInlineContainer ({
301
+ required TextStyle ? style,
302
+ required BlockInlineContainerNode node,
303
+ }) {
304
+ if (node.links == null ) {
305
+ return InlineContent (style: style, nodes: node.nodes);
306
+ }
307
+ return _BlockInlineContainer (
308
+ links: node.links! , style: style, nodes: node.nodes);
309
+ }
310
+
311
+ class _BlockInlineContainer extends StatefulWidget {
312
+ const _BlockInlineContainer (
313
+ {required this .links, required this .style, required this .nodes});
314
+
315
+ final List <LinkNode > links;
316
+ final TextStyle ? style;
317
+ final List <InlineContentNode > nodes;
318
+
319
+ @override
320
+ State <_BlockInlineContainer > createState () => _BlockInlineContainerState ();
321
+ }
322
+
323
+ class _BlockInlineContainerState extends State <_BlockInlineContainer > {
324
+ @override
325
+ Widget build (BuildContext context) {
326
+ return InlineContent (style: widget.style, nodes: widget.nodes);
327
+ }
328
+ }
329
+
300
330
class InlineContent extends StatelessWidget {
301
331
InlineContent ({
302
332
super .key,
0 commit comments