Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion lib/widgets/content.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1140,7 +1140,10 @@ class _InlineContentBuilder {
assert(recognizer != null);
_pushRecognizer(recognizer);
final result = _buildNodes(node.nodes,
style: TextStyle(color: ContentTheme.of(_context!).colorLink));
style: TextStyle(
color: ContentTheme.of(_context!).colorLink,
decoration: TextDecoration.underline,
decorationColor: ContentTheme.of(_context!).colorLink));
_popRecognizer();
return result;

Expand Down
10 changes: 10 additions & 0 deletions test/widgets/content_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1426,6 +1426,16 @@ void main() {
.single.equals((url: Uri.parse('file:///etc/bad'), mode: LaunchMode.platformDefault));
checkErrorDialog(tester, expectedTitle: 'Unable to open link');
});

testWidgets('link is underlined', (tester) async {
await prepare(tester, '<p><a href="https://example/">hello</a></p>');

final richText = tester.widget<RichText>(find.text('hello', findRichText: true));
final style = mergeSpanStylesOuterToInner(richText.text,
(span) => span is TextSpan && span.text == 'hello');

check(style!.decoration).equals(TextDecoration.underline);
}, variant: const TargetPlatformVariant({TargetPlatform.android, TargetPlatform.iOS}));
});

group('LinkNode on internal links', () {
Expand Down
Loading