jpuri / react-draft-wysiwyg

A Wysiwyg editor build on top of ReactJS and DraftJS. https://jpuri.github.io/react-draft-wysiwyg
MIT License
6.41k stars 1.16k forks source link

handling output data #542

Open mirik999 opened 6 years ago

mirik999 commented 6 years ago

Hi people , when i am checking editorState with console.log , i am getting data like this EditorState {_immutable: Record} , how can i handle this data for sending to the API .

i need output in HTML.

jpuri commented 6 years ago

Check this @mirik999 : https://github.com/jpuri/react-draft-wysiwyg/blob/master/docs/src/components/Demo/EditorConvertToHTML/index.js#L46

mirik999 commented 6 years ago

Yes , thanx , this problem is solved.

P.S. image (left center right) doesnt work with bootstrap 4.

jpuri commented 6 years ago

The image stuff seems to be a css issue may be something is getting effected by bootstrap styles. Needs debugging :(

mirik999 commented 6 years ago

Dear Jpuri , how can i set className for img tag and pre code tags ? i tired to change components in src folders and then to run npm run build , but i got an error about webpack.config.js .. I need to set img-fluid for images and highlight.js settings to pre - code tags for beautifuly code screen

jpuri commented 6 years ago

Hey @mirik999 , you can check classnames in this file which you also must have imported : https://github.com/jpuri/react-draft-wysiwyg/blob/master/docs/src/index.js#L15

And you can over-ride those styles.

mirik999 commented 6 years ago

I need to change html (jsx) . i cant set highlight or prism .

mirik999 commented 6 years ago

after pre i need code tags for highlighting , but .. after pre nothing.

jpuri commented 6 years ago

@mirik999 : you need to over-ride css classes in this css file react-draft-wysiwyg.css.

mirik999 commented 6 years ago

No , i need to change HTML , because , after pre tags is missing code tags. + span tag for every line in this tags. Or if you have an example how to include highlight (or prism or other plugin) , please , give the link.