{"action":"created","comment":{"url":"https://api.github.com/repos/KissKissBankBank/kitten/pulls/comments/112003140","pull_request_review_id":33285011,"id":112003140,"diff_hunk":"@@ -0,0 +1,30 @@\n+import React from 'react'\n+import DOMPurify from 'dompurify'\n+\n+export class HtmlSafe extends React.Component {\n+  constructor(props) {\n+    super(props)\n+\n+    this.state = {\n+      html: {\n+        __html: this.props.children,\n+      },\n+    }\n+  }\n+\n+  componentDidMount() {\n+    this.setState({\n+      html: {\n+        __html: DOMPurify.sanitize(this.props.children),\n+      },\n+    })\n+  }\n+\n+  render() {\n+    const { children, ...others } = this.props\n+\n+    return (\n+      <div { ...others } dangerouslySetInnerHTML={ this.state.html } />","path":"assets/javascripts/kitten/components/layout/html-safe.js","position":27,"original_position":27,"commit_id":"3035509abbcd6034e0a4546ae26341a688426537","original_commit_id":"3035509abbcd6034e0a4546ae26341a688426537","user":{"login":"LanF3usT","id":736319,"avatar_url":"https://avatars2.githubusercontent.com/u/736319?v=3","gravatar_id":"","url":"https://api.github.com/users/LanF3usT","html_url":"https://github.com/LanF3usT","followers_url":"https://api.github.com/users/LanF3usT/followers","following_url":"https://api.github.com/users/LanF3usT/following{/other_user}","gists_url":"https://api.github.com/users/LanF3usT/gists{/gist_id}","starred_url":"https://api.github.com/users/LanF3usT/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LanF3usT/subscriptions","organizations_url":"https://api.github.com/users/LanF3usT/orgs","repos_url":"https://api.github.com/users/LanF3usT/repos","events_url":"https://api.github.com/users/LanF3usT/events{/privacy}","received_events_url":"https://api.github.com/users/LanF3usT/received_events","type":"User","site_admin":false},"body":"Ouais après faire `title={ \"Oui&nbsp;!\" }`, ca ne règle pas le problème d'affichage qu'il faut gérer avec `dangerouslySetInnerHTML`. C'est là où `Parser` est malin en retournant une liste de React.Element.","created_at":"2017-04-18T16:37:51Z","updated_at":"2017-04-18T16:37:51Z","html_url":"https://github.com/KissKissBankBank/kitten/pull/611#discussion_r112003140","pull_request_url":"https://api.github.com/repos/KissKissBankBank/kitten/pulls/611","_links":{"self":{"href":"https://api.github.com/repos/KissKissBankBank/kitten/pulls/comments/112003140"},"html":{"href":"https://github.com/KissKissBankBank/kitten/pull/611#discussion_r112003140"},"pull_request":{"href":"https://api.github.com/repos/KissKissBankBank/kitten/pulls/611"}}},"pull_request":{"url":"https://api.github.com/repos/KissKissBankBank/kitten/pulls/611","id":116361006,"html_url":"https://github.com/KissKissBankBank/kitten/pull/611","diff_url":"https://github.com/KissKissBankBank/kitten/pull/611.diff","patch_url":"https://github.com/KissKissBankBank/kitten/pull/611.patch","issue_url":"https://api.github.com/repos/KissKissBankBank/kitten/issues/611","number":611,"state":"open","locked":false,"title":"Add `HtmlSafe` component","user":{"login":"LanF3usT","id":736319,"avatar_url":"https://avatars2.githubusercontent.com/u/736319?v=3","gravatar_id":"","url":"https://api.github.com/users/LanF3usT","html_url":"https://github.com/LanF3usT","followers_url":"https://api.github.com/users/LanF3usT/followers","following_url":"https://api.github.com/users/LanF3usT/following{/other_user}","gists_url":"https://api.github.com/users/LanF3usT/gists{/gist_id}","starred_url":"https://api.github.com/users/LanF3usT/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LanF3usT/subscriptions","organizations_url":"https://api.github.com/users/LanF3usT/orgs","repos_url":"https://api.github.com/users/LanF3usT/repos","events_url":"https://api.github.com/users/LanF3usT/events{/privacy}","received_events_url":"https://api.github.com/users/LanF3usT/received_events","type":"User","site_admin":false},"body":"PR qui permet de rendre du HTML tout en empêchant les attaques XSS.\r\n\r\nTODO:\r\n\r\n- [ ] Tests\r\n- [x] Changelog\r\n","created_at":"2017-04-18T15:53:27Z","updated_at":"2017-04-18T16:37:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cbe3faf2fd582de2b04cc3ae42a854502238511a","assignee":{"login":"LanF3usT","id":736319,"avatar_url":"https://avatars2.githubusercontent.com/u/736319?v=3","gravatar_id":"","url":"https://api.github.com/users/LanF3usT","html_url":"https://github.com/LanF3usT","followers_url":"https://api.github.com/users/LanF3usT/followers","following_url":"https://api.github.com/users/LanF3usT/following{/other_user}","gists_url":"https://api.github.com/users/LanF3usT/gists{/gist_id}","starred_url":"https://api.github.com/users/LanF3usT/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LanF3usT/subscriptions","organizations_url":"https://api.github.com/users/LanF3usT/orgs","repos_url":"https://api.github.com/users/LanF3usT/repos","events_url":"https://api.github.com/users/LanF3usT/events{/privacy}","received_events_url":"https://api.github.com/users/LanF3usT/received_events","type":"User","site_admin":false},"assignees":[{"login":"LanF3usT","id":736319,"avatar_url":"https://avatars2.githubusercontent.com/u/736319?v=3","gravatar_id":"","url":"https://api.github.com/users/LanF3usT","html_url":"https://github.com/LanF3usT","followers_url":"https://api.github.com/users/LanF3usT/followers","following_url":"https://api.github.com/users/LanF3usT/following{/other_user}","gists_url":"https://api.github.com/users/LanF3usT/gists{/gist_id}","starred_url":"https://api.github.com/users/LanF3usT/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LanF3usT/subscriptions","organizations_url":"https://api.github.com/users/LanF3usT/orgs","repos_url":"https://api.github.com/users/LanF3usT/repos","events_url":"https://api.github.com/users/LanF3usT/events{/privacy}","received_events_url":"https://api.github.com/users/LanF3usT/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/KissKissBankBank/kitten/pulls/611/commits","review_comments_url":"https://api.github.com/repos/KissKissBankBank/kitten/pulls/611/comments","review_comment_url":"https://api.github.com/repos/KissKissBankBank/kitten/pulls/comments{/number}","comments_url":"https://api.github.com/repos/KissKissBankBank/kitten/issues/611/comments","statuses_url":"https://api.github.com/repos/KissKissBankBank/kitten/statuses/3035509abbcd6034e0a4546ae26341a688426537","head":{"label":"KissKissBankBank:feature/html-safe","ref":"feature/html-safe","sha":"3035509abbcd6034e0a4546ae26341a688426537","user":{"login":"KissKissBankBank","id":6039709,"avatar_url":"https://avatars2.githubusercontent.com/u/6039709?v=3","gravatar_id":"","url":"https://api.github.com/users/KissKissBankBank","html_url":"https://github.com/KissKissBankBank","followers_url":"https://api.github.com/users/KissKissBankBank/followers","following_url":"https://api.github.com/users/KissKissBankBank/following{/other_user}","gists_url":"https://api.github.com/users/KissKissBankBank/gists{/gist_id}","starred_url":"https://api.github.com/users/KissKissBankBank/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KissKissBankBank/subscriptions","organizations_url":"https://api.github.com/users/KissKissBankBank/orgs","repos_url":"https://api.github.com/users/KissKissBankBank/repos","events_url":"https://api.github.com/users/KissKissBankBank/events{/privacy}","received_events_url":"https://api.github.com/users/KissKissBankBank/received_events","type":"Organization","site_admin":false},"repo":{"id":61292012,"name":"kitten","full_name":"KissKissBankBank/kitten","owner":{"login":"KissKissBankBank","id":6039709,"avatar_url":"https://avatars2.githubusercontent.com/u/6039709?v=3","gravatar_id":"","url":"https://api.github.com/users/KissKissBankBank","html_url":"https://github.com/KissKissBankBank","followers_url":"https://api.github.com/users/KissKissBankBank/followers","following_url":"https://api.github.com/users/KissKissBankBank/following{/other_user}","gists_url":"https://api.github.com/users/KissKissBankBank/gists{/gist_id}","starred_url":"https://api.github.com/users/KissKissBankBank/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KissKissBankBank/subscriptions","organizations_url":"https://api.github.com/users/KissKissBankBank/orgs","repos_url":"https://api.github.com/users/KissKissBankBank/repos","events_url":"https://api.github.com/users/KissKissBankBank/events{/privacy}","received_events_url":"https://api.github.com/users/KissKissBankBank/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/KissKissBankBank/kitten","description":"Front-end components library","fork":false,"url":"https://api.github.com/repos/KissKissBankBank/kitten","forks_url":"https://api.github.com/repos/KissKissBankBank/kitten/forks","keys_url":"https://api.github.com/repos/KissKissBankBank/kitten/keys{/key_id}","collaborators_url":"https://api.github.com/repos/KissKissBankBank/kitten/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/KissKissBankBank/kitten/teams","hooks_url":"https://api.github.com/repos/KissKissBankBank/kitten/hooks","issue_events_url":"https://api.github.com/repos/KissKissBankBank/kitten/issues/events{/number}","events_url":"https://api.github.com/repos/KissKissBankBank/kitten/events","assignees_url":"https://api.github.com/repos/KissKissBankBank/kitten/assignees{/user}","branches_url":"https://api.github.com/repos/KissKissBankBank/kitten/branches{/branch}","tags_url":"https://api.github.com/repos/KissKissBankBank/kitten/tags","blobs_url":"https://api.github.com/repos/KissKissBankBank/kitten/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/KissKissBankBank/kitten/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/KissKissBankBank/kitten/git/refs{/sha}","trees_url":"https://api.github.com/repos/KissKissBankBank/kitten/git/trees{/sha}","statuses_url":"https://api.github.com/repos/KissKissBankBank/kitten/statuses/{sha}","languages_url":"https://api.github.com/repos/KissKissBankBank/kitten/languages","stargazers_url":"https://api.github.com/repos/KissKissBankBank/kitten/stargazers","contributors_url":"https://api.github.com/repos/KissKissBankBank/kitten/contributors","subscribers_url":"https://api.github.com/repos/KissKissBankBank/kitten/subscribers","subscription_url":"https://api.github.com/repos/KissKissBankBank/kitten/subscription","commits_url":"https://api.github.com/repos/KissKissBankBank/kitten/commits{/sha}","git_commits_url":"https://api.github.com/repos/KissKissBankBank/kitten/git/commits{/sha}","comments_url":"https://api.github.com/repos/KissKissBankBank/kitten/comments{/number}","issue_comment_url":"https://api.github.com/repos/KissKissBankBank/kitten/issues/comments{/number}","contents_url":"https://api.github.com/repos/KissKissBankBank/kitten/contents/{+path}","compare_url":"https://api.github.com/repos/KissKissBankBank/kitten/compare/{base}...{head}","merges_url":"https://api.github.com/repos/KissKissBankBank/kitten/merges","archive_url":"https://api.github.com/repos/KissKissBankBank/kitten/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/KissKissBankBank/kitten/downloads","issues_url":"https://api.github.com/repos/KissKissBankBank/kitten/issues{/number}","pulls_url":"https://api.github.com/repos/KissKissBankBank/kitten/pulls{/number}","milestones_url":"https://api.github.com/repos/KissKissBankBank/kitten/milestones{/number}","notifications_url":"https://api.github.com/repos/KissKissBankBank/kitten/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/KissKissBankBank/kitten/labels{/name}","releases_url":"https://api.github.com/repos/KissKissBankBank/kitten/releases{/id}","deployments_url":"https://api.github.com/repos/KissKissBankBank/kitten/deployments","created_at":"2016-06-16T12:46:14Z","updated_at":"2017-03-16T17:10:30Z","pushed_at":"2017-04-18T15:58:11Z","git_url":"git://github.com/KissKissBankBank/kitten.git","ssh_url":"git@github.com:KissKissBankBank/kitten.git","clone_url":"https://github.com/KissKissBankBank/kitten.git","svn_url":"https://github.com/KissKissBankBank/kitten","homepage":"","size":1849,"stargazers_count":3,"watchers_count":3,"language":"HTML","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":56,"forks":0,"open_issues":56,"watchers":3,"default_branch":"master"}},"base":{"label":"KissKissBankBank:master","ref":"master","sha":"1a7b0eff278aa147e91df25c8b8e9ef85da91007","user":{"login":"KissKissBankBank","id":6039709,"avatar_url":"https://avatars2.githubusercontent.com/u/6039709?v=3","gravatar_id":"","url":"https://api.github.com/users/KissKissBankBank","html_url":"https://github.com/KissKissBankBank","followers_url":"https://api.github.com/users/KissKissBankBank/followers","following_url":"https://api.github.com/users/KissKissBankBank/following{/other_user}","gists_url":"https://api.github.com/users/KissKissBankBank/gists{/gist_id}","starred_url":"https://api.github.com/users/KissKissBankBank/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KissKissBankBank/subscriptions","organizations_url":"https://api.github.com/users/KissKissBankBank/orgs","repos_url":"https://api.github.com/users/KissKissBankBank/repos","events_url":"https://api.github.com/users/KissKissBankBank/events{/privacy}","received_events_url":"https://api.github.com/users/KissKissBankBank/received_events","type":"Organization","site_admin":false},"repo":{"id":61292012,"name":"kitten","full_name":"KissKissBankBank/kitten","owner":{"login":"KissKissBankBank","id":6039709,"avatar_url":"https://avatars2.githubusercontent.com/u/6039709?v=3","gravatar_id":"","url":"https://api.github.com/users/KissKissBankBank","html_url":"https://github.com/KissKissBankBank","followers_url":"https://api.github.com/users/KissKissBankBank/followers","following_url":"https://api.github.com/users/KissKissBankBank/following{/other_user}","gists_url":"https://api.github.com/users/KissKissBankBank/gists{/gist_id}","starred_url":"https://api.github.com/users/KissKissBankBank/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KissKissBankBank/subscriptions","organizations_url":"https://api.github.com/users/KissKissBankBank/orgs","repos_url":"https://api.github.com/users/KissKissBankBank/repos","events_url":"https://api.github.com/users/KissKissBankBank/events{/privacy}","received_events_url":"https://api.github.com/users/KissKissBankBank/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/KissKissBankBank/kitten","description":"Front-end components library","fork":false,"url":"https://api.github.com/repos/KissKissBankBank/kitten","forks_url":"https://api.github.com/repos/KissKissBankBank/kitten/forks","keys_url":"https://api.github.com/repos/KissKissBankBank/kitten/keys{/key_id}","collaborators_url":"https://api.github.com/repos/KissKissBankBank/kitten/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/KissKissBankBank/kitten/teams","hooks_url":"https://api.github.com/repos/KissKissBankBank/kitten/hooks","issue_events_url":"https://api.github.com/repos/KissKissBankBank/kitten/issues/events{/number}","events_url":"https://api.github.com/repos/KissKissBankBank/kitten/events","assignees_url":"https://api.github.com/repos/KissKissBankBank/kitten/assignees{/user}","branches_url":"https://api.github.com/repos/KissKissBankBank/kitten/branches{/branch}","tags_url":"https://api.github.com/repos/KissKissBankBank/kitten/tags","blobs_url":"https://api.github.com/repos/KissKissBankBank/kitten/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/KissKissBankBank/kitten/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/KissKissBankBank/kitten/git/refs{/sha}","trees_url":"https://api.github.com/repos/KissKissBankBank/kitten/git/trees{/sha}","statuses_url":"https://api.github.com/repos/KissKissBankBank/kitten/statuses/{sha}","languages_url":"https://api.github.com/repos/KissKissBankBank/kitten/languages","stargazers_url":"https://api.github.com/repos/KissKissBankBank/kitten/stargazers","contributors_url":"https://api.github.com/repos/KissKissBankBank/kitten/contributors","subscribers_url":"https://api.github.com/repos/KissKissBankBank/kitten/subscribers","subscription_url":"https://api.github.com/repos/KissKissBankBank/kitten/subscription","commits_url":"https://api.github.com/repos/KissKissBankBank/kitten/commits{/sha}","git_commits_url":"https://api.github.com/repos/KissKissBankBank/kitten/git/commits{/sha}","comments_url":"https://api.github.com/repos/KissKissBankBank/kitten/comments{/number}","issue_comment_url":"https://api.github.com/repos/KissKissBankBank/kitten/issues/comments{/number}","contents_url":"https://api.github.com/repos/KissKissBankBank/kitten/contents/{+path}","compare_url":"https://api.github.com/repos/KissKissBankBank/kitten/compare/{base}...{head}","merges_url":"https://api.github.com/repos/KissKissBankBank/kitten/merges","archive_url":"https://api.github.com/repos/KissKissBankBank/kitten/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/KissKissBankBank/kitten/downloads","issues_url":"https://api.github.com/repos/KissKissBankBank/kitten/issues{/number}","pulls_url":"https://api.github.com/repos/KissKissBankBank/kitten/pulls{/number}","milestones_url":"https://api.github.com/repos/KissKissBankBank/kitten/milestones{/number}","notifications_url":"https://api.github.com/repos/KissKissBankBank/kitten/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/KissKissBankBank/kitten/labels{/name}","releases_url":"https://api.github.com/repos/KissKissBankBank/kitten/releases{/id}","deployments_url":"https://api.github.com/repos/KissKissBankBank/kitten/deployments","created_at":"2016-06-16T12:46:14Z","updated_at":"2017-03-16T17:10:30Z","pushed_at":"2017-04-18T15:58:11Z","git_url":"git://github.com/KissKissBankBank/kitten.git","ssh_url":"git@github.com:KissKissBankBank/kitten.git","clone_url":"https://github.com/KissKissBankBank/kitten.git","svn_url":"https://github.com/KissKissBankBank/kitten","homepage":"","size":1849,"stargazers_count":3,"watchers_count":3,"language":"HTML","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":56,"forks":0,"open_issues":56,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/KissKissBankBank/kitten/pulls/611"},"html":{"href":"https://github.com/KissKissBankBank/kitten/pull/611"},"issue":{"href":"https://api.github.com/repos/KissKissBankBank/kitten/issues/611"},"comments":{"href":"https://api.github.com/repos/KissKissBankBank/kitten/issues/611/comments"},"review_comments":{"href":"https://api.github.com/repos/KissKissBankBank/kitten/pulls/611/comments"},"review_comment":{"href":"https://api.github.com/repos/KissKissBankBank/kitten/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/KissKissBankBank/kitten/pulls/611/commits"},"statuses":{"href":"https://api.github.com/repos/KissKissBankBank/kitten/statuses/3035509abbcd6034e0a4546ae26341a688426537"}}}}
{"actor":{"display_login":"LanF3usT"}}