mgm

MGMushParser

Create NSAttributedStrings from NSStrings with lightweight Mush markup

Showing:

Popularity

Downloads/wk

0

GitHub Stars

64

Maintenance

Last Commit

3yrs ago

Contributors

3

Package

Dependencies

0

License

BSD

Categories

Readme

MGMushParser

Create an NSAttributedString from an NSString with lightweight Mush markup.

  • Bold is achieved with double asterisks
  • Italics are achieved with //double slashes//
  • Underlining is achieved with double underscores
  • Monospacing is achieved with single backticks
  • Strikethrough is achieved with ~double tildes~
  • Coloured text is achieved with {#123456|the coloured text}
  • Set text background colour with {bg#123456|the text}
  • Adjust kerning with {k4.5|the more widely spaced text}
  • Change font with {font:HelveticaNeue,12pt|text in a different font}

CocoaPods Setup

pod 'MGMushParser'

Example

NSString *mush = @"this string has **bold**, //italics//, and {#ff0000|red text}";
NSAttributedString *result = [MGMushParser attributedStringFromMush:mush
font:[UIFont fontWithName:@"Helvetica" size:14] color:UIColor.blackColor];

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100