Skip to content

[BUG] HTML elements inside <a> tag not rendered with no style as configured #1478

@naory159

Description

@naory159

Describe the bug:
In the last version (3.0.0), HTML elements inside tag rendered with no style as configured.

HTML to reproduce the issue:
<a href="/api/flow.js?q=https%3A%2F%2Fgithub.com%2FSub6Resources%2Fflutter_html%2Fissues%2F%253Ca%2520href%3D"https://flutter.dev/%22%5C%3E%5C" rel="nofollow">https://flutter.dev/"\>\<em>Click here</em> to enter Flutter <i>website</i></a>

Html widget configuration:
Html(
data: widget.data,
onLinkTap: (url, attributes, element) {

},
style: {
'em': Style(
margin: Margins.all(0.0),
lineHeight: LineHeight.percent(50.0),
alignment: Alignment.topRight,
color: ColorManager.green,
),
'i': Style(
color: const Color(0xff888888),
),
'a': Style(
textDecoration: TextDecoration.none,
color: Colors.black,
),
},
extensions: [
const TableHtmlExtension(),
],
)

Expected behavior:
The and tags will rendered as configure in Style

Device details and Flutter/Dart/flutter_html versions:
flutter --version
Flutter 3.29.2 • channel stable • https://github.com/flutter/flutter.git
Framework • revision c236373904 (5 weeks ago) • 2025-03-13 16:17:06 -0400
Engine • revision 18b71d647a
Tools • Dart 3.7.2 • DevTools 2.42.3

Additional info:
In older versions, there was no problem with that (don't know the version).

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions