Skip to content

Commit f0a7901

Browse files
committed
TW-2145: Update condition for mapping formatted_body
1 parent 8435e63 commit f0a7901

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/src/room.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -676,7 +676,7 @@ class Room {
676676
getMention: getMention);
677677
// if the decoded html is the same as the body, there is no need in sending a formatted message
678678
if (HtmlUnescape().convert(html.replaceAll(RegExp(r'<br />\n?'), '\n')) !=
679-
event['body']) {
679+
event['body'].toString().convertLinebreaksToBr()) {
680680
event['format'] = 'org.matrix.custom.html';
681681
event['formatted_body'] = html;
682682
}

lib/src/utils/markdown.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ String markdown(
263263
return ret;
264264
}
265265

266-
extension on String {
266+
extension StringExtension on String {
267267
String convertLinebreaksToBr() {
268268
final parts = split('pre>');
269269
var convertLinebreaks = true;

0 commit comments

Comments
 (0)