File tree Expand file tree Collapse file tree 2 files changed +9
-8
lines changed
Expand file tree Collapse file tree 2 files changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -120,8 +120,8 @@ const htmlData = """
120120 </p>
121121 <h3>Image support:</h3>
122122 <p>
123- <img alt='Google' src='https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_92x30dp.png' />
124- <a href='https://google.com'><img alt='Google' src='https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_92x30dp.png' /></a>
123+ <img alt='Google' src='https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_92x30dp.png' /><br />
124+ <a href='https://google.com'>A linked image: <img alt='Google' src='https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_92x30dp.png' /></a>
125125 <img alt='Alt Text of an intentionally broken image' src='https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_92x30d' />
126126 </p>
127127 <h3>Video support:</h3>
Original file line number Diff line number Diff line change @@ -331,15 +331,15 @@ class HtmlParser extends StatelessWidget {
331331 }
332332 } else if (tree is InteractableElement ) {
333333 return TextSpan (
334- style: newContext.style.generateTextStyle (),
335334 children: tree.children
336335 .map ((tree) => parseTree (newContext, tree))
337336 .map ((childSpan) {
338337 if (childSpan is TextSpan ) {
339338 return TextSpan (
340339 text: childSpan.text,
341340 children: childSpan.children,
342- style: childSpan.style,
341+ style: (childSpan.style ?? TextStyle ())
342+ .merge (newContext.style.generateTextStyle ()),
343343 semanticsLabel: childSpan.semanticsLabel,
344344 recognizer: TapGestureRecognizer ()
345345 ..onTap = () => onLinkTap? .call (tree.href),
@@ -357,10 +357,11 @@ class HtmlParser extends StatelessWidget {
357357 },
358358 ),
359359 },
360- child: StyledText (
361- style: newContext.style,
362- textSpan: childSpan,
363- ),
360+ child: (childSpan as WidgetSpan ).child,
361+ // child: StyledText(
362+ // style: newContext.style.copyWith(textDecoration: null),
363+ // textSpan: childSpan,
364+ // ),
364365 ),
365366 );
366367 }
You can’t perform that action at this time.
0 commit comments