/* 处理code */ module.exports = function codeWrapper(html) { const group = html.replace(/<\/pre>/g, ':::').split(':::'); const codeOnline = `
`; return group .map(fragment => { if (fragment.indexOf('demo') !== -1) { return fragment.replace('demo
', '') + codeOnline; } return fragment; }) .join(''); };