Now that NSAttributedString is fully supported in iOS 6, is there a library that will take an NSString with markdown, and convert it to NSAttributedString?
I've just added an NSString
to NSAttributedString
lightweight markup parser to MGBoxKit. It's not Markdown but it's very similar. So far it supports bold, italics, underline, monospacing, text colour, background colour, and kerning.
The MGMushParser class is now a standalone pod, so can easily be used independent of MGBoxKit.
NSString *markup = @"**bold**, //italics//, __underlining__, `monospacing`, and {#0000FF|text colour}";
UIFont *baseFont = [UIFont fontWithName:@"HelveticaNeue" size:18];
UIColor *textColor = UIColor.whiteColor;
myLabel.attributedString = [MGMushParser attributedStringFromMush:markup
font:baseFont color:textColor];
I just open-sourced a project that takes raw markdown and converts it into an NSAttributedString:
https://github.com/dreamwieber/AttributedMarkdown
It's a work-in-progress and includes a demo application which shows how to assign attributes to the various markdown elements.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With