kadikraman / draftjs-md-converter

Converts content from Draft.js blocks to Markdown and vice versa.
https://kadikraman.github.io/draftjs-md-converter/
MIT License
145 stars 37 forks source link

Update readme instructions #6

Closed Rosey closed 7 years ago

Rosey commented 7 years ago

The usage instructions on the readme were incorrect for both draftjsToMd and mdToDraftjs, this commit seeks to remedy that :)

For draftjsToMd - The function expects a raw object, not the blocks array. For mdToDraftjs - convertFromRaw on the raw object returned from mdToDraftJs is a contentState object, no createFromBlockArray required.


Hi @kadikraman hopefully this looks right to you 😊 I was super confused when I added your package and was getting js errors. Then I checked out the source and realized that the readme instructions weren't quite 100% accurate!

Thanks!

kadikraman commented 7 years ago

Hi Rosey! You're absolutely right! They changed the API for this in one of the earlier releases and I updated it in the project I was using this in, but completely forgot to change the readme. Thanks a lot! I'll have a proper look tomorrow 😊