{"action":"created","issue":{"url":"https://api.github.com/repos/Raizlabs/BonMot/issues/144","repository_url":"https://api.github.com/repos/Raizlabs/BonMot","labels_url":"https://api.github.com/repos/Raizlabs/BonMot/issues/144/labels{/name}","comments_url":"https://api.github.com/repos/Raizlabs/BonMot/issues/144/comments","events_url":"https://api.github.com/repos/Raizlabs/BonMot/issues/144/events","html_url":"https://github.com/Raizlabs/BonMot/pull/144","id":154389880,"number":144,"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},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":19,"created_at":"2016-05-12T03:35:00Z","updated_at":"2016-05-17T21:28:43Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/Raizlabs/BonMot/pulls/144","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"},"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."},"comment":{"url":"https://api.github.com/repos/Raizlabs/BonMot/issues/comments/219859921","html_url":"https://github.com/Raizlabs/BonMot/pull/144#issuecomment-219859921","issue_url":"https://api.github.com/repos/Raizlabs/BonMot/issues/144","id":219859921,"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},"created_at":"2016-05-17T21:28:43Z","updated_at":"2016-05-17T21:28:43Z","body":"> Are there tests for cases with different escapes for different tags?\r\n\r\nThere are now!"}}