const zws = String . fromCharCode ( 8203 ) ; param language param expression export function codeBlock < T > ( language , expression ) { if ( typeof expression === 'string' ) { if ( expression . length === 0 ) return `\`\`\`${ zws }\`\`\`` ; return `\`\`\`${ language }\n${ expression . replace ( /```/ , `\`${ zws }\`\`` ) . replace ( /`$/g , `\`${ zws }` ) }\`\`\`` ; } return `\`\`\`${ language }\n${ expression || zws }\`\`\`` ; }