mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2024-12-25 15:02:33 +01:00
Merge branch 'soru/fix-replies' into 'main'
fix: Reply fallback sometimes being stripped incorrectly See merge request famedly/fluffychat!324
This commit is contained in:
commit
c993909ccf
@ -30,7 +30,10 @@ class HtmlMessage extends StatelessWidget {
|
|||||||
// We do *not* do this in an AST and just with simple regex here, as riot-web tends to create
|
// 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,
|
// miss-matching tags, and this way we actually correctly identify what we want to strip and, well,
|
||||||
// strip it.
|
// strip it.
|
||||||
final renderHtml = html.replaceAll(RegExp('<mx-reply>.*<\/mx-reply>'), '');
|
final renderHtml = html.replaceAll(
|
||||||
|
RegExp('<mx-reply>.*<\/mx-reply>',
|
||||||
|
caseSensitive: false, multiLine: false, dotAll: true),
|
||||||
|
'');
|
||||||
|
|
||||||
// there is no need to pre-validate the html, as we validate it while rendering
|
// there is no need to pre-validate the html, as we validate it while rendering
|
||||||
|
|
||||||
|
@ -95,7 +95,7 @@ class MessageContent extends StatelessWidget {
|
|||||||
if (AppConfig.renderHtml &&
|
if (AppConfig.renderHtml &&
|
||||||
!event.redacted &&
|
!event.redacted &&
|
||||||
event.isRichMessage) {
|
event.isRichMessage) {
|
||||||
String html = event.content['formatted_body'];
|
var html = event.formattedText;
|
||||||
if (event.messageType == MessageTypes.Emote) {
|
if (event.messageType == MessageTypes.Emote) {
|
||||||
html = '* $html';
|
html = '* $html';
|
||||||
}
|
}
|
||||||
|
@ -34,16 +34,18 @@ class ReplyContent extends StatelessWidget {
|
|||||||
if (displayEvent.messageType == MessageTypes.Emote) {
|
if (displayEvent.messageType == MessageTypes.Emote) {
|
||||||
html = '* $html';
|
html = '* $html';
|
||||||
}
|
}
|
||||||
|
final fontSize = DefaultTextStyle.of(context).style.fontSize;
|
||||||
replyBody = HtmlMessage(
|
replyBody = HtmlMessage(
|
||||||
html: html,
|
html: html,
|
||||||
defaultTextStyle: TextStyle(
|
defaultTextStyle: TextStyle(
|
||||||
color: lightText
|
color: lightText
|
||||||
? Colors.white
|
? Colors.white
|
||||||
: Theme.of(context).textTheme.bodyText2.color,
|
: Theme.of(context).textTheme.bodyText2.color,
|
||||||
fontSize: DefaultTextStyle.of(context).style.fontSize,
|
fontSize: fontSize,
|
||||||
),
|
),
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
room: displayEvent.room,
|
room: displayEvent.room,
|
||||||
|
emoteSize: fontSize * 1.5,
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
replyBody = Text(
|
replyBody = Text(
|
||||||
|
Loading…
Reference in New Issue
Block a user