flutter_html icon indicating copy to clipboard operation
flutter_html copied to clipboard

Fix text wrapping of links

Open Sub6Resources opened this issue 9 months ago • 0 comments

In my case it is causing a overflow issue when links are in table cell:

Image

I´m not using any widget for test and yet it extends the link itself inside the table cell:

final List<HtmlExtension> htmlExtensions = [
    const TableHtmlExtension(),

    TagWrapExtension(
      tagsToWrap: {'a'},
      builder: (child) {
        return child;
      },
    ),
  ];

Here is how it should be displayed:

Image

I just need this TagWrapExtension, because mouse icon doesn´t change to pointer

In my html render I´m using the following code:

Html(
  data: widget.legislativeDescription,
  style: widget.htmlStyle,
  extensions: widget.htmlExtensions,
  onLinkTap: (url, _, __) async {
    if (url != null && await canLaunchUrl(Uri.parse(url))) {
      await launchUrl(Uri.parse(url), mode: LaunchMode.externalApplication);
    }
  },
),

Originally posted by @FoxHere in https://github.com/Sub6Resources/flutter_html/issues/1454#issuecomment-2761447425

Sub6Resources avatar Mar 29 '25 14:03 Sub6Resources