Skip to content

Commit e3133c6

Browse files
committed
fix: rebase with latest main
1 parent 2912abe commit e3133c6

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

ios/styles/ColorStyle.mm

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ - (instancetype)initWithInput:(id)input {
2020
- (void)applyStyle:(NSRange)range {
2121
}
2222

23+
+ (BOOL)isParagraphStyle { return NO; }
24+
2325
- (void)applyStyle:(NSRange)range color:(UIColor *)color {
2426
BOOL isStylePresent = [self detectStyle:range color:color];
2527

@@ -136,6 +138,12 @@ -(BOOL)isInStyle:(NSRange) range styleType:(StyleType)styleType {
136138
: [style detectStyle:range]);
137139
}
138140

141+
- (BOOL)isInCodeBlockAndHasTheSameColor:(id)value :(NSRange)range {
142+
BOOL isInCodeBlock = [self isInStyle:range styleType: CodeBlock];
143+
144+
return isInCodeBlock && [(UIColor *)value isEqualToColor:[_input->config codeBlockFgColor]];
145+
}
146+
139147
- (BOOL)inLinkAndForegroundColorIsLinkColor:(id)value :(NSRange)range {
140148
BOOL isInLink = [self isInStyle:range styleType: Link];
141149

@@ -176,6 +184,7 @@ - (BOOL)styleCondition:(id)value :(NSRange)range {
176184
if ([self inLinkAndForegroundColorIsLinkColor:value :range]) { return NO; }
177185
if ([self inInlineCodeAndHasTheSameColor:value :range]) { return NO; }
178186
if ([self inMentionAndHasTheSameColor:value :range]) { return NO; }
187+
if ([self isInCodeBlockAndHasTheSameColor:value :range]) { return NO; }
179188

180189
return YES;
181190
}

0 commit comments

Comments
 (0)