请指教一下如何导出JavaScript的样式内容
Closed this issue · 1 comments
yaodecai commented
bugaio commented
代码 里是使用 原生的 方法, 将 attr -> html
那么, 你可以 这样试一试
NSMutableArray *exclude = [NSMutableArray array];
[exclude addObjectsFromArray:[NSArray arrayWithObjects:@"APPLET", @"BASEFONT", @"CENTER", @"DIR", @"FONT", @"ISINDEX", @"MENU", @"S", @"STRIKE", @"U",@"XML", nil]];
[exclude addObjectsFromArray:[NSArray arrayWithObjects:@"doctype", @"html", @"head", @"body", nil]];
NSDictionary *htmlAtt = [NSDictionary dictionaryWithObjectsAndKeys:
NSHTMLTextDocumentType, NSDocumentTypeDocumentAttribute,
exclude, @"ExcludedElements", nil];
NSData *htmlData = [self dataFromRange:NSMakeRange(0, self.length) documentAttributes:htmlAtt error:nil];