Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Objective-c Highlight failing #455

Closed
RuiAAPeres opened this issue Apr 17, 2014 · 1 comment
Closed

Objective-c Highlight failing #455

RuiAAPeres opened this issue Apr 17, 2014 · 1 comment
Labels

Comments

@RuiAAPeres
Copy link

On my page here Highlight.js is able to correctly put the highlight for one snippet, but not for the other. The failing snippet:

- (NSURLSessionDataTask *)uploadTaskWithRequest:(NSURLRequest *)request progress:(NSProgress * __autoreleasing *)progress
{
    AFURLSessionManager *manager = [[AFURLSessionManager alloc] initWithSessionConfiguration:[NSURLSessionConfiguration defaultSessionConfiguration]];

    __weak typeof(self) weakSelf = self;

    NSURLSessionUploadTask *uploadTask = [manager uploadTaskWithStreamedRequest:request progress:progress completionHandler:^(NSURLResponse *response, id responseObject, NSError *error) {
        if (error)
        {
            weakSelf.isFailed = YES;
        } else
        {
            weakSelf.isFinished = YES;
        }
    }];
    return uploadTask;
}

The one that works:

- (instancetype)initWithRequest:(NSURLRequest *)request progress:(NSProgress * __autoreleasing *)progress
{
    NSAssert(request, @"Request should be not nil");
    if(self = [super init])
    {
        self.uploadTask = [self uploadTaskWithRequest:request progress:progress];
        [self setDefaultKVOValues];
    }    
    return self;
}
@Sannis Sannis added the bug label Jun 12, 2014
@sourrust
Copy link
Member

The first snippet is autodetecting as objective-c now in master. This will fix will most likely be in the next release.

Thank for reporting this bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants