{"action":"created","comment":{"url":"https://api.github.com/repos/Raizlabs/BonMot/pulls/comments/63789119","id":63789119,"diff_hunk":"@@ -0,0 +1,69 @@\n+//\n+//  BONTag.h\n+//  Pods\n+//\n+//  Created by Nora Trapp on 5/11/16.\n+//\n+//\n+\n+#import <Foundation/Foundation.h>\n+#import \"BONCompatibility.h\"\n+\n+@protocol BONTextable;\n+\n+@interface BONTag : NSObject <NSCopying>\n+\n+@property (copy, nonatomic, readonly, BONNonnull) NSString *startTag;\n+@property (copy, nonatomic, readonly, BONNonnull) NSString *endTag;\n+@property (copy, nonatomic, readonly, BONNonnull) NSString *escapeString;\n+@property (copy, nonatomic, readonly, BONNonnull) id<BONTextable> textable;\n+\n+- (BONNonnull instancetype)initWithStartTag:(BONNonnull NSString *)startTag endTag:(BONNonnull NSString *)endTag escapeString:(BONNonnull NSString *)escapeString textable:(BONNonnull id<BONTextable>)textable;","path":"Pod/Classes/BONTag.h","position":21,"original_position":21,"commit_id":"f2350f2d22691c1e79a37d3b544ea82bd0f99c5d","original_commit_id":"993f2a1905bbc4992391c31023ad6634f48cc0f3","user":{"login":"ZevEisenberg","id":464574,"avatar_url":"https://avatars.githubusercontent.com/u/464574?v=3","gravatar_id":"","url":"https://api.github.com/users/ZevEisenberg","html_url":"https://github.com/ZevEisenberg","followers_url":"https://api.github.com/users/ZevEisenberg/followers","following_url":"https://api.github.com/users/ZevEisenberg/following{/other_user}","gists_url":"https://api.github.com/users/ZevEisenberg/gists{/gist_id}","starred_url":"https://api.github.com/users/ZevEisenberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ZevEisenberg/subscriptions","organizations_url":"https://api.github.com/users/ZevEisenberg/orgs","repos_url":"https://api.github.com/users/ZevEisenberg/repos","events_url":"https://api.github.com/users/ZevEisenberg/events{/privacy}","received_events_url":"https://api.github.com/users/ZevEisenberg/received_events","type":"User","site_admin":false},"body":"…but here's an idea, @Imperiopolis. You could mark the convenience functions for `BONTagComplexMake` as `NS_SWIFT_UNAVAILABLE`, and add a few more `-initWith...` methods to cover the cases where you would normally use default arguments. You would just never call those in Obj-C code because you would use the convenience functions. Then, the only way to initialize `BONTag` objects in Swift would be to use one of those initializers from Obj-C.\r\n\r\nSince it would be a breaking change for Swift users if we marked the convenience functions as unavailable, I'd prefer to do it now. @Imperiopolis, let me know if you'd like to do it, and if not, I'll take care of it.","created_at":"2016-05-18T21:52:30Z","updated_at":"2016-05-18T21:52:30Z","html_url":"https://github.com/Raizlabs/BonMot/pull/144#discussion_r63789119","pull_request_url":"https://api.github.com/repos/Raizlabs/BonMot/pulls/144","_links":{"self":{"href":"https://api.github.com/repos/Raizlabs/BonMot/pulls/comments/63789119"},"html":{"href":"https://github.com/Raizlabs/BonMot/pull/144#discussion_r63789119"},"pull_request":{"href":"https://api.github.com/repos/Raizlabs/BonMot/pulls/144"}}},"pull_request":{"url":"https://api.github.com/repos/Raizlabs/BonMot/pulls/144","id":69775095,"html_url":"https://github.com/Raizlabs/BonMot/pull/144","diff_url":"https://github.com/Raizlabs/BonMot/pull/144.diff","patch_url":"https://github.com/Raizlabs/BonMot/pull/144.patch","issue_url":"https://api.github.com/repos/Raizlabs/BonMot/issues/144","number":144,"state":"open","locked":false,"title":"Add ability to add child BONChainables to style text between tags.","user":{"login":"Imperiopolis","id":957960,"avatar_url":"https://avatars.githubusercontent.com/u/957960?v=3","gravatar_id":"","url":"https://api.github.com/users/Imperiopolis","html_url":"https://github.com/Imperiopolis","followers_url":"https://api.github.com/users/Imperiopolis/followers","following_url":"https://api.github.com/users/Imperiopolis/following{/other_user}","gists_url":"https://api.github.com/users/Imperiopolis/gists{/gist_id}","starred_url":"https://api.github.com/users/Imperiopolis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Imperiopolis/subscriptions","organizations_url":"https://api.github.com/users/Imperiopolis/orgs","repos_url":"https://api.github.com/users/Imperiopolis/repos","events_url":"https://api.github.com/users/Imperiopolis/events{/privacy}","received_events_url":"https://api.github.com/users/Imperiopolis/received_events","type":"User","site_admin":false},"body":"This adds the ability to parse and style substrings between arbitrary tags with assigned `BONChainable` objects. This potentially resolves #69.\r\n\r\nExcerpt from the readme:\r\n\r\n## Tag Styles\r\n\r\nBonMot can style text between arbirtrary tags using a `<tag></tag>` format and `\\` as an escape character.\r\n\r\n```objc\r\nBONChain *boldChain = BONChain.new.fontNameAndSize(@\"Baskerville-Bold\", 15.0f);\r\nBONChain *italicChain = BONChain.new.fontNameAndSize(@\"Baskerville-Italic\", 15.0f);\r\n\r\nBONChain *chain = BONChain.new.fontNameAndSize(@\"Baskerville\", 17.0f)\r\n    .tagStyles(@[BONTagMake(@\"bold\", boldChain), BONTagMake(@\"italic\", italicChain)])\r\n    .string(@\"<bold>This text is wrapped in a \\\\<bold> tag.</bold>\\n<italic>This text is wrapped in an \\\\<italic> tag.</italic>\");\r\n\r\nNSAttributedString *string = chain.attributedString;\r\n```\r\n\r\nOutputs:\r\n\r\n<img width=275 height=40 src=\"https://github.com/Imperiopolis/BonMot/raw/nt-tag-styling/readme-images/tag-styling.png\" />\r\n\r\nBonMot can also style text between any arbitrary start and end strings using any escape string.\r\n\r\n```objc\r\nBONChain *boldChain = BONChain.new.fontNameAndSize(@\"Baskerville-Bold\", 15.0f);\r\nBONChain *italicChain = BONChain.new.fontNameAndSize(@\"Baskerville-Italic\", 15.0f);\r\n\r\nBONChain *chain = BONChain.new.fontNameAndSize(@\"Baskerville\", 17.0f)\r\n.tagStyles(@[BONTagComplexMake(@\"~start~\", @\"!end\", @\"escape\", boldChain)])\r\n.string(@\"~start~This text is wrapped in a escape~start~ tag.!end\");\r\n\r\nNSAttributedString *string = chain.attributedString;\r\n```\r\n\r\n<img width=275 height=25 src=\"https://github.com/Imperiopolis/BonMot/raw/nt-tag-styling/readme-images/arbitrary-tag-styling.png\" />\r\n\r\n**Note:** Tag styles do not support nested or interleaved tags. The first tag matched will be applied, any additional tags between the start end end will be ignored.","created_at":"2016-05-12T03:35:00Z","updated_at":"2016-05-18T21:52:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a9dd37f8fc54ec3f8add4be3fcfa06a925bb6539","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Raizlabs/BonMot/pulls/144/commits","review_comments_url":"https://api.github.com/repos/Raizlabs/BonMot/pulls/144/comments","review_comment_url":"https://api.github.com/repos/Raizlabs/BonMot/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Raizlabs/BonMot/issues/144/comments","statuses_url":"https://api.github.com/repos/Raizlabs/BonMot/statuses/f2350f2d22691c1e79a37d3b544ea82bd0f99c5d","head":{"label":"Imperiopolis:nt-tag-styling","ref":"nt-tag-styling","sha":"f2350f2d22691c1e79a37d3b544ea82bd0f99c5d","user":{"login":"Imperiopolis","id":957960,"avatar_url":"https://avatars.githubusercontent.com/u/957960?v=3","gravatar_id":"","url":"https://api.github.com/users/Imperiopolis","html_url":"https://github.com/Imperiopolis","followers_url":"https://api.github.com/users/Imperiopolis/followers","following_url":"https://api.github.com/users/Imperiopolis/following{/other_user}","gists_url":"https://api.github.com/users/Imperiopolis/gists{/gist_id}","starred_url":"https://api.github.com/users/Imperiopolis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Imperiopolis/subscriptions","organizations_url":"https://api.github.com/users/Imperiopolis/orgs","repos_url":"https://api.github.com/users/Imperiopolis/repos","events_url":"https://api.github.com/users/Imperiopolis/events{/privacy}","received_events_url":"https://api.github.com/users/Imperiopolis/received_events","type":"User","site_admin":false},"repo":{"id":53002542,"name":"BonMot","full_name":"Imperiopolis/BonMot","owner":{"login":"Imperiopolis","id":957960,"avatar_url":"https://avatars.githubusercontent.com/u/957960?v=3","gravatar_id":"","url":"https://api.github.com/users/Imperiopolis","html_url":"https://github.com/Imperiopolis","followers_url":"https://api.github.com/users/Imperiopolis/followers","following_url":"https://api.github.com/users/Imperiopolis/following{/other_user}","gists_url":"https://api.github.com/users/Imperiopolis/gists{/gist_id}","starred_url":"https://api.github.com/users/Imperiopolis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Imperiopolis/subscriptions","organizations_url":"https://api.github.com/users/Imperiopolis/orgs","repos_url":"https://api.github.com/users/Imperiopolis/repos","events_url":"https://api.github.com/users/Imperiopolis/events{/privacy}","received_events_url":"https://api.github.com/users/Imperiopolis/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Imperiopolis/BonMot","description":"An Objective-C attributed string generation library","fork":true,"url":"https://api.github.com/repos/Imperiopolis/BonMot","forks_url":"https://api.github.com/repos/Imperiopolis/BonMot/forks","keys_url":"https://api.github.com/repos/Imperiopolis/BonMot/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Imperiopolis/BonMot/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Imperiopolis/BonMot/teams","hooks_url":"https://api.github.com/repos/Imperiopolis/BonMot/hooks","issue_events_url":"https://api.github.com/repos/Imperiopolis/BonMot/issues/events{/number}","events_url":"https://api.github.com/repos/Imperiopolis/BonMot/events","assignees_url":"https://api.github.com/repos/Imperiopolis/BonMot/assignees{/user}","branches_url":"https://api.github.com/repos/Imperiopolis/BonMot/branches{/branch}","tags_url":"https://api.github.com/repos/Imperiopolis/BonMot/tags","blobs_url":"https://api.github.com/repos/Imperiopolis/BonMot/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Imperiopolis/BonMot/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Imperiopolis/BonMot/git/refs{/sha}","trees_url":"https://api.github.com/repos/Imperiopolis/BonMot/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Imperiopolis/BonMot/statuses/{sha}","languages_url":"https://api.github.com/repos/Imperiopolis/BonMot/languages","stargazers_url":"https://api.github.com/repos/Imperiopolis/BonMot/stargazers","contributors_url":"https://api.github.com/repos/Imperiopolis/BonMot/contributors","subscribers_url":"https://api.github.com/repos/Imperiopolis/BonMot/subscribers","subscription_url":"https://api.github.com/repos/Imperiopolis/BonMot/subscription","commits_url":"https://api.github.com/repos/Imperiopolis/BonMot/commits{/sha}","git_commits_url":"https://api.github.com/repos/Imperiopolis/BonMot/git/commits{/sha}","comments_url":"https://api.github.com/repos/Imperiopolis/BonMot/comments{/number}","issue_comment_url":"https://api.github.com/repos/Imperiopolis/BonMot/issues/comments{/number}","contents_url":"https://api.github.com/repos/Imperiopolis/BonMot/contents/{+path}","compare_url":"https://api.github.com/repos/Imperiopolis/BonMot/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Imperiopolis/BonMot/merges","archive_url":"https://api.github.com/repos/Imperiopolis/BonMot/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Imperiopolis/BonMot/downloads","issues_url":"https://api.github.com/repos/Imperiopolis/BonMot/issues{/number}","pulls_url":"https://api.github.com/repos/Imperiopolis/BonMot/pulls{/number}","milestones_url":"https://api.github.com/repos/Imperiopolis/BonMot/milestones{/number}","notifications_url":"https://api.github.com/repos/Imperiopolis/BonMot/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Imperiopolis/BonMot/labels{/name}","releases_url":"https://api.github.com/repos/Imperiopolis/BonMot/releases{/id}","deployments_url":"https://api.github.com/repos/Imperiopolis/BonMot/deployments","created_at":"2016-03-02T22:51:52Z","updated_at":"2016-03-02T22:51:53Z","pushed_at":"2016-05-18T01:25:58Z","git_url":"git://github.com/Imperiopolis/BonMot.git","ssh_url":"git@github.com:Imperiopolis/BonMot.git","clone_url":"https://github.com/Imperiopolis/BonMot.git","svn_url":"https://github.com/Imperiopolis/BonMot","homepage":null,"size":3040,"stargazers_count":0,"watchers_count":0,"language":"Objective-C","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Raizlabs:master","ref":"master","sha":"e51b8a87050d6a0398cfd88c71a02efba9a2428d","user":{"login":"Raizlabs","id":621479,"avatar_url":"https://avatars.githubusercontent.com/u/621479?v=3","gravatar_id":"","url":"https://api.github.com/users/Raizlabs","html_url":"https://github.com/Raizlabs","followers_url":"https://api.github.com/users/Raizlabs/followers","following_url":"https://api.github.com/users/Raizlabs/following{/other_user}","gists_url":"https://api.github.com/users/Raizlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/Raizlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Raizlabs/subscriptions","organizations_url":"https://api.github.com/users/Raizlabs/orgs","repos_url":"https://api.github.com/users/Raizlabs/repos","events_url":"https://api.github.com/users/Raizlabs/events{/privacy}","received_events_url":"https://api.github.com/users/Raizlabs/received_events","type":"Organization","site_admin":false},"repo":{"id":35981629,"name":"BonMot","full_name":"Raizlabs/BonMot","owner":{"login":"Raizlabs","id":621479,"avatar_url":"https://avatars.githubusercontent.com/u/621479?v=3","gravatar_id":"","url":"https://api.github.com/users/Raizlabs","html_url":"https://github.com/Raizlabs","followers_url":"https://api.github.com/users/Raizlabs/followers","following_url":"https://api.github.com/users/Raizlabs/following{/other_user}","gists_url":"https://api.github.com/users/Raizlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/Raizlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Raizlabs/subscriptions","organizations_url":"https://api.github.com/users/Raizlabs/orgs","repos_url":"https://api.github.com/users/Raizlabs/repos","events_url":"https://api.github.com/users/Raizlabs/events{/privacy}","received_events_url":"https://api.github.com/users/Raizlabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Raizlabs/BonMot","description":"Beautiful, easy attributed strings for iOS","fork":false,"url":"https://api.github.com/repos/Raizlabs/BonMot","forks_url":"https://api.github.com/repos/Raizlabs/BonMot/forks","keys_url":"https://api.github.com/repos/Raizlabs/BonMot/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Raizlabs/BonMot/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Raizlabs/BonMot/teams","hooks_url":"https://api.github.com/repos/Raizlabs/BonMot/hooks","issue_events_url":"https://api.github.com/repos/Raizlabs/BonMot/issues/events{/number}","events_url":"https://api.github.com/repos/Raizlabs/BonMot/events","assignees_url":"https://api.github.com/repos/Raizlabs/BonMot/assignees{/user}","branches_url":"https://api.github.com/repos/Raizlabs/BonMot/branches{/branch}","tags_url":"https://api.github.com/repos/Raizlabs/BonMot/tags","blobs_url":"https://api.github.com/repos/Raizlabs/BonMot/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Raizlabs/BonMot/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Raizlabs/BonMot/git/refs{/sha}","trees_url":"https://api.github.com/repos/Raizlabs/BonMot/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Raizlabs/BonMot/statuses/{sha}","languages_url":"https://api.github.com/repos/Raizlabs/BonMot/languages","stargazers_url":"https://api.github.com/repos/Raizlabs/BonMot/stargazers","contributors_url":"https://api.github.com/repos/Raizlabs/BonMot/contributors","subscribers_url":"https://api.github.com/repos/Raizlabs/BonMot/subscribers","subscription_url":"https://api.github.com/repos/Raizlabs/BonMot/subscription","commits_url":"https://api.github.com/repos/Raizlabs/BonMot/commits{/sha}","git_commits_url":"https://api.github.com/repos/Raizlabs/BonMot/git/commits{/sha}","comments_url":"https://api.github.com/repos/Raizlabs/BonMot/comments{/number}","issue_comment_url":"https://api.github.com/repos/Raizlabs/BonMot/issues/comments{/number}","contents_url":"https://api.github.com/repos/Raizlabs/BonMot/contents/{+path}","compare_url":"https://api.github.com/repos/Raizlabs/BonMot/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Raizlabs/BonMot/merges","archive_url":"https://api.github.com/repos/Raizlabs/BonMot/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Raizlabs/BonMot/downloads","issues_url":"https://api.github.com/repos/Raizlabs/BonMot/issues{/number}","pulls_url":"https://api.github.com/repos/Raizlabs/BonMot/pulls{/number}","milestones_url":"https://api.github.com/repos/Raizlabs/BonMot/milestones{/number}","notifications_url":"https://api.github.com/repos/Raizlabs/BonMot/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Raizlabs/BonMot/labels{/name}","releases_url":"https://api.github.com/repos/Raizlabs/BonMot/releases{/id}","deployments_url":"https://api.github.com/repos/Raizlabs/BonMot/deployments","created_at":"2015-05-21T00:32:35Z","updated_at":"2016-05-18T18:25:52Z","pushed_at":"2016-05-18T21:13:48Z","git_url":"git://github.com/Raizlabs/BonMot.git","ssh_url":"git@github.com:Raizlabs/BonMot.git","clone_url":"https://github.com/Raizlabs/BonMot.git","svn_url":"https://github.com/Raizlabs/BonMot","homepage":"","size":3094,"stargazers_count":717,"watchers_count":717,"language":"Objective-C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":32,"mirror_url":null,"open_issues_count":37,"forks":32,"open_issues":37,"watchers":717,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Raizlabs/BonMot/pulls/144"},"html":{"href":"https://github.com/Raizlabs/BonMot/pull/144"},"issue":{"href":"https://api.github.com/repos/Raizlabs/BonMot/issues/144"},"comments":{"href":"https://api.github.com/repos/Raizlabs/BonMot/issues/144/comments"},"review_comments":{"href":"https://api.github.com/repos/Raizlabs/BonMot/pulls/144/comments"},"review_comment":{"href":"https://api.github.com/repos/Raizlabs/BonMot/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Raizlabs/BonMot/pulls/144/commits"},"statuses":{"href":"https://api.github.com/repos/Raizlabs/BonMot/statuses/f2350f2d22691c1e79a37d3b544ea82bd0f99c5d"}}}}