Skip to content

Commit

Permalink
fix: tg-forward
Browse files Browse the repository at this point in the history
replace tg-forward block to ''

Log:
  • Loading branch information
Decodetalkers committed Sep 16, 2023
1 parent ce1f52d commit 8277d4c
Showing 1 changed file with 29 additions and 10 deletions.
39 changes: 29 additions & 10 deletions lib/pages/chat/events/html_message.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,36 @@ class HtmlMessage extends StatelessWidget {
// We do *not* do this in an AST and just with simple regex here, as riot-web tends to create
// miss-matching tags, and this way we actually correctly identify what we want to strip and, well,
// strip it.
final renderHtml = html.replaceAll(
RegExp(
'<mx-reply>.*</mx-reply>',
caseSensitive: false,
multiLine: false,
dotAll: true,
),
'',
);
final renderHtml = html
.replaceAll(
RegExp(
'<mx-reply>.*</mx-reply>',
caseSensitive: false,
multiLine: false,
dotAll: true,
),
'',
)
.replaceAll(
RegExp(
'<tg-forward>',
caseSensitive: false,
multiLine: false,
dotAll: true,
),
'',
)
.replaceAll(
RegExp(
'</tg-forward>',
caseSensitive: false,
multiLine: false,
dotAll: true,
),
'',
);

final fontSize = AppConfig.messageFontSize * AppConfig.fontSizeFactor;

final linkifiedRenderHtml = linkify(
renderHtml,
options: const LinkifyOptions(humanize: false),
Expand All @@ -60,6 +78,7 @@ class HtmlMessage extends StatelessWidget {
return '<a href="${element.url}">${element.text}</a>';
},
).join('');
print("after is $linkifiedRenderHtml");

final linkColor = textColor.withAlpha(150);

Expand Down

0 comments on commit 8277d4c

Please sign in to comment.