Permalink
Browse files

Fixed discussion handling - broke as part of 3f0d4c7. Fixes #272.

  • Loading branch information...
1 parent a60e74b commit 3d23114453956cfdfde09eafaa09448bad01bf11 @tomaz committed Nov 5, 2012
Showing with 6 additions and 5 deletions.
  1. +6 −5 Processing/GBCommentsProcessor.m
@@ -230,10 +230,11 @@ - (void)processCommentBlockInLines:(NSArray *)lines blockRange:(NSRange)blockRan
NSString *blockString = [self stringByCombiningTrimmedLines:blockLines];
if ([blockString length] == 0) return;
- // Process the string and register long description component.
- //GBCommentComponent *component = [self commentComponentByPreprocessingString:blockString withFlags:0];
-
- //[self.currentComment.longDescription registerComponent:component];
+ // Process the string and register long description component. If discussion is already registered (i.e. from @discussion directive), ignore it.
+ if (self.currentComment.longDescription.components.count == 0) {
+ GBCommentComponent *component = [self commentComponentByPreprocessingString:blockString withFlags:0];
+ [self.currentComment.longDescription registerComponent:component];
+ }
}
- (void)registerShortDescriptionFromLines:(NSArray *)lines range:(NSRange)range removePrefix:(NSString *)remove {
@@ -437,7 +438,7 @@ - (BOOL)processAbstractBlockInString:(NSString *)string lines:(NSArray *)lines b
index = [description rangeOfString:@"@discussion"];
if (index.location == NSNotFound) {
- index = [description rangeOfString:@"\s+"];
+ index = [description rangeOfRegex:@"\\s+"];
}
NSRange range;

0 comments on commit 3d23114

Please sign in to comment.