diff --git a/CHANGELOG.md b/CHANGELOG.md index 69a3c0c..c6a33cb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file. --- +## [2.1.2](https://github.com/laptobbe/TSMarkdownParser/releases/tag/2.1.2) (2016/12/11) +Released on 2016/12/11. + +#### Fixed +* Fixed Unicode links autodetection [#61](https://github.com/laptobbe/TSMarkdownParser/pull/61) + + ## [2.1.1](https://github.com/laptobbe/TSMarkdownParser/releases/tag/2.1.1) (2016/06/04) Released on 2016/06/04. All issues associated with this milestone can be found using this [filter](https://github.com/laptobbe/TSMarkdownParser/issues?q=milestone%3A2.1.1+is%3Aclosed). diff --git a/TSMarkdownParser.podspec b/TSMarkdownParser.podspec index 691f626..6cdb986 100644 --- a/TSMarkdownParser.podspec +++ b/TSMarkdownParser.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "TSMarkdownParser" - s.version = "2.1.1" + s.version = "2.1.2" s.summary = "A markdown to NSAttributedString parser for iOS and OSX" s.description = <<-DESC diff --git a/TSMarkdownParserTests/TSMarkdownParserTests.m b/TSMarkdownParserTests/TSMarkdownParserTests.m index 8f07b58..0aa538e 100644 --- a/TSMarkdownParserTests/TSMarkdownParserTests.m +++ b/TSMarkdownParserTests/TSMarkdownParserTests.m @@ -300,6 +300,16 @@ - (void)testStandardAutoLinkParsing { XCTAssertEqualObjects(linkColor, [UIColor blueColor]); } +- (void)testStandardUnicodeAutoLinkParsing { + NSAttributedString *attributedString = [self.standardParser attributedStringFromMarkdown:@"Hello\n This is a link http://槍ヶ岳山荘.jp to test Wi-Fi\nat home"]; + NSURL *link = [attributedString attribute:NSLinkAttributeName atIndex:24 effectiveRange:NULL]; + XCTAssertEqualObjects(link, [NSURL URLWithString:[@"http://槍ヶ岳山荘.jp" stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]); + NSNumber *underline = [attributedString attribute:NSUnderlineStyleAttributeName atIndex:24 effectiveRange:NULL]; + XCTAssertEqualObjects(underline, @(NSUnderlineStyleSingle)); + UIColor *linkColor = [attributedString attribute:NSForegroundColorAttributeName atIndex:24 effectiveRange:NULL]; + XCTAssertEqualObjects(linkColor, [UIColor blueColor]); +} + - (void)testStandardLinkParsingOnEndOfStrings { NSAttributedString *attributedString = [self.standardParser attributedStringFromMarkdown:@"Hello\n This is a [link](https://www.example.net/)"]; NSURL *link = [attributedString attribute:NSLinkAttributeName atIndex:20 effectiveRange:NULL];