Skip to content

Probably code block bug with trailing ``` #36

@hkalexling

Description

@hkalexling

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions