{"size": 765, "ext": "js", "max_stars_repo_path": "docs/web_loaders/docgen-loader.js", "max_stars_repo_name": "kontur-recognition/retail-ui", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "docs/web_loaders/docgen-loader.js", "max_issues_repo_name": "kontur-recognition/retail-ui", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "docs/web_loaders/docgen-loader.js", "max_forks_repo_name": "kontur-recognition/retail-ui", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 23.1818181818, "max_line_length": 60, "alphanum_fraction": 0.6993464052}
var doctrine = require('doctrine');
var marked = require('marked');
var reactDocs = require('react-docgen');

marked.setOptions({
  renderer: new marked.Renderer(),
  gfm: true,
  tables: true,
  breaks: false,
  sanitize: true
});

module.exports = function(src) {
  this.cacheable();

  var info = reactDocs.parse(src);

  info.description = processDescription(info.description);
  for (var prop in info.props) {
    info.props[prop].description = processDescription(
      info.props[prop].description
    );
  }

  return 'module.exports = ' + JSON.stringify(info) + ';';
};

function processDescription(description) {
  const doctrineAST = doctrine.parse(description || '');
  doctrineAST.description = marked(doctrineAST.description);
  return doctrineAST;
}
