Skip to content

1.0 to 2.0 migration

Antoine Cœur edited this page Feb 4, 2016 · 4 revisions

replacing all UIFont and UIColor properties with attributes

You can replace old feature:

parser.paragraphFont = font;

With new one:

parser.defaultAttributes = @{NSFontAttributeName: font};

And same change for other properties.

standardParser now supports character escaping

You can disable it by creating a your own parser without the rule.

standardParser now replaces monospace support with code escaping support

You can use addMonospacedParsingWithFormattingBlock: to create your custom parser with the old rule.

standardParser requires a space for List syntax now

You can't create a list with standardParser using *list, +list or -list anymore. You should create a list with standardParser using * list, + list or - list now. But you can use addShortListParsingWithMaxLevel:1 leadFormattingBlock:... textFormattingBlock:nil to create your custom parser with the old rule.

standardParser now supports multi-level list items

You can use addListParsingWithMaxLevel:1 leadFormattingBlock:... textFormattingBlock:nil to create your custom parser with the old rule.

standardParser now supports multi-level quotes

You can disable it by creating a your own parser without the rule.

standardParser now supports link detection

You can disable it by creating a your own parser without the rule.

standardParser does not support || for strong or | for emphasis anymore

It was a bug. But you can use addParsingRuleWithRegularExpression:withBlock: to create your custom parser with support of || and |, like @"(\\*\\*|__|\\|\\|).+?\\1" for strong and @"(\\*|_|\\|).+?\\1" for emphasis.

standardParser does not support _* or *_ for strong anymore

It was a bug. But you can use addParsingRuleWithRegularExpression:withBlock: to create your custom parser with support for it, like @"(\\*|_){2}.+?(\\*|_){2}" for strong.