Skip to content

Commit

Permalink
Replace NSPredicate with XPath.
Browse files Browse the repository at this point in the history
  • Loading branch information
grp committed Jan 16, 2013
1 parent a07b78e commit 8007625
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions Classes/HNKit/HNAPIRequestParser.m
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,8 @@ - (HNPageLayoutType)pageLayoutTypeForDocument:(XMLDocument *)document {
if ([[td children] count] == 0) {
return kHNPageLayoutTypeExposed;
} else {
NSArray *tables = [[td children] filteredArrayUsingPredicate:[NSPredicate predicateWithBlock:^BOOL(XMLElement *object, NSDictionary *bindings) {
return [[object tagName] isEqualToString:@"table"];
}]];

NSArray *linebreaks = [[td children] filteredArrayUsingPredicate:[NSPredicate predicateWithBlock:^BOOL(XMLElement *object, NSDictionary *bindings) {
return [[object tagName] isEqualToString:@"br"];
}]];
NSArray *tables = [td elementsMatchingPath:@"table"];
NSArray *linebreaks = [td elementsMatchingPath:@"br"];

// XXX: This is horrible hack.
// This is because when there is only a header, make sure
Expand Down

0 comments on commit 8007625

Please sign in to comment.