Merge pull request #1089 from Adlai-Holler/TextNodeIgnoreEmptyStringReplace

[ASTextNode] Ignore Setting Text to Nil When Text Is Already Empty
This commit is contained in:
appleguy
2016-01-22 11:09:11 -08:00

View File

@@ -336,14 +336,14 @@ static NSArray *DefaultLinkAttributeNames = @[ NSLinkAttributeName ];
- (void)setAttributedString:(NSAttributedString *)attributedString
{
if (ASObjectIsEqual(attributedString, _attributedString)) {
return;
}
if (attributedString == nil) {
attributedString = [[NSAttributedString alloc] initWithString:@"" attributes:nil];
}
if (ASObjectIsEqual(attributedString, _attributedString)) {
return;
}
_attributedString = ASCleanseAttributedStringOfCoreTextAttributes(attributedString);
// Sync the truncation string with attributes from the updated _attributedString