src/index.js
function mermaid(options = {}) {
  const simpleMode = options.simple || false;

  /**
   * @param {object} ast MDAST
   * @param {vFile} vFile
   * @param {function} next
   * @return {object}
   */
  return function transformer(ast, vFile, next) {
    visitCodeBlock(ast, vFile, simpleMode);
    visitLink(ast, vFile, simpleMode);
    visitImage(ast, vFile, simpleMode);

    if (typeof next === 'function') {
      return next(null, ast, vFile);
    }

    return ast;
  };
}
function mermaid(options = {}) {
  const simpleMode = options.simple || false;

  /**
   * @param {object} ast MDAST
   * @param {vFile} vFile
   * @param {function} next
   * @return {object}
   */
  return function transformer(ast, vFile, next) {
    visitCodeBlock(ast, vFile, simpleMode);
    visitLink(ast, vFile, simpleMode);
    visitImage(ast, vFile, simpleMode);

    if (typeof next === 'function') {
      return next(null, ast, vFile);
    }

    return ast;
  };
}
function mermaid ( options = { } ) { const simpleMode = options . simple || false ; /**
   * @param {object} ast MDAST
   * @param {vFile} vFile
   * @param {function} next
   * @return {object}
   */ return function transformer ( ast , vFile , next ) { visitCodeBlock ( ast , vFile , simpleMode ) ; visitLink ( ast , vFile , simpleMode ) ; visitImage ( ast , vFile , simpleMode ) ; if ( typeof next === 'function' ) { return next ( null , ast , vFile ) ; } return ast ; } ; }
Returns the transformer which acts on the MDAST tree and given VFile.

If `options.simple` is passed as a truthy value, the plugin will convert
to `<div class="mermaid">` rather than a SVG image.

@link https://github.com/unifiedjs/unified#function-transformernode-file-next
@link https://github.com/syntax-tree/mdast
@link https://github.com/vfile/vfile

@param {object} options
@return {function}
Returns the transformer which acts on the MDAST tree and given VFile .