From 3ef9854c1d455bd31094b57dff5cc77af2566d07 Mon Sep 17 00:00:00 2001 From: krille-chan Date: Sun, 29 Oct 2023 09:08:57 +0100 Subject: [PATCH] fix: render tg-forward as blockquote style --- lib/pages/chat/events/html_message.dart | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/lib/pages/chat/events/html_message.dart b/lib/pages/chat/events/html_message.dart index 8d8993d5..acf8f3f7 100644 --- a/lib/pages/chat/events/html_message.dart +++ b/lib/pages/chat/events/html_message.dart @@ -63,6 +63,16 @@ class HtmlMessage extends StatelessWidget { final linkColor = textColor.withAlpha(150); + final blockquoteStyle = Style( + border: Border( + left: BorderSide( + width: 3, + color: textColor, + ), + ), + padding: HtmlPaddings.only(left: 6, bottom: 0), + ); + // there is no need to pre-validate the html, as we validate it while rendering return Html( data: linkifiedRenderHtml, @@ -99,15 +109,8 @@ class HtmlMessage extends StatelessWidget { fontSize: FontSize(fontSize), lineHeight: LineHeight.number(1.5), ), - 'blockquote': Style( - border: Border( - left: BorderSide( - width: 3, - color: textColor, - ), - ), - padding: HtmlPaddings.only(left: 6, bottom: 0), - ), + 'blockquote': blockquoteStyle, + 'tg-forward': blockquoteStyle, 'hr': Style( border: Border.all(color: textColor, width: 0.5), ), @@ -191,6 +194,8 @@ class HtmlMessage extends StatelessWidget { 'ruby', 'rp', 'rt', + // Workaround for https://github.com/krille-chan/fluffychat/issues/507 + 'tg-forward', }; }