Created
April 20, 2015 21:05
-
-
Save EdSancha/2e58f25b174fa4aa5418 to your computer and use it in GitHub Desktop.
Override html format
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (NSString *)overrideHTMLFormat:(NSString *)htmlText { | |
NSArray *tagsToOverride = @[@"body",@"b", @"a", @"td", @"span", @"p", @"div"]; | |
NSString *header = @"<head><style> "; | |
for (NSString *tag in tagsToOverride) { | |
header = [header stringByAppendingString:tag]; | |
header = [header stringByAppendingString:@" {font-family: HelveticaNeue !important; font-size: 11pt !important; line-height:18pt !important} "]; | |
} | |
header = [header stringByAppendingString:@" </style></head> "]; | |
NSString *htmlString = [NSString stringWithFormat:@"%@ <body>%@</body>", header, htmlText]; | |
return htmlString; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment