From 5262395340cd92f7b136ea0868fe61cb022d3b3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Ku=C3=9Fowski?= Date: Wed, 19 Nov 2025 10:37:42 +0100 Subject: [PATCH] chore: follow up Simplify codeblock code --- lib/pages/chat/events/html_message.dart | 30 +++++++++---------------- 1 file changed, 11 insertions(+), 19 deletions(-) diff --git a/lib/pages/chat/events/html_message.dart b/lib/pages/chat/events/html_message.dart index 50001ad38..a023e412d 100644 --- a/lib/pages/chat/events/html_message.dart +++ b/lib/pages/chat/events/html_message.dart @@ -369,28 +369,20 @@ class HtmlMessage extends StatelessWidget { side: const BorderSide(color: hightlightTextColor), borderRadius: BorderRadius.circular(4), ), - child: isInline - ? Padding( - padding: const EdgeInsets.symmetric(horizontal: 4.0), - child: Text.rich( - TextSpan( - children: [_renderCodeBlockNode(element)], - ), - selectionColor: hightlightTextColor.withAlpha(128), - ), - ) - : Padding( - padding: const EdgeInsets.symmetric( + child: Padding( + padding: isInline + ? const EdgeInsets.symmetric(horizontal: 4.0) + : const EdgeInsets.symmetric( horizontal: 8.0, vertical: 4.0, ), - child: Text.rich( - TextSpan( - children: [_renderCodeBlockNode(element)], - ), - selectionColor: hightlightTextColor.withAlpha(212), - ), - ), + child: Text.rich( + TextSpan( + children: [_renderCodeBlockNode(element)], + ), + selectionColor: hightlightTextColor.withAlpha(128), + ), + ), ), ); case 'img':