src/draft-to-markdown.js
function draftToMarkdown(rawDraftObject, options) {
  options = options || {};
  var markdownString = '';
  rawDraftObject.blocks.forEach(function (block, index) {
    markdownString += renderBlock(block, index, rawDraftObject, options);
  });

  orderedListNumber = {}; // See variable definitions at the top of the page to see why we have to do this sad hack.
  return markdownString;
}
function draftToMarkdown(rawDraftObject, options) {
  options = options || {};
  var markdownString = '';
  rawDraftObject.blocks.forEach(function (block, index) {
    markdownString += renderBlock(block, index, rawDraftObject, options);
  });

  orderedListNumber = {}; // See variable definitions at the top of the page to see why we have to do this sad hack.
  return markdownString;
}
function draftToMarkdown ( rawDraftObject , options ) { options = options || { } ; var markdownString = '' ; rawDraftObject . blocks . forEach ( function ( block , index ) { markdownString += renderBlock ( block , index , rawDraftObject , options ) ; } ) ; orderedListNumber = { } ; // See variable definitions at the top of the page to see why we have to do this sad hack. return markdownString ; }
Generate markdown for a raw draftjs object
DraftJS raw object contains an array of blocks, which is the main "structure"
of the text. Each block = a new line.

@param {Object} rawDraftObject - draftjs object to generate markdown for
@param {Object} options - optional additional data, see readme for what options can be passed in.

@return {String} markdown string
Generate markdown for a raw draftjs object DraftJS raw object contains an array of blocks which is the main structure of the text . Each block = a new line .