- (NSString *)htmlToString:(NSString *)htmlString {
NSDictionary *options = @{ NSDocumentTypeDocumentAttribute :NSHTMLTextDocumentType,
NSCharacterEncodingDocumentAttribute :@(NSUTF8StringEncoding) };
NSData *data = [htmlString dataUsingEncoding:NSUTF8StringEncoding];
NSAttributedString *string = [[NSAttributedString alloc] initWithData:data options:options documentAttributes:nil error:nil];
return string.string;
}
网友评论