{"action":"created","issue":{"url":"https://api.github.com/repos/jpuri/draftjs-to-html/issues/28","repository_url":"https://api.github.com/repos/jpuri/draftjs-to-html","labels_url":"https://api.github.com/repos/jpuri/draftjs-to-html/issues/28/labels{/name}","comments_url":"https://api.github.com/repos/jpuri/draftjs-to-html/issues/28/comments","events_url":"https://api.github.com/repos/jpuri/draftjs-to-html/issues/28/events","html_url":"https://github.com/jpuri/draftjs-to-html/issues/28","id":275631835,"node_id":"MDU6SXNzdWUyNzU2MzE4MzU=","number":28,"title":"Wrong image alignment","user":{"login":"StanislavMayorov","id":11670429,"node_id":"MDQ6VXNlcjExNjcwNDI5","avatar_url":"https://avatars0.githubusercontent.com/u/11670429?v=4","gravatar_id":"","url":"https://api.github.com/users/StanislavMayorov","html_url":"https://github.com/StanislavMayorov","followers_url":"https://api.github.com/users/StanislavMayorov/followers","following_url":"https://api.github.com/users/StanislavMayorov/following{/other_user}","gists_url":"https://api.github.com/users/StanislavMayorov/gists{/gist_id}","starred_url":"https://api.github.com/users/StanislavMayorov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StanislavMayorov/subscriptions","organizations_url":"https://api.github.com/users/StanislavMayorov/orgs","repos_url":"https://api.github.com/users/StanislavMayorov/repos","events_url":"https://api.github.com/users/StanislavMayorov/events{/privacy}","received_events_url":"https://api.github.com/users/StanislavMayorov/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2017-11-21T08:57:41Z","updated_at":"2018-12-11T13:33:00Z","closed_at":null,"author_association":"NONE","body":"Hi. Thank you for your projects.\r\nI think image center/left/right align convertation doesn't work properly. A html output looks differently than in editor. https://fiddle.jshell.net/b5j7ardx/1/\r\n\r\n```\r\n<p>Hey this <strong>editor</strong> rocks</p>\r\n<img src=\"https://www.shareicon.net/data/128x128/2016/07/08/117367_logo_512x512.png\" alt=\"undefined\" style=\"float:none;height: auto;width: auto\"/>\r\n<p>bar</p>\r\n```\r\n\r\n![image](https://user-images.githubusercontent.com/11670429/33062677-30106d5c-ceb1-11e7-8c15-5d0a46f07208.png)\r\n"},"comment":{"url":"https://api.github.com/repos/jpuri/draftjs-to-html/issues/comments/446203417","html_url":"https://github.com/jpuri/draftjs-to-html/issues/28#issuecomment-446203417","issue_url":"https://api.github.com/repos/jpuri/draftjs-to-html/issues/28","id":446203417,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0NjIwMzQxNw==","user":{"login":"Bariyard","id":4732953,"node_id":"MDQ6VXNlcjQ3MzI5NTM=","avatar_url":"https://avatars0.githubusercontent.com/u/4732953?v=4","gravatar_id":"","url":"https://api.github.com/users/Bariyard","html_url":"https://github.com/Bariyard","followers_url":"https://api.github.com/users/Bariyard/followers","following_url":"https://api.github.com/users/Bariyard/following{/other_user}","gists_url":"https://api.github.com/users/Bariyard/gists{/gist_id}","starred_url":"https://api.github.com/users/Bariyard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Bariyard/subscriptions","organizations_url":"https://api.github.com/users/Bariyard/orgs","repos_url":"https://api.github.com/users/Bariyard/repos","events_url":"https://api.github.com/users/Bariyard/events{/privacy}","received_events_url":"https://api.github.com/users/Bariyard/received_events","type":"User","site_admin":false},"created_at":"2018-12-11T13:33:00Z","updated_at":"2018-12-11T13:33:00Z","author_association":"NONE","body":"@mparker11 \r\nThank you for very helpful suggestion.\r\nI use part of your code in my project, and add it to customEntityTransform to process 'IMAGE' Entity\r\n\r\n```javascript\r\nrenderHTML(draftToHtml( JSON.parse(this.state.current.content),\r\n  {\r\n    trigger: '#',\r\n    separator: ' ',\r\n  }, \r\n  true,\r\n  (entity, text) => {\r\n    if (entity.type === 'IMAGE') {\r\n      var textAlign = 'none'; \r\n      if (entity.data.alignment) {\r\n          //entity.data.alignment is for float using the LCR options on the image\r\n          //'none' means the user clicked center\r\n          if (entity.data.alignment === 'none') { \r\n              textAlign = 'center';\r\n          } else {\r\n              textAlign = entity.data.alignment;\r\n          }\r\n      }\r\n      return '<p style=\"text-align:' + textAlign + ';\"><img src=\"' + entity.data.src + '\" alt=\"' + entity.data.alt + '\" style=\"height: ' + entity.data.height + ';width: ' + entity.data.width + '\"/></p>';\r\n    }\r\n}))\r\n```"}}
{"actor":{"display_login":"Bariyard"}}