Rosey / markdown-draft-js

A tool to convert content created in DraftJS to markdown and vice versa.
https://rosey.github.io/markdown-draft-js/
MIT License
317 stars 70 forks source link

Block codes in markdown are removed #148

Open CarlosVazPI opened 3 years ago

CarlosVazPI commented 3 years ago

I have a Draft editor using markdown, which I implemented using markdown-draft-js.

I noticed that when passing a markdown with a code block inside to markdownToDraft, the output doesn't contain any of that code block.

I set up this codesandbox test case to illustrate this point.

Is there any option to let markdownToDraft parse the content of the code blocks?

Context

Sometimes the user indents their input (adding four spaces at the beginning of a line), which in markdown is syntax to create a code block.

When they do so and their input is stored, and then they want to edit and what they typed in is retrieved, when markdownToDraft is applied to it in order to present it through a Draft editor, markdownToDraft removes the "indented" lines.

mdugue commented 3 years ago

same here. @CarlosVazPI any news? Did you find a way to solve or work around?