From 61fe10aeeca440a3a66db5cc0b261b67b6b27ff2 Mon Sep 17 00:00:00 2001 From: Chris Bobbe Date: Thu, 6 Jun 2024 16:47:40 -0400 Subject: [PATCH] content [nfc]: Reassert normal font weight for plain code-block text I *think* it's not possible for a code block to appear in a bold context. In particular I haven't found a way to put one inside a spoiler header. Anyway, just in case it does end up being possible somehow, might as well clobber the bold with normal weight, to make sure the code block's bold spans remain distinct from non-bold spans. It's convenient (and cheap) to that here in the CodeBlockTextStyles constructor. --- lib/widgets/code_block.dart | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/widgets/code_block.dart b/lib/widgets/code_block.dart index 33fed151f7..feab75a9db 100644 --- a/lib/widgets/code_block.dart +++ b/lib/widgets/code_block.dart @@ -15,7 +15,8 @@ class CodeBlockTextStyles { plain: kMonospaceTextStyle .merge(const TextStyle( fontSize: 0.825 * kBaseFontSize, - height: 1.4)), + height: 1.4)) + .merge(weightVariableTextStyle(context)), // .hll { background-color: hsl(60deg 100% 90%); } hll: TextStyle(backgroundColor: const HSLColor.fromAHSL(1, 60, 1, 0.90).toColor()),