prepareMsg function
- dynamic content
Implementation
String prepareMsg(MsgContent? content) {
if (content == null) return '';
final formatted = content.formattedBody();
if (formatted != null) {
return formatted;
}
final body = content.body();
// replace all matrix-style links with a hrefs
return body.replaceAllMapped(
matrixLinks,
(match) => '<a href="${match.group(0)}">${match.group(0)}</a>',
);
}