Merge pull request #464 from Decodetalkers/fixcodecannotwrap
fix: code cannot be wrap
This commit is contained in:
commit
2e14e63172
1 changed files with 11 additions and 14 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue