From c3d8babd43e2a9268ddae02bec05e211a7850517 Mon Sep 17 00:00:00 2001 From: Tomek Zawadzki Date: Mon, 29 Jan 2024 16:35:05 +0100 Subject: [PATCH] Disable bold for syntax (#142) --- .../main/java/com/expensify/livemarkdown/MarkdownUtils.java | 1 - ios/RCTMarkdownUtils.mm | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/android/src/main/java/com/expensify/livemarkdown/MarkdownUtils.java b/android/src/main/java/com/expensify/livemarkdown/MarkdownUtils.java index 3fecc418..0eb3c643 100644 --- a/android/src/main/java/com/expensify/livemarkdown/MarkdownUtils.java +++ b/android/src/main/java/com/expensify/livemarkdown/MarkdownUtils.java @@ -123,7 +123,6 @@ private void applyRange(SpannableStringBuilder ssb, String type, int start, int setSpan(ssb, new MarkdownBackgroundColorSpan(mMarkdownStyle.getMentionUserBackgroundColor()), start, end); break; case "syntax": - setSpan(ssb, new MarkdownBoldSpan(), start, end); setSpan(ssb, new MarkdownForegroundColorSpan(mMarkdownStyle.getSyntaxColor()), start, end); break; case "link": diff --git a/ios/RCTMarkdownUtils.mm b/ios/RCTMarkdownUtils.mm index c8b8408c..ef71cbca 100644 --- a/ios/RCTMarkdownUtils.mm +++ b/ios/RCTMarkdownUtils.mm @@ -64,9 +64,9 @@ - (NSAttributedString *)parseMarkdown:(nullable NSAttributedString *)input NSUInteger length = [item[2] unsignedIntegerValue]; NSRange range = NSMakeRange(location, length); - if ([type isEqualToString:@"bold"] || [type isEqualToString:@"syntax"] || [type isEqualToString:@"italic"] || [type isEqualToString:@"code"] || [type isEqualToString:@"pre"] || [type isEqualToString:@"h1"]) { + if ([type isEqualToString:@"bold"] || [type isEqualToString:@"italic"] || [type isEqualToString:@"code"] || [type isEqualToString:@"pre"] || [type isEqualToString:@"h1"]) { UIFont *font = [attributedString attribute:NSFontAttributeName atIndex:location effectiveRange:NULL]; - if ([type isEqualToString:@"bold"] || [type isEqualToString:@"syntax"]) { + if ([type isEqualToString:@"bold"]) { font = [RCTFont updateFont:font withWeight:@"bold"]; } else if ([type isEqualToString:@"italic"]) { font = [RCTFont updateFont:font withStyle:@"italic"];