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

fix language of code block and add the corresponding test #16

Closed youking-lib closed 7 years ago

youking-lib commented 7 years ago

When I use this package, I find language of "code-block" lost in converting. But I can only provide limited help for this.

kadikraman commented 7 years ago

This is a great addition. The only problem is that we need to be able to go both ways. You've written the draftjs -> markdown, but we would also need markdown -> draft.js. So that given

```js\nconst country = Estonia;\n```

as an input, it should be able to generate the correct draft.js blocks. Otherwise, we can import the correct markdown into the draft.js editor, but we can't ever save it correctly.