From 68d6574880cb46aa83b586abb753ed4737b3ed23 Mon Sep 17 00:00:00 2001 From: szydlovsky <9szydlowski9@gmail.com> Date: Tue, 23 Sep 2025 18:49:35 +0200 Subject: [PATCH] fix: make inline code work properly in bold heaidngs --- ios/styles/InlineCodeStyle.mm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ios/styles/InlineCodeStyle.mm b/ios/styles/InlineCodeStyle.mm index 15d91311b..949f99ccf 100644 --- a/ios/styles/InlineCodeStyle.mm +++ b/ios/styles/InlineCodeStyle.mm @@ -42,7 +42,7 @@ - (void)addAttributes:(NSRange)range { usingBlock:^(id _Nullable value, NSRange range, BOOL * _Nonnull stop) { UIFont *font = (UIFont *)value; if(font != nullptr) { - UIFont *newFont = [[_input->config monospacedFont] withFontTraits:font]; + UIFont *newFont = [[[_input->config monospacedFont] withFontTraits:font] setSize:font.pointSize]; [_input->textView.textStorage addAttribute:NSFontAttributeName value:newFont range:range]; } } @@ -60,7 +60,7 @@ - (void)addTypingAttributes { newTypingAttrs[NSStrikethroughColorAttributeName] = [_input->config inlineCodeFgColor]; UIFont* currentFont = (UIFont *)newTypingAttrs[NSFontAttributeName]; if(currentFont != nullptr) { - newTypingAttrs[NSFontAttributeName] = [[_input->config monospacedFont] withFontTraits:currentFont]; + newTypingAttrs[NSFontAttributeName] = [[[_input->config monospacedFont] withFontTraits:currentFont] setSize:currentFont.pointSize]; } _input->textView.typingAttributes = newTypingAttrs; } @@ -76,7 +76,7 @@ - (void)removeAttributes:(NSRange)range { usingBlock:^(id _Nullable value, NSRange range, BOOL * _Nonnull stop) { UIFont *font = (UIFont *)value; if(font != nullptr) { - UIFont *newFont = [[_input->config primaryFont] withFontTraits:font]; + UIFont *newFont = [[[_input->config primaryFont] withFontTraits:font] setSize:font.pointSize]; [_input->textView.textStorage addAttribute:NSFontAttributeName value:newFont range:range]; } } @@ -93,7 +93,7 @@ - (void)removeTypingAttributes { newTypingAttrs[NSStrikethroughColorAttributeName] = [_input->config primaryColor]; UIFont* currentFont = (UIFont *)newTypingAttrs[NSFontAttributeName]; if(currentFont != nullptr) { - newTypingAttrs[NSFontAttributeName] = [[_input->config primaryFont] withFontTraits:currentFont]; + newTypingAttrs[NSFontAttributeName] = [[[_input->config primaryFont] withFontTraits:currentFont] setSize:currentFont.pointSize]; } _input->textView.typingAttributes = newTypingAttrs; }