{"action":"created","comment":{"url":"https://api.github.com/repos/increments/qiita-team-services/pulls/comments/46518296","id":46518296,"diff_hunk":"@@ -265,13 +265,27 @@ def comment_link(comment)\n         # @param project [Qiita::Team::Services::Resources::Project]\n         # @return [String]\n         def project_link(project)\n-          \"<#{project.url}|#{project.name}>\"\n+          \"<#{project.url}|#{markup_escape(project.name)}>\"\n         end\n \n         # @param team [Qiita::Team::Services::Resources::Team]\n         # @return [String]\n         def team_link(team)\n-          \"<#{team.url}|#{team.name}>\"\n+          \"<#{team.url}|#{markup_escape(team.name)}>\"\n+        end\n+\n+        # Escape special characters for Slack markup.\n+        #\n+        # @see https://api.slack.com/docs/formatting\n+        # @param text [String]\n+        # @return [String]\n+        def markup_escape(text)\n+          table_for_escape = {\n+            \"g\" => \"&amp;\",","path":"lib/qiita/team/services/hooks/concerns/slack.rb","position":38,"original_position":38,"commit_id":"17f2d6063bde6f9d1bd27d4bc784a940432f9a4a","original_commit_id":"17f2d6063bde6f9d1bd27d4bc784a940432f9a4a","user":{"login":"yuku-t","id":96157,"avatar_url":"https://avatars.githubusercontent.com/u/96157?v=3","gravatar_id":"","url":"https://api.github.com/users/yuku-t","html_url":"https://github.com/yuku-t","followers_url":"https://api.github.com/users/yuku-t/followers","following_url":"https://api.github.com/users/yuku-t/following{/other_user}","gists_url":"https://api.github.com/users/yuku-t/gists{/gist_id}","starred_url":"https://api.github.com/users/yuku-t/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yuku-t/subscriptions","organizations_url":"https://api.github.com/users/yuku-t/orgs","repos_url":"https://api.github.com/users/yuku-t/repos","events_url":"https://api.github.com/users/yuku-t/events{/privacy}","received_events_url":"https://api.github.com/users/yuku-t/received_events","type":"User","site_admin":false},"body":"\"&\" の間違いではない？","created_at":"2015-12-03T06:57:16Z","updated_at":"2015-12-03T06:57:16Z","html_url":"https://github.com/increments/qiita-team-services/pull/13#discussion_r46518296","pull_request_url":"https://api.github.com/repos/increments/qiita-team-services/pulls/13","_links":{"self":{"href":"https://api.github.com/repos/increments/qiita-team-services/pulls/comments/46518296"},"html":{"href":"https://github.com/increments/qiita-team-services/pull/13#discussion_r46518296"},"pull_request":{"href":"https://api.github.com/repos/increments/qiita-team-services/pulls/13"}}},"pull_request":{"url":"https://api.github.com/repos/increments/qiita-team-services/pulls/13","id":52497700,"html_url":"https://github.com/increments/qiita-team-services/pull/13","diff_url":"https://github.com/increments/qiita-team-services/pull/13.diff","patch_url":"https://github.com/increments/qiita-team-services/pull/13.patch","issue_url":"https://api.github.com/repos/increments/qiita-team-services/issues/13","number":13,"state":"open","locked":false,"title":"Escape special characters for slack markup","user":{"login":"tomoasleep","id":1477130,"avatar_url":"https://avatars.githubusercontent.com/u/1477130?v=3","gravatar_id":"","url":"https://api.github.com/users/tomoasleep","html_url":"https://github.com/tomoasleep","followers_url":"https://api.github.com/users/tomoasleep/followers","following_url":"https://api.github.com/users/tomoasleep/following{/other_user}","gists_url":"https://api.github.com/users/tomoasleep/gists{/gist_id}","starred_url":"https://api.github.com/users/tomoasleep/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomoasleep/subscriptions","organizations_url":"https://api.github.com/users/tomoasleep/orgs","repos_url":"https://api.github.com/users/tomoasleep/repos","events_url":"https://api.github.com/users/tomoasleep/events{/privacy}","received_events_url":"https://api.github.com/users/tomoasleep/received_events","type":"User","site_admin":false},"body":"Slack markupでの特殊文字 (https://api.slack.com/docs/formatting) をエスケープしてリンク記法などが壊れないようにしました。\r\n\r\n# Screenshot\r\n![2015-12-03 15 45 40](https://cloud.githubusercontent.com/assets/1477130/11553734/f4c9c04e-99d4-11e5-92ae-87a26dfc1fa0.png)\r\n","created_at":"2015-12-03T06:46:20Z","updated_at":"2015-12-03T06:57:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d1a3be5d8e0da9f794f3a52472951d7e1421b77e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/increments/qiita-team-services/pulls/13/commits","review_comments_url":"https://api.github.com/repos/increments/qiita-team-services/pulls/13/comments","review_comment_url":"https://api.github.com/repos/increments/qiita-team-services/pulls/comments{/number}","comments_url":"https://api.github.com/repos/increments/qiita-team-services/issues/13/comments","statuses_url":"https://api.github.com/repos/increments/qiita-team-services/statuses/17f2d6063bde6f9d1bd27d4bc784a940432f9a4a","head":{"label":"increments:fix/escape-slack-link-content","ref":"fix/escape-slack-link-content","sha":"17f2d6063bde6f9d1bd27d4bc784a940432f9a4a","user":{"login":"increments","id":1674978,"avatar_url":"https://avatars.githubusercontent.com/u/1674978?v=3","gravatar_id":"","url":"https://api.github.com/users/increments","html_url":"https://github.com/increments","followers_url":"https://api.github.com/users/increments/followers","following_url":"https://api.github.com/users/increments/following{/other_user}","gists_url":"https://api.github.com/users/increments/gists{/gist_id}","starred_url":"https://api.github.com/users/increments/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/increments/subscriptions","organizations_url":"https://api.github.com/users/increments/orgs","repos_url":"https://api.github.com/users/increments/repos","events_url":"https://api.github.com/users/increments/events{/privacy}","received_events_url":"https://api.github.com/users/increments/received_events","type":"Organization","site_admin":false},"repo":{"id":41092440,"name":"qiita-team-services","full_name":"increments/qiita-team-services","owner":{"login":"increments","id":1674978,"avatar_url":"https://avatars.githubusercontent.com/u/1674978?v=3","gravatar_id":"","url":"https://api.github.com/users/increments","html_url":"https://github.com/increments","followers_url":"https://api.github.com/users/increments/followers","following_url":"https://api.github.com/users/increments/following{/other_user}","gists_url":"https://api.github.com/users/increments/gists{/gist_id}","starred_url":"https://api.github.com/users/increments/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/increments/subscriptions","organizations_url":"https://api.github.com/users/increments/orgs","repos_url":"https://api.github.com/users/increments/repos","events_url":"https://api.github.com/users/increments/events{/privacy}","received_events_url":"https://api.github.com/users/increments/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/increments/qiita-team-services","description":"Official Qiita:Team Services Integration [WIP]","fork":false,"url":"https://api.github.com/repos/increments/qiita-team-services","forks_url":"https://api.github.com/repos/increments/qiita-team-services/forks","keys_url":"https://api.github.com/repos/increments/qiita-team-services/keys{/key_id}","collaborators_url":"https://api.github.com/repos/increments/qiita-team-services/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/increments/qiita-team-services/teams","hooks_url":"https://api.github.com/repos/increments/qiita-team-services/hooks","issue_events_url":"https://api.github.com/repos/increments/qiita-team-services/issues/events{/number}","events_url":"https://api.github.com/repos/increments/qiita-team-services/events","assignees_url":"https://api.github.com/repos/increments/qiita-team-services/assignees{/user}","branches_url":"https://api.github.com/repos/increments/qiita-team-services/branches{/branch}","tags_url":"https://api.github.com/repos/increments/qiita-team-services/tags","blobs_url":"https://api.github.com/repos/increments/qiita-team-services/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/increments/qiita-team-services/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/increments/qiita-team-services/git/refs{/sha}","trees_url":"https://api.github.com/repos/increments/qiita-team-services/git/trees{/sha}","statuses_url":"https://api.github.com/repos/increments/qiita-team-services/statuses/{sha}","languages_url":"https://api.github.com/repos/increments/qiita-team-services/languages","stargazers_url":"https://api.github.com/repos/increments/qiita-team-services/stargazers","contributors_url":"https://api.github.com/repos/increments/qiita-team-services/contributors","subscribers_url":"https://api.github.com/repos/increments/qiita-team-services/subscribers","subscription_url":"https://api.github.com/repos/increments/qiita-team-services/subscription","commits_url":"https://api.github.com/repos/increments/qiita-team-services/commits{/sha}","git_commits_url":"https://api.github.com/repos/increments/qiita-team-services/git/commits{/sha}","comments_url":"https://api.github.com/repos/increments/qiita-team-services/comments{/number}","issue_comment_url":"https://api.github.com/repos/increments/qiita-team-services/issues/comments{/number}","contents_url":"https://api.github.com/repos/increments/qiita-team-services/contents/{+path}","compare_url":"https://api.github.com/repos/increments/qiita-team-services/compare/{base}...{head}","merges_url":"https://api.github.com/repos/increments/qiita-team-services/merges","archive_url":"https://api.github.com/repos/increments/qiita-team-services/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/increments/qiita-team-services/downloads","issues_url":"https://api.github.com/repos/increments/qiita-team-services/issues{/number}","pulls_url":"https://api.github.com/repos/increments/qiita-team-services/pulls{/number}","milestones_url":"https://api.github.com/repos/increments/qiita-team-services/milestones{/number}","notifications_url":"https://api.github.com/repos/increments/qiita-team-services/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/increments/qiita-team-services/labels{/name}","releases_url":"https://api.github.com/repos/increments/qiita-team-services/releases{/id}","created_at":"2015-08-20T11:36:31Z","updated_at":"2015-09-06T14:20:29Z","pushed_at":"2015-12-03T06:48:11Z","git_url":"git://github.com/increments/qiita-team-services.git","ssh_url":"git@github.com:increments/qiita-team-services.git","clone_url":"https://github.com/increments/qiita-team-services.git","svn_url":"https://github.com/increments/qiita-team-services","homepage":"http://increments.github.io/qiita-team-services/frames.html","size":209,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"increments:master","ref":"master","sha":"0b863150dc213ea53bdf7b57e328c3924cb3695c","user":{"login":"increments","id":1674978,"avatar_url":"https://avatars.githubusercontent.com/u/1674978?v=3","gravatar_id":"","url":"https://api.github.com/users/increments","html_url":"https://github.com/increments","followers_url":"https://api.github.com/users/increments/followers","following_url":"https://api.github.com/users/increments/following{/other_user}","gists_url":"https://api.github.com/users/increments/gists{/gist_id}","starred_url":"https://api.github.com/users/increments/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/increments/subscriptions","organizations_url":"https://api.github.com/users/increments/orgs","repos_url":"https://api.github.com/users/increments/repos","events_url":"https://api.github.com/users/increments/events{/privacy}","received_events_url":"https://api.github.com/users/increments/received_events","type":"Organization","site_admin":false},"repo":{"id":41092440,"name":"qiita-team-services","full_name":"increments/qiita-team-services","owner":{"login":"increments","id":1674978,"avatar_url":"https://avatars.githubusercontent.com/u/1674978?v=3","gravatar_id":"","url":"https://api.github.com/users/increments","html_url":"https://github.com/increments","followers_url":"https://api.github.com/users/increments/followers","following_url":"https://api.github.com/users/increments/following{/other_user}","gists_url":"https://api.github.com/users/increments/gists{/gist_id}","starred_url":"https://api.github.com/users/increments/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/increments/subscriptions","organizations_url":"https://api.github.com/users/increments/orgs","repos_url":"https://api.github.com/users/increments/repos","events_url":"https://api.github.com/users/increments/events{/privacy}","received_events_url":"https://api.github.com/users/increments/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/increments/qiita-team-services","description":"Official Qiita:Team Services Integration [WIP]","fork":false,"url":"https://api.github.com/repos/increments/qiita-team-services","forks_url":"https://api.github.com/repos/increments/qiita-team-services/forks","keys_url":"https://api.github.com/repos/increments/qiita-team-services/keys{/key_id}","collaborators_url":"https://api.github.com/repos/increments/qiita-team-services/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/increments/qiita-team-services/teams","hooks_url":"https://api.github.com/repos/increments/qiita-team-services/hooks","issue_events_url":"https://api.github.com/repos/increments/qiita-team-services/issues/events{/number}","events_url":"https://api.github.com/repos/increments/qiita-team-services/events","assignees_url":"https://api.github.com/repos/increments/qiita-team-services/assignees{/user}","branches_url":"https://api.github.com/repos/increments/qiita-team-services/branches{/branch}","tags_url":"https://api.github.com/repos/increments/qiita-team-services/tags","blobs_url":"https://api.github.com/repos/increments/qiita-team-services/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/increments/qiita-team-services/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/increments/qiita-team-services/git/refs{/sha}","trees_url":"https://api.github.com/repos/increments/qiita-team-services/git/trees{/sha}","statuses_url":"https://api.github.com/repos/increments/qiita-team-services/statuses/{sha}","languages_url":"https://api.github.com/repos/increments/qiita-team-services/languages","stargazers_url":"https://api.github.com/repos/increments/qiita-team-services/stargazers","contributors_url":"https://api.github.com/repos/increments/qiita-team-services/contributors","subscribers_url":"https://api.github.com/repos/increments/qiita-team-services/subscribers","subscription_url":"https://api.github.com/repos/increments/qiita-team-services/subscription","commits_url":"https://api.github.com/repos/increments/qiita-team-services/commits{/sha}","git_commits_url":"https://api.github.com/repos/increments/qiita-team-services/git/commits{/sha}","comments_url":"https://api.github.com/repos/increments/qiita-team-services/comments{/number}","issue_comment_url":"https://api.github.com/repos/increments/qiita-team-services/issues/comments{/number}","contents_url":"https://api.github.com/repos/increments/qiita-team-services/contents/{+path}","compare_url":"https://api.github.com/repos/increments/qiita-team-services/compare/{base}...{head}","merges_url":"https://api.github.com/repos/increments/qiita-team-services/merges","archive_url":"https://api.github.com/repos/increments/qiita-team-services/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/increments/qiita-team-services/downloads","issues_url":"https://api.github.com/repos/increments/qiita-team-services/issues{/number}","pulls_url":"https://api.github.com/repos/increments/qiita-team-services/pulls{/number}","milestones_url":"https://api.github.com/repos/increments/qiita-team-services/milestones{/number}","notifications_url":"https://api.github.com/repos/increments/qiita-team-services/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/increments/qiita-team-services/labels{/name}","releases_url":"https://api.github.com/repos/increments/qiita-team-services/releases{/id}","created_at":"2015-08-20T11:36:31Z","updated_at":"2015-09-06T14:20:29Z","pushed_at":"2015-12-03T06:48:11Z","git_url":"git://github.com/increments/qiita-team-services.git","ssh_url":"git@github.com:increments/qiita-team-services.git","clone_url":"https://github.com/increments/qiita-team-services.git","svn_url":"https://github.com/increments/qiita-team-services","homepage":"http://increments.github.io/qiita-team-services/frames.html","size":209,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/increments/qiita-team-services/pulls/13"},"html":{"href":"https://github.com/increments/qiita-team-services/pull/13"},"issue":{"href":"https://api.github.com/repos/increments/qiita-team-services/issues/13"},"comments":{"href":"https://api.github.com/repos/increments/qiita-team-services/issues/13/comments"},"review_comments":{"href":"https://api.github.com/repos/increments/qiita-team-services/pulls/13/comments"},"review_comment":{"href":"https://api.github.com/repos/increments/qiita-team-services/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/increments/qiita-team-services/pulls/13/commits"},"statuses":{"href":"https://api.github.com/repos/increments/qiita-team-services/statuses/17f2d6063bde6f9d1bd27d4bc784a940432f9a4a"}}}}