${lines}`; } ); // 4.5) Unordered lists escaped = escaped.replace( /(^|\n)([ \t]*[-*] .+(?:\n[ \t]*[-*] .+)*)/g, (_, lead, listBlock) => { const items = listBlock .split(/\n/) .map(line => line.replace(/^[ \t]*[-*]\s+/, '').trim()) .map(item => `
$1");
// 5.5) Links
html = html.replace(/\[([^\]]+?)\]\(([^)]+?)\)/g, '$1 $2');
// 6) Convert line-breaks to