File tree Expand file tree Collapse file tree 3 files changed +17
-3
lines changed Expand file tree Collapse file tree 3 files changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,14 @@ - (BOOL)markdown_textOf:(NSAttributedString *)newText equals:(NSAttributedString
2727{
2828 RCTMarkdownUtils *markdownUtils = [self getMarkdownUtils ];
2929 if (markdownUtils != nil ) {
30- return [newText isEqualToAttributedString: oldText];
30+ // Emoji characters are automatically assigned an AppleColorEmoji NSFont and the original font is moved to NSOriginalFont
31+ // We need to remove these attributes before comparison
32+ NSMutableAttributedString *newTextCopy = [newText mutableCopy ];
33+ NSMutableAttributedString *oldTextCopy = [oldText mutableCopy ];
34+ [newTextCopy removeAttribute: @" NSFont" range: NSMakeRange (0 , newTextCopy.length)];
35+ [oldTextCopy removeAttribute: @" NSFont" range: NSMakeRange (0 , oldTextCopy.length)];
36+ [oldTextCopy removeAttribute: @" NSOriginalFont" range: NSMakeRange (0 , oldTextCopy.length)];
37+ return [newTextCopy isEqualToAttributedString: oldTextCopy];
3138 }
3239
3340 return [self markdown_textOf: newText equals: oldText];
Original file line number Diff line number Diff line change @@ -51,7 +51,14 @@ - (BOOL)markdown__textOf:(NSAttributedString *)newText equals:(NSAttributedStrin
5151{
5252 RCTMarkdownUtils *markdownUtils = [self getMarkdownUtils ];
5353 if (markdownUtils != nil ) {
54- return [newText isEqualToAttributedString: oldText];
54+ // Emoji characters are automatically assigned an AppleColorEmoji NSFont and the original font is moved to NSOriginalFont
55+ // We need to remove these attributes before comparison
56+ NSMutableAttributedString *newTextCopy = [newText mutableCopy ];
57+ NSMutableAttributedString *oldTextCopy = [oldText mutableCopy ];
58+ [newTextCopy removeAttribute: @" NSFont" range: NSMakeRange (0 , newTextCopy.length)];
59+ [oldTextCopy removeAttribute: @" NSFont" range: NSMakeRange (0 , oldTextCopy.length)];
60+ [oldTextCopy removeAttribute: @" NSOriginalFont" range: NSMakeRange (0 , oldTextCopy.length)];
61+ return [newTextCopy isEqualToAttributedString: oldTextCopy];
5562 }
5663
5764 return [self markdown__textOf: newText equals: oldText];
Original file line number Diff line number Diff line change 11{
22 "name" : " @expensify/react-native-live-markdown" ,
3- "version" : " 0.1.105 " ,
3+ "version" : " 0.1.107 " ,
44 "description" : " Drop-in replacement for React Native's TextInput component with Markdown formatting." ,
55 "main" : " lib/commonjs/index" ,
66 "module" : " lib/module/index" ,
You can’t perform that action at this time.
0 commit comments