{"action":"created","comment":{"url":"https://api.github.com/repos/optonaut/ActiveLabel.swift/pulls/comments/83550970","pull_request_review_id":4388664,"id":83550970,"diff_hunk":"@@ -23,32 +23,37 @@ struct ActiveBuilder {\n         }\n     }\n \n-    static func createURLElements(from text: String, range: NSRange, maximumLenght: Int?) -> ([ElementTuple], String) {\n+    static func createURLElements(from attrString: NSMutableAttributedString, range: NSRange, maximumLenght: Int?) -> [ElementTuple] {\n         let type = ActiveType.url\n-        var text = text\n-        let matches = RegexParser.getElements(from: text, with: type.pattern, range: range)\n-        let nsstring = text as NSString\n+        let originalText = attrString.string\n+        let matches = RegexParser.getElements(from: originalText, with: type.pattern, range: range)\n         var elements: [ElementTuple] = []\n \n         for match in matches where match.range.length > 2 {\n-            let word = nsstring.substring(with: match.range)\n-                .trimmingCharacters(in: CharacterSet.whitespacesAndNewlines)\n+            let word = (originalText as NSString).substring(with: match.range).trimmingCharacters(in: .whitespacesAndNewlines)\n \n             guard let maxLenght = maximumLenght, word.characters.count > maxLenght else {\n-                let range = maximumLenght == nil ? match.range : (text as NSString).range(of: word)\n+                let range = maximumLenght == nil ? match.range : (attrString.string as NSString).range(of: word)","path":"ActiveLabel/ActiveBuilder.swift","position":21,"original_position":21,"commit_id":"fe6c499d7baf98016ade0f32d96e20482c25ba6d","original_commit_id":"fe6c499d7baf98016ade0f32d96e20482c25ba6d","user":{"login":"poolqf","id":7887319,"avatar_url":"https://avatars.githubusercontent.com/u/7887319?v=3","gravatar_id":"","url":"https://api.github.com/users/poolqf","html_url":"https://github.com/poolqf","followers_url":"https://api.github.com/users/poolqf/followers","following_url":"https://api.github.com/users/poolqf/following{/other_user}","gists_url":"https://api.github.com/users/poolqf/gists{/gist_id}","starred_url":"https://api.github.com/users/poolqf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/poolqf/subscriptions","organizations_url":"https://api.github.com/users/poolqf/orgs","repos_url":"https://api.github.com/users/poolqf/repos","events_url":"https://api.github.com/users/poolqf/events{/privacy}","received_events_url":"https://api.github.com/users/poolqf/received_events","type":"User","site_admin":false},"body":"You already have `originalText `","created_at":"2016-10-16T13:00:47Z","updated_at":"2016-10-16T13:03:39Z","html_url":"https://github.com/optonaut/ActiveLabel.swift/pull/122#discussion_r83550970","pull_request_url":"https://api.github.com/repos/optonaut/ActiveLabel.swift/pulls/122","_links":{"self":{"href":"https://api.github.com/repos/optonaut/ActiveLabel.swift/pulls/comments/83550970"},"html":{"href":"https://github.com/optonaut/ActiveLabel.swift/pull/122#discussion_r83550970"},"pull_request":{"href":"https://api.github.com/repos/optonaut/ActiveLabel.swift/pulls/122"}}},"pull_request":{"url":"https://api.github.com/repos/optonaut/ActiveLabel.swift/pulls/122","id":89505594,"html_url":"https://github.com/optonaut/ActiveLabel.swift/pull/122","diff_url":"https://github.com/optonaut/ActiveLabel.swift/pull/122.diff","patch_url":"https://github.com/optonaut/ActiveLabel.swift/pull/122.patch","issue_url":"https://api.github.com/repos/optonaut/ActiveLabel.swift/issues/122","number":122,"state":"open","locked":false,"title":"Added Support for attributedText","user":{"login":"andreaperizzato","id":4716310,"avatar_url":"https://avatars.githubusercontent.com/u/4716310?v=3","gravatar_id":"","url":"https://api.github.com/users/andreaperizzato","html_url":"https://github.com/andreaperizzato","followers_url":"https://api.github.com/users/andreaperizzato/followers","following_url":"https://api.github.com/users/andreaperizzato/following{/other_user}","gists_url":"https://api.github.com/users/andreaperizzato/gists{/gist_id}","starred_url":"https://api.github.com/users/andreaperizzato/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andreaperizzato/subscriptions","organizations_url":"https://api.github.com/users/andreaperizzato/orgs","repos_url":"https://api.github.com/users/andreaperizzato/repos","events_url":"https://api.github.com/users/andreaperizzato/events{/privacy}","received_events_url":"https://api.github.com/users/andreaperizzato/received_events","type":"User","site_admin":false},"body":"- Added support for `NSAttributedString` using `attributedText`. \n- The demo app has now a button switches toggles between a simple and an attributed text","created_at":"2016-10-15T20:29:24Z","updated_at":"2016-10-16T13:03:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e19a7e053028a62371f5f8fee69c3d8ed6621761","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/optonaut/ActiveLabel.swift/pulls/122/commits","review_comments_url":"https://api.github.com/repos/optonaut/ActiveLabel.swift/pulls/122/comments","review_comment_url":"https://api.github.com/repos/optonaut/ActiveLabel.swift/pulls/comments{/number}","comments_url":"https://api.github.com/repos/optonaut/ActiveLabel.swift/issues/122/comments","statuses_url":"https://api.github.com/repos/optonaut/ActiveLabel.swift/statuses/fe6c499d7baf98016ade0f32d96e20482c25ba6d","head":{"label":"andreaperizzato:attributed-text","ref":"attributed-text","sha":"fe6c499d7baf98016ade0f32d96e20482c25ba6d","user":{"login":"andreaperizzato","id":4716310,"avatar_url":"https://avatars.githubusercontent.com/u/4716310?v=3","gravatar_id":"","url":"https://api.github.com/users/andreaperizzato","html_url":"https://github.com/andreaperizzato","followers_url":"https://api.github.com/users/andreaperizzato/followers","following_url":"https://api.github.com/users/andreaperizzato/following{/other_user}","gists_url":"https://api.github.com/users/andreaperizzato/gists{/gist_id}","starred_url":"https://api.github.com/users/andreaperizzato/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andreaperizzato/subscriptions","organizations_url":"https://api.github.com/users/andreaperizzato/orgs","repos_url":"https://api.github.com/users/andreaperizzato/repos","events_url":"https://api.github.com/users/andreaperizzato/events{/privacy}","received_events_url":"https://api.github.com/users/andreaperizzato/received_events","type":"User","site_admin":false},"repo":{"id":67866975,"name":"ActiveLabel.swift","full_name":"andreaperizzato/ActiveLabel.swift","owner":{"login":"andreaperizzato","id":4716310,"avatar_url":"https://avatars.githubusercontent.com/u/4716310?v=3","gravatar_id":"","url":"https://api.github.com/users/andreaperizzato","html_url":"https://github.com/andreaperizzato","followers_url":"https://api.github.com/users/andreaperizzato/followers","following_url":"https://api.github.com/users/andreaperizzato/following{/other_user}","gists_url":"https://api.github.com/users/andreaperizzato/gists{/gist_id}","starred_url":"https://api.github.com/users/andreaperizzato/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andreaperizzato/subscriptions","organizations_url":"https://api.github.com/users/andreaperizzato/orgs","repos_url":"https://api.github.com/users/andreaperizzato/repos","events_url":"https://api.github.com/users/andreaperizzato/events{/privacy}","received_events_url":"https://api.github.com/users/andreaperizzato/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/andreaperizzato/ActiveLabel.swift","description":"UILabel drop-in replacement supporting Hashtags (#), Mentions (@) and URLs (http://) written in Swift","fork":true,"url":"https://api.github.com/repos/andreaperizzato/ActiveLabel.swift","forks_url":"https://api.github.com/repos/andreaperizzato/ActiveLabel.swift/forks","keys_url":"https://api.github.com/repos/andreaperizzato/ActiveLabel.swift/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andreaperizzato/ActiveLabel.swift/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andreaperizzato/ActiveLabel.swift/teams","hooks_url":"https://api.github.com/repos/andreaperizzato/ActiveLabel.swift/hooks","issue_events_url":"https://api.github.com/repos/andreaperizzato/ActiveLabel.swift/issues/events{/number}","events_url":"https://api.github.com/repos/andreaperizzato/ActiveLabel.swift/events","assignees_url":"https://api.github.com/repos/andreaperizzato/ActiveLabel.swift/assignees{/user}","branches_url":"https://api.github.com/repos/andreaperizzato/ActiveLabel.swift/branches{/branch}","tags_url":"https://api.github.com/repos/andreaperizzato/ActiveLabel.swift/tags","blobs_url":"https://api.github.com/repos/andreaperizzato/ActiveLabel.swift/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andreaperizzato/ActiveLabel.swift/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andreaperizzato/ActiveLabel.swift/git/refs{/sha}","trees_url":"https://api.github.com/repos/andreaperizzato/ActiveLabel.swift/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andreaperizzato/ActiveLabel.swift/statuses/{sha}","languages_url":"https://api.github.com/repos/andreaperizzato/ActiveLabel.swift/languages","stargazers_url":"https://api.github.com/repos/andreaperizzato/ActiveLabel.swift/stargazers","contributors_url":"https://api.github.com/repos/andreaperizzato/ActiveLabel.swift/contributors","subscribers_url":"https://api.github.com/repos/andreaperizzato/ActiveLabel.swift/subscribers","subscription_url":"https://api.github.com/repos/andreaperizzato/ActiveLabel.swift/subscription","commits_url":"https://api.github.com/repos/andreaperizzato/ActiveLabel.swift/commits{/sha}","git_commits_url":"https://api.github.com/repos/andreaperizzato/ActiveLabel.swift/git/commits{/sha}","comments_url":"https://api.github.com/repos/andreaperizzato/ActiveLabel.swift/comments{/number}","issue_comment_url":"https://api.github.com/repos/andreaperizzato/ActiveLabel.swift/issues/comments{/number}","contents_url":"https://api.github.com/repos/andreaperizzato/ActiveLabel.swift/contents/{+path}","compare_url":"https://api.github.com/repos/andreaperizzato/ActiveLabel.swift/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andreaperizzato/ActiveLabel.swift/merges","archive_url":"https://api.github.com/repos/andreaperizzato/ActiveLabel.swift/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andreaperizzato/ActiveLabel.swift/downloads","issues_url":"https://api.github.com/repos/andreaperizzato/ActiveLabel.swift/issues{/number}","pulls_url":"https://api.github.com/repos/andreaperizzato/ActiveLabel.swift/pulls{/number}","milestones_url":"https://api.github.com/repos/andreaperizzato/ActiveLabel.swift/milestones{/number}","notifications_url":"https://api.github.com/repos/andreaperizzato/ActiveLabel.swift/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andreaperizzato/ActiveLabel.swift/labels{/name}","releases_url":"https://api.github.com/repos/andreaperizzato/ActiveLabel.swift/releases{/id}","deployments_url":"https://api.github.com/repos/andreaperizzato/ActiveLabel.swift/deployments","created_at":"2016-09-10T11:19:18Z","updated_at":"2016-09-23T10:01:37Z","pushed_at":"2016-10-15T20:26:07Z","git_url":"git://github.com/andreaperizzato/ActiveLabel.swift.git","ssh_url":"git@github.com:andreaperizzato/ActiveLabel.swift.git","clone_url":"https://github.com/andreaperizzato/ActiveLabel.swift.git","svn_url":"https://github.com/andreaperizzato/ActiveLabel.swift","homepage":"","size":1374,"stargazers_count":1,"watchers_count":1,"language":"Swift","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":1,"default_branch":"master"}},"base":{"label":"optonaut:master","ref":"master","sha":"c7c5cf7d893c882a6f2d9270b2fe2e40953ba06f","user":{"login":"optonaut","id":12383518,"avatar_url":"https://avatars.githubusercontent.com/u/12383518?v=3","gravatar_id":"","url":"https://api.github.com/users/optonaut","html_url":"https://github.com/optonaut","followers_url":"https://api.github.com/users/optonaut/followers","following_url":"https://api.github.com/users/optonaut/following{/other_user}","gists_url":"https://api.github.com/users/optonaut/gists{/gist_id}","starred_url":"https://api.github.com/users/optonaut/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/optonaut/subscriptions","organizations_url":"https://api.github.com/users/optonaut/orgs","repos_url":"https://api.github.com/users/optonaut/repos","events_url":"https://api.github.com/users/optonaut/events{/privacy}","received_events_url":"https://api.github.com/users/optonaut/received_events","type":"Organization","site_admin":false},"repo":{"id":41873203,"name":"ActiveLabel.swift","full_name":"optonaut/ActiveLabel.swift","owner":{"login":"optonaut","id":12383518,"avatar_url":"https://avatars.githubusercontent.com/u/12383518?v=3","gravatar_id":"","url":"https://api.github.com/users/optonaut","html_url":"https://github.com/optonaut","followers_url":"https://api.github.com/users/optonaut/followers","following_url":"https://api.github.com/users/optonaut/following{/other_user}","gists_url":"https://api.github.com/users/optonaut/gists{/gist_id}","starred_url":"https://api.github.com/users/optonaut/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/optonaut/subscriptions","organizations_url":"https://api.github.com/users/optonaut/orgs","repos_url":"https://api.github.com/users/optonaut/repos","events_url":"https://api.github.com/users/optonaut/events{/privacy}","received_events_url":"https://api.github.com/users/optonaut/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/optonaut/ActiveLabel.swift","description":"UILabel drop-in replacement supporting Hashtags (#), Mentions (@) and URLs (http://) written in Swift","fork":false,"url":"https://api.github.com/repos/optonaut/ActiveLabel.swift","forks_url":"https://api.github.com/repos/optonaut/ActiveLabel.swift/forks","keys_url":"https://api.github.com/repos/optonaut/ActiveLabel.swift/keys{/key_id}","collaborators_url":"https://api.github.com/repos/optonaut/ActiveLabel.swift/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/optonaut/ActiveLabel.swift/teams","hooks_url":"https://api.github.com/repos/optonaut/ActiveLabel.swift/hooks","issue_events_url":"https://api.github.com/repos/optonaut/ActiveLabel.swift/issues/events{/number}","events_url":"https://api.github.com/repos/optonaut/ActiveLabel.swift/events","assignees_url":"https://api.github.com/repos/optonaut/ActiveLabel.swift/assignees{/user}","branches_url":"https://api.github.com/repos/optonaut/ActiveLabel.swift/branches{/branch}","tags_url":"https://api.github.com/repos/optonaut/ActiveLabel.swift/tags","blobs_url":"https://api.github.com/repos/optonaut/ActiveLabel.swift/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/optonaut/ActiveLabel.swift/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/optonaut/ActiveLabel.swift/git/refs{/sha}","trees_url":"https://api.github.com/repos/optonaut/ActiveLabel.swift/git/trees{/sha}","statuses_url":"https://api.github.com/repos/optonaut/ActiveLabel.swift/statuses/{sha}","languages_url":"https://api.github.com/repos/optonaut/ActiveLabel.swift/languages","stargazers_url":"https://api.github.com/repos/optonaut/ActiveLabel.swift/stargazers","contributors_url":"https://api.github.com/repos/optonaut/ActiveLabel.swift/contributors","subscribers_url":"https://api.github.com/repos/optonaut/ActiveLabel.swift/subscribers","subscription_url":"https://api.github.com/repos/optonaut/ActiveLabel.swift/subscription","commits_url":"https://api.github.com/repos/optonaut/ActiveLabel.swift/commits{/sha}","git_commits_url":"https://api.github.com/repos/optonaut/ActiveLabel.swift/git/commits{/sha}","comments_url":"https://api.github.com/repos/optonaut/ActiveLabel.swift/comments{/number}","issue_comment_url":"https://api.github.com/repos/optonaut/ActiveLabel.swift/issues/comments{/number}","contents_url":"https://api.github.com/repos/optonaut/ActiveLabel.swift/contents/{+path}","compare_url":"https://api.github.com/repos/optonaut/ActiveLabel.swift/compare/{base}...{head}","merges_url":"https://api.github.com/repos/optonaut/ActiveLabel.swift/merges","archive_url":"https://api.github.com/repos/optonaut/ActiveLabel.swift/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/optonaut/ActiveLabel.swift/downloads","issues_url":"https://api.github.com/repos/optonaut/ActiveLabel.swift/issues{/number}","pulls_url":"https://api.github.com/repos/optonaut/ActiveLabel.swift/pulls{/number}","milestones_url":"https://api.github.com/repos/optonaut/ActiveLabel.swift/milestones{/number}","notifications_url":"https://api.github.com/repos/optonaut/ActiveLabel.swift/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/optonaut/ActiveLabel.swift/labels{/name}","releases_url":"https://api.github.com/repos/optonaut/ActiveLabel.swift/releases{/id}","deployments_url":"https://api.github.com/repos/optonaut/ActiveLabel.swift/deployments","created_at":"2015-09-03T17:18:12Z","updated_at":"2016-10-15T20:18:30Z","pushed_at":"2016-10-16T12:31:50Z","git_url":"git://github.com/optonaut/ActiveLabel.swift.git","ssh_url":"git@github.com:optonaut/ActiveLabel.swift.git","clone_url":"https://github.com/optonaut/ActiveLabel.swift.git","svn_url":"https://github.com/optonaut/ActiveLabel.swift","homepage":"","size":3536,"stargazers_count":1197,"watchers_count":1197,"language":"Swift","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":115,"mirror_url":null,"open_issues_count":11,"forks":115,"open_issues":11,"watchers":1197,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/optonaut/ActiveLabel.swift/pulls/122"},"html":{"href":"https://github.com/optonaut/ActiveLabel.swift/pull/122"},"issue":{"href":"https://api.github.com/repos/optonaut/ActiveLabel.swift/issues/122"},"comments":{"href":"https://api.github.com/repos/optonaut/ActiveLabel.swift/issues/122/comments"},"review_comments":{"href":"https://api.github.com/repos/optonaut/ActiveLabel.swift/pulls/122/comments"},"review_comment":{"href":"https://api.github.com/repos/optonaut/ActiveLabel.swift/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/optonaut/ActiveLabel.swift/pulls/122/commits"},"statuses":{"href":"https://api.github.com/repos/optonaut/ActiveLabel.swift/statuses/fe6c499d7baf98016ade0f32d96e20482c25ba6d"}}}}
{"actor":{"display_login":"poolqf"}}