Skip to content

Commit

Permalink
Disable bold for syntax (#142)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomekzaw authored Jan 29, 2024
1 parent 4f9276e commit c3d8bab
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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":
Expand Down
4 changes: 2 additions & 2 deletions ios/RCTMarkdownUtils.mm
Original file line number Diff line number Diff line change
Expand Up @@ -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"];
Expand Down

0 comments on commit c3d8bab

Please sign in to comment.