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

Block quote conversion failing #19

Closed El-Gregory closed 7 years ago

El-Gregory commented 7 years ago

@kadikraman My block quotes dont seem to be being translated.

Here is my editor state:

{"entityMap":{},"blocks":[{"key":"dh94v","text":"Here is a block quote.","type":"blockquote","depth":0,"inlineStyleRanges":[],"entityRanges":[],"data":{}}]}

Here is the draftToMD output:

Here is a block quote.

whereas this is the expected result:

> Here is a block quote.

I added block quote to the dictionary to no avail.

const myMdDict = {
  EMPHASIS: '*',
  BOLD: '**',
  STRIKETHROUGH: '~~',
  UNDERLINE: '__',
  CODE: '```',
  BLOCKQUOTE: '>'
};
const newMarkdown = draftjsToMd(editorState, myMdDict);

I'm using the react-draft-wysiwyg editor plugin to create the block quote.

kadikraman commented 7 years ago

Hey @El-Gregory thanks for pointing this out 😊 Try 0.1.3 - that should fix it.