Skip to content

Commit 35f61dd

Browse files
committed
updating to 2.1.2
1 parent f4964d7 commit 35f61dd

3 files changed

Lines changed: 18 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file.
44

55
---
66

7+
## [2.1.2](https://github.com/laptobbe/TSMarkdownParser/releases/tag/2.1.2) (2016/12/11)
8+
Released on 2016/12/11.
9+
10+
#### Fixed
11+
* Fixed Unicode links autodetection [#61](https://github.com/laptobbe/TSMarkdownParser/pull/61)
12+
13+
714
## [2.1.1](https://github.com/laptobbe/TSMarkdownParser/releases/tag/2.1.1) (2016/06/04)
815
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).
916

TSMarkdownParser.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = "TSMarkdownParser"
3-
s.version = "2.1.1"
3+
s.version = "2.1.2"
44
s.summary = "A markdown to NSAttributedString parser for iOS and OSX"
55

66
s.description = <<-DESC

TSMarkdownParserTests/TSMarkdownParserTests.m

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,16 @@ - (void)testStandardAutoLinkParsing {
300300
XCTAssertEqualObjects(linkColor, [UIColor blueColor]);
301301
}
302302

303+
- (void)testStandardUnicodeAutoLinkParsing {
304+
NSAttributedString *attributedString = [self.standardParser attributedStringFromMarkdown:@"Hello\n This is a link http://槍ヶ岳山荘.jp to test Wi-Fi\nat home"];
305+
NSURL *link = [attributedString attribute:NSLinkAttributeName atIndex:24 effectiveRange:NULL];
306+
XCTAssertEqualObjects(link, [NSURL URLWithString:[@"http://槍ヶ岳山荘.jp" stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]);
307+
NSNumber *underline = [attributedString attribute:NSUnderlineStyleAttributeName atIndex:24 effectiveRange:NULL];
308+
XCTAssertEqualObjects(underline, @(NSUnderlineStyleSingle));
309+
UIColor *linkColor = [attributedString attribute:NSForegroundColorAttributeName atIndex:24 effectiveRange:NULL];
310+
XCTAssertEqualObjects(linkColor, [UIColor blueColor]);
311+
}
312+
303313
- (void)testStandardLinkParsingOnEndOfStrings {
304314
NSAttributedString *attributedString = [self.standardParser attributedStringFromMarkdown:@"Hello\n This is a [link](https://www.example.net/)"];
305315
NSURL *link = [attributedString attribute:NSLinkAttributeName atIndex:20 effectiveRange:NULL];

0 commit comments

Comments
 (0)