From de30cf7bfaf50ba89fcb22b36b0bcc16f7d75ff9 Mon Sep 17 00:00:00 2001 From: Cokile Date: Fri, 22 Apr 2016 08:42:50 +0800 Subject: [PATCH 1/3] Fix an issue for quote 1. Parser now can parse multiple paragraph correctly. 2. Change the style of quote so it is easy to distinguish from common text --- TSMarkdownParser/TSMarkdownParser.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TSMarkdownParser/TSMarkdownParser.m b/TSMarkdownParser/TSMarkdownParser.m index eb127d7..51160ee 100644 --- a/TSMarkdownParser/TSMarkdownParser.m +++ b/TSMarkdownParser/TSMarkdownParser.m @@ -32,7 +32,7 @@ - (instancetype)init { @{ NSFontAttributeName: [UIFont boldSystemFontOfSize:15] }, @{ NSFontAttributeName: [UIFont boldSystemFontOfSize:13] } ]; _listAttributes = @[]; - _quoteAttributes = @[]; + _quoteAttributes = @[@{NSFontAttributeName: [UIFont fontWithName:@"Georgia-Italic" size:12]}]; _imageAttributes = @{}; _linkAttributes = @{ NSForegroundColorAttributeName: [UIColor blueColor], @@ -146,7 +146,7 @@ + (void)addAttributes:(NSArray *> *)attributesArray static NSString *const TSMarkdownShortHeaderRegex = @"^(#{1,%@})\\s*([^#].*)$"; static NSString *const TSMarkdownListRegex = @"^([\\*\\+\\-]{1,%@})\\s+(.+)$"; static NSString *const TSMarkdownShortListRegex = @"^([\\*\\+\\-]{1,%@})\\s*([^\\*\\+\\-].*)$"; -static NSString *const TSMarkdownQuoteRegex = @"^(\\>{1,%@})\\s+(.+)$"; +static NSString *const TSMarkdownQuoteRegex = @"^(\\>{1,%@})(.+)$"; static NSString *const TSMarkdownShortQuoteRegex = @"^(\\>{1,%@})\\s*([^\\>].*)$"; // inline bracket regex From 16d8748d57d5e7858e14347b73a17cc4dc837b1e Mon Sep 17 00:00:00 2001 From: Cokile Date: Mon, 25 Apr 2016 14:59:50 +0800 Subject: [PATCH 2/3] Revert "Fix an issue for quote" This reverts commit de30cf7bfaf50ba89fcb22b36b0bcc16f7d75ff9. --- TSMarkdownParser/TSMarkdownParser.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TSMarkdownParser/TSMarkdownParser.m b/TSMarkdownParser/TSMarkdownParser.m index 51160ee..eb127d7 100644 --- a/TSMarkdownParser/TSMarkdownParser.m +++ b/TSMarkdownParser/TSMarkdownParser.m @@ -32,7 +32,7 @@ - (instancetype)init { @{ NSFontAttributeName: [UIFont boldSystemFontOfSize:15] }, @{ NSFontAttributeName: [UIFont boldSystemFontOfSize:13] } ]; _listAttributes = @[]; - _quoteAttributes = @[@{NSFontAttributeName: [UIFont fontWithName:@"Georgia-Italic" size:12]}]; + _quoteAttributes = @[]; _imageAttributes = @{}; _linkAttributes = @{ NSForegroundColorAttributeName: [UIColor blueColor], @@ -146,7 +146,7 @@ + (void)addAttributes:(NSArray *> *)attributesArray static NSString *const TSMarkdownShortHeaderRegex = @"^(#{1,%@})\\s*([^#].*)$"; static NSString *const TSMarkdownListRegex = @"^([\\*\\+\\-]{1,%@})\\s+(.+)$"; static NSString *const TSMarkdownShortListRegex = @"^([\\*\\+\\-]{1,%@})\\s*([^\\*\\+\\-].*)$"; -static NSString *const TSMarkdownQuoteRegex = @"^(\\>{1,%@})(.+)$"; +static NSString *const TSMarkdownQuoteRegex = @"^(\\>{1,%@})\\s+(.+)$"; static NSString *const TSMarkdownShortQuoteRegex = @"^(\\>{1,%@})\\s*([^\\>].*)$"; // inline bracket regex From f8cabbfe3246d8cf2df4c5413e173a3bd46e0826 Mon Sep 17 00:00:00 2001 From: Cokile Date: Mon, 25 Apr 2016 15:04:43 +0800 Subject: [PATCH 3/3] Change the quote style --- TSMarkdownParser/TSMarkdownParser.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TSMarkdownParser/TSMarkdownParser.m b/TSMarkdownParser/TSMarkdownParser.m index eb127d7..d6a91df 100644 --- a/TSMarkdownParser/TSMarkdownParser.m +++ b/TSMarkdownParser/TSMarkdownParser.m @@ -32,7 +32,7 @@ - (instancetype)init { @{ NSFontAttributeName: [UIFont boldSystemFontOfSize:15] }, @{ NSFontAttributeName: [UIFont boldSystemFontOfSize:13] } ]; _listAttributes = @[]; - _quoteAttributes = @[]; + _quoteAttributes = @[@{NSFontAttributeName: [UIFont fontWithName:@"Georgia-Italic" size:12]}]; _imageAttributes = @{}; _linkAttributes = @{ NSForegroundColorAttributeName: [UIColor blueColor],