chore: fix newline rendering in non-HTML formatted messages (#2131)

This commit is contained in:
ggurdin 2025-03-12 12:08:57 -04:00 committed by GitHub
parent 26638c824b
commit 6df46c73a1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -234,6 +234,10 @@ class MessageTextWidget extends StatelessWidget {
}
}
if (tokenPosition.token?.pos == 'SPACE') {
return const TextSpan(text: '\n');
}
if (tokenPosition.token != null) {
// if the tokenPosition is a combination of the token and preceding / following punctuation
// split them so that only the token itself is highlighted when clicked
@ -280,7 +284,10 @@ class MessageTextWidget extends StatelessWidget {
onTap: onClick != null
? () => onClick?.call(tokenPosition)
: null,
child: HiddenText(text: middle, style: style),
child: HiddenText(
text: middle,
style: style,
),
),
)
: LinkifySpan(