Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fix empty TOC caused by malformat

  • Loading branch information...
commit e8f73bba9fbc8d021f3f3ef5c3702ef935e7b859 1 parent 578812b
Robin Lu authored
Showing with 9 additions and 1 deletion.
  1. +9 −1 CHMTableOfContent.m
10 CHMTableOfContent.m
View
@@ -150,6 +150,11 @@ - (void)purge
[_children removeObjectsAtIndexes:set];
[set release];
}
+
+-(NSString *)description
+{
+ return [NSString stringWithFormat:@"{\n\tname:%@\n\tpath:%@\n\tchildren:%@\n}", _name, _path, _children];
+}
@end
@interface CHMTableOfContent (Private)
@@ -323,8 +328,11 @@ - (void)push_item
- (void)new_item
{
- curItem = [[LinkItem alloc] init];
+ if ([itemStack count] == 0) {
+ [self push_item];
+ }
LinkItem * parent = [itemStack lastObject];
+ curItem = [[LinkItem alloc] init];
[parent appendChild:curItem];
}
Please sign in to comment.
Something went wrong with that request. Please try again.