Skip to content

Commit 3f89d81

Browse files
committed
Finish merging changes
1 parent 724c45f commit 3f89d81

File tree

2 files changed

+6
-15
lines changed

2 files changed

+6
-15
lines changed

lib/html_parser.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ class HtmlParser extends StatelessWidget {
352352
);
353353
} else {
354354
return WidgetSpan(
355-
child: tree.toWidget(context),
355+
child: tree.toWidget(context, childSpan: childSpan),
356356
);
357357
}
358358
}).toList() ??

lib/src/interactable_element.dart

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ abstract class InteractableElement extends StyledElement {
1717
dom.Node node,
1818
}) : super(name: name, children: children, style: style, node: node);
1919

20-
Widget toWidget(RenderContext context);
20+
Widget toWidget(RenderContext context, {InlineSpan childSpan});
2121
}
2222

2323
/// A [Gesture] indicates the type of interaction by a user.
@@ -38,7 +38,7 @@ class LinkedContentElement extends InteractableElement {
3838
}) : super(name: name, node: node, children: children);
3939

4040
@override
41-
Widget toWidget(RenderContext context) {
41+
Widget toWidget(RenderContext context, {InlineSpan childSpan}) {
4242
return RawGestureDetector(
4343
gestures: {
4444
MultipleTapGestureRecognizer: GestureRecognizerFactoryWithHandlers<
@@ -49,16 +49,7 @@ class LinkedContentElement extends InteractableElement {
4949
},
5050
),
5151
},
52-
child: StyledText(
53-
textSpan: TextSpan(
54-
style: style.generateTextStyle(),
55-
children: children
56-
.map((tree) => context.parser.parseTree(context, tree))
57-
.toList() ??
58-
[],
59-
),
60-
style: style,
61-
),
52+
child: (childSpan as WidgetSpan).child,
6253
);
6354
}
6455
}
@@ -74,7 +65,7 @@ class DetailsContentElement extends InteractableElement {
7465
}) : super(name: name, node: node, children: children);
7566

7667
@override
77-
Widget toWidget(RenderContext context) {
68+
Widget toWidget(RenderContext context, {InlineSpan childSpan}) {
7869
return ExpansionTile(
7970
title: title.first.localName == "summary" ? StyledText(
8071
textSpan: TextSpan(
@@ -107,7 +98,7 @@ class EmptyInteractableElement extends InteractableElement {
10798
EmptyInteractableElement({String name = "empty"}) : super(name: name);
10899

109100
@override
110-
Widget toWidget(_) => null;
101+
Widget toWidget(_, {InlineSpan childSpan}) => null;
111102
}
112103

113104
InteractableElement parseInteractableElement(

0 commit comments

Comments
 (0)