MM-19734 Patch RN to remove the placeholder for emojis in a markdown paragraph (#3485)
This commit is contained in:
parent
50484c10dd
commit
fb09116855
1 changed files with 25 additions and 0 deletions
25
patches/react-native+0.59.9.patch
Normal file
25
patches/react-native+0.59.9.patch
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
diff --git a/node_modules/react-native/Libraries/Text/Text/RCTTextShadowView.m b/node_modules/react-native/Libraries/Text/Text/RCTTextShadowView.m
|
||||
index d464e6a..6c397c5 100644
|
||||
--- a/node_modules/react-native/Libraries/Text/Text/RCTTextShadowView.m
|
||||
+++ b/node_modules/react-native/Libraries/Text/Text/RCTTextShadowView.m
|
||||
@@ -170,6 +170,12 @@ - (void)postprocessAttributedText:(NSMutableAttributedString *)attributedText
|
||||
|
||||
- (NSAttributedString *)attributedTextWithMeasuredAttachmentsThatFitSize:(CGSize)size
|
||||
{
|
||||
+ static UIImage *placeholderImage;
|
||||
+ static dispatch_once_t onceToken;
|
||||
+ dispatch_once(&onceToken, ^{
|
||||
+ placeholderImage = [UIImage new];
|
||||
+ });
|
||||
+
|
||||
NSMutableAttributedString *attributedText =
|
||||
[[NSMutableAttributedString alloc] initWithAttributedString:[self attributedTextWithBaseTextAttributes:nil]];
|
||||
|
||||
@@ -188,6 +194,7 @@ - (NSAttributedString *)attributedTextWithMeasuredAttachmentsThatFitSize:(CGSize
|
||||
maximumSize:size];
|
||||
NSTextAttachment *attachment = [NSTextAttachment new];
|
||||
attachment.bounds = (CGRect){CGPointZero, fittingSize};
|
||||
+ attachment.image = placeholderImage;
|
||||
[attributedText addAttribute:NSAttachmentAttributeName value:attachment range:range];
|
||||
}
|
||||
];
|
||||
Loading…
Reference in a new issue