src/language-markdown/preprocess.js/mergeChildren
function mergeChildren(ast, shouldMerge, mergeNode) {
  return mapAst(ast, (node) => {
    if (!node.children) {
      return node;
    }
    const children = node.children.reduce((current, child) => {
      const lastChild = current[current.length - 1];
      if (lastChild && shouldMerge(lastChild, child)) {
        current.splice(-1, 1, mergeNode(lastChild, child));
      } else {
        current.push(child);
      }
      return current;
    }, []);
    return { ...node, children };
  });
}