indragiek/CocoaMarkdown

Probably code block bug with trailing ```

hkalexling opened this issue · 0 comments

what I did

NSString *md = @"```c\n//This is a code block\n```";
NSData *data = [md dataUsingEncoding:NSUTF8StringEncoding];
CMDocument *document = [[CMDocument alloc] initWithData:data options:0];
CMAttributedStringRenderer *renderer = [[CMAttributedStringRenderer alloc] initWithDocument:document attributes:[CMTextAttributes new]];
NSAttributedString *attributedString = [renderer render];
NSLog(@"%@", attributedString);

What I expect

//This is a code block{
    NSFont = ...
}

What I got

//This is a code block
```{
    NSFont = ...
}

Note that the trailing ``` is included in the returned NSAttributedString