{"action":"created","issue":{"url":"https://api.github.com/repos/Umbrellagun/debate-dissector/issues/21","repository_url":"https://api.github.com/repos/Umbrellagun/debate-dissector","labels_url":"https://api.github.com/repos/Umbrellagun/debate-dissector/issues/21/labels{/name}","comments_url":"https://api.github.com/repos/Umbrellagun/debate-dissector/issues/21/comments","events_url":"https://api.github.com/repos/Umbrellagun/debate-dissector/issues/21/events","html_url":"https://github.com/Umbrellagun/debate-dissector/issues/21","id":146054713,"number":21,"title":"Figure out Syntax for Draft.js","user":{"login":"Umbrellagun","id":8887370,"avatar_url":"https://avatars.githubusercontent.com/u/8887370?v=3","gravatar_id":"","url":"https://api.github.com/users/Umbrellagun","html_url":"https://github.com/Umbrellagun","followers_url":"https://api.github.com/users/Umbrellagun/followers","following_url":"https://api.github.com/users/Umbrellagun/following{/other_user}","gists_url":"https://api.github.com/users/Umbrellagun/gists{/gist_id}","starred_url":"https://api.github.com/users/Umbrellagun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Umbrellagun/subscriptions","organizations_url":"https://api.github.com/users/Umbrellagun/orgs","repos_url":"https://api.github.com/users/Umbrellagun/repos","events_url":"https://api.github.com/users/Umbrellagun/events{/privacy}","received_events_url":"https://api.github.com/users/Umbrellagun/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Umbrellagun/debate-dissector/labels/help%20wanted","name":"help wanted","color":"159818"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-04-05T17:23:55Z","updated_at":"2016-04-06T21:23:52Z","closed_at":"2016-04-06T21:01:35Z","body":"I am working with Draft.js to create a rich text editor for my project. I have implemented it to the point that it is working in it's own right, but now I need to save the result of the editor to a database. The below link is the only documentation I found for how to convert the React side of Draft.js into a json object. (no official support for pure html and css yet) It's pretty vague and I do not recognize the syntax they are using.\r\n\r\nhttps://facebook.github.io/draft-js/docs/api-reference-data-conversion.html#content"},"comment":{"url":"https://api.github.com/repos/Umbrellagun/debate-dissector/issues/comments/206576784","html_url":"https://github.com/Umbrellagun/debate-dissector/issues/21#issuecomment-206576784","issue_url":"https://api.github.com/repos/Umbrellagun/debate-dissector/issues/21","id":206576784,"user":{"login":"Umbrellagun","id":8887370,"avatar_url":"https://avatars.githubusercontent.com/u/8887370?v=3","gravatar_id":"","url":"https://api.github.com/users/Umbrellagun","html_url":"https://github.com/Umbrellagun","followers_url":"https://api.github.com/users/Umbrellagun/followers","following_url":"https://api.github.com/users/Umbrellagun/following{/other_user}","gists_url":"https://api.github.com/users/Umbrellagun/gists{/gist_id}","starred_url":"https://api.github.com/users/Umbrellagun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Umbrellagun/subscriptions","organizations_url":"https://api.github.com/users/Umbrellagun/orgs","repos_url":"https://api.github.com/users/Umbrellagun/repos","events_url":"https://api.github.com/users/Umbrellagun/events{/privacy}","received_events_url":"https://api.github.com/users/Umbrellagun/received_events","type":"User","site_admin":false},"created_at":"2016-04-06T21:23:52Z","updated_at":"2016-04-06T21:23:52Z","body":"Needed to be using convertToRaw(), not convertFromRaw().\r\n\r\nShould probably be called convertToJson() and convertFromJson(). I was thinking \"raw\" meant \"raw Draft/React data\". Json doesn't seem 'raw' to me.\r\n\r\nAlso, Draft.js has some strange sudo code for documentation that was confusing me. The below sudo code documentation:\r\n\r\nconvertFromRaw(rawState: RawDraftContentState): Array<ContentBlock>\r\n\r\nboils down to:\r\n\r\nconvertFromRaw(rawState)\r\n\r\nWhatever is on the right side of the colon after \"rawState\" and after the closing parentheses represents  the data type expected to either be returned or to be placed in those spots. The fact that it can be either of those options (what the code is expecting or what it is returning) makes it confusing. Plus, \"rawState\" can be called whatever you want, so long as it 'is' the data type on the right side of the colon (\"RawDraftContentState\") which is further confusing because \"RawDraftContentState\" is still more of a describer than an official documented term. Although it looks like you can get this other ways, one way the \"RawDraftContentState\" can be generated is by pulling it from editorState via calling .getCurrentContent() on it (Like so: editorState.getCurrentContent();).\r\n\r\nYou could even say that the order in which the documentation presents their sudo code is logically backwards seeing as you would most likely want to convert the Draft.js data into a json object 'first' so you can put it into a database, and not the other way around. But you are instead presented with the sudo code for converting the json object (that you can only get from first doing the second presented conversion) back into data that Draft.js understands."}}