chore: Add tooltip to links in html

pull/1595/head
Krille 5 months ago
parent eecf206eb8
commit 4072e99696
No known key found for this signature in database
GPG Key ID: E067ECD60F1A0652

@ -182,11 +182,11 @@ class HtmlMessage extends StatelessWidget {
} }
} }
return WidgetSpan( return WidgetSpan(
child: Tooltip(
message: href,
child: InkWell( child: InkWell(
splashColor: Colors.transparent, splashColor: Colors.transparent,
onTap: () => onTap: () => UrlLauncher(context, href, node.text).launchUrl(),
UrlLauncher(context, node.attributes['href'], node.text)
.launchUrl(),
child: Text.rich( child: Text.rich(
TextSpan( TextSpan(
children: _renderWithLineBreaks( children: _renderWithLineBreaks(
@ -199,6 +199,7 @@ class HtmlMessage extends StatelessWidget {
style: const TextStyle(height: 1.25), style: const TextStyle(height: 1.25),
), ),
), ),
),
); );
case 'li': case 'li':
if (!{'ol', 'ul'}.contains(node.parent?.localName)) { if (!{'ol', 'ul'}.contains(node.parent?.localName)) {

Loading…
Cancel
Save