lib/format/markdown.js
function transformSnapshotList(name, snapshotList, depth, indentCodeBlocks) {
  let result = snapshotHeader(name, depth);

  for (let i = 0; i < snapshotList.length; i++) {
    if (i > 0 && indentCodeBlocks) {
      result += '---\n\n';
    }
    const snapshot = snapshotList[i];
    const lang = snapshot.lang;
    const code = snapshot.code;
    const delimiter = safeDelimiter(code);

    if (indentCodeBlocks) {
      const lines = code.split('\n');
      for (let i = 0; i < lines.length; i++) {
        result += '    ' + lines[i] + '\n';
      }
    } else {
      result += delimiter;
      if (lang) {
        result += lang;
      }
      result += '\n' + code + '\n' + delimiter + '\n';
    }

    result += '\n';
  }

  return result;
}
function transformSnapshotList(name, snapshotList, depth, indentCodeBlocks) {
  let result = snapshotHeader(name, depth);

  for (let i = 0; i < snapshotList.length; i++) {
    if (i > 0 && indentCodeBlocks) {
      result += '---\n\n';
    }
    const snapshot = snapshotList[i];
    const lang = snapshot.lang;
    const code = snapshot.code;
    const delimiter = safeDelimiter(code);

    if (indentCodeBlocks) {
      const lines = code.split('\n');
      for (let i = 0; i < lines.length; i++) {
        result += '    ' + lines[i] + '\n';
      }
    } else {
      result += delimiter;
      if (lang) {
        result += lang;
      }
      result += '\n' + code + '\n' + delimiter + '\n';
    }

    result += '\n';
  }

  return result;
}
transformSnapshotList converts snapshot list from native into markdown format.

@param {number} name Snapshot name.
@param {*} snapshotList Snapshot list.
@param {number} depth Snapshot depth.
@param {boolean} indentCodeBlocks  Use indentation for code blocks.
@returns Snapshot in a markdown format.