Merge pull request #464 from Decodetalkers/fixcodecannotwrap

fix: code cannot be wrap
pull/465/head
Krille-chan 2 years ago committed by GitHub
commit 2e14e63172
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -49,20 +49,17 @@ class HtmlMessage extends StatelessWidget {
final linkifiedRenderHtml = linkify( final linkifiedRenderHtml = linkify(
renderHtml, renderHtml,
options: const LinkifyOptions(humanize: false), options: const LinkifyOptions(humanize: false),
) ).map(
.map( (element) {
(element) { if (element is! UrlElement ||
if (element is! UrlElement || element.text.contains('<') ||
element.text.contains('<') || element.text.contains('>') ||
element.text.contains('>') || element.text.contains('"')) {
element.text.contains('"')) { return element.text;
return element.text; }
} return '<a href="${element.url}">${element.text}</a>';
return '<a href="${element.url}">${element.text}</a>'; },
}, ).join('');
)
.join('')
.replaceAll('\n', '');
final linkColor = textColor.withAlpha(150); final linkColor = textColor.withAlpha(150);

Loading…
Cancel
Save