File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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}
You can’t perform that action at this time.
0 commit comments