MM-19734 Patch RN to remove the placeholder for emojis in a markdown paragraph (#3485)

This commit is contained in:
Mattermost Build 2019-10-28 21:57:59 +01:00 committed by Miguel Alatzar
parent 50484c10dd
commit fb09116855

View 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];
}
];