export default (input, visitors) => { const ast = marked.parse(input); const { transformedAst, transformed } = transform(ast, visitors); const toAppend = !transformed ? visitors.onEndWithNoTransformation() : []; const renderer = new MdRenderer({}); return marked.render(transformedAst.concat(toAppend), renderer); };
export function getSubIssuesList(input) { const ast = marked.parse(input); let currentSection; return find(ast, node => { // keep track of the current section if (node.type === 'heading') { currentSection = node; } return currentSection && includes(currentSection.text[0], 'sub-issues') && node.type === 'list'; }); }