In iOS 7 we gained the ability to convert an HTML string into an NSAttributedString, like this:
NSString *html = @"<bold>Wow!</bold> Now <em>iOS</em> can create <h3>NSAttributedString</h3> from HTMLs!";
NSDictionary *options = @{NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType};
NSAttributedString *attrString = [[NSAttributedString alloc] initWithData:[html dataUsingEncoding:NSUTF8StringEncoding] options:options documentAttributes:nil error:nil];
We also have the ability to provide default values for HTML that doesn't specify certain attributes using the NSDefaultAttributesDocumentAttribute option.
My question is: is there a way to tell NSAttributedString to ignore certain attributes it sees in the HTML (e.g. color) and instead use one that I provide? In other words, I want to provide an override attribute value, not a default.