// markdown-it plugin for wrapping
 ... 
. // // If your plugin was chained before preWrapper, you can add additional element directly. // If your plugin was chained after preWrapper, you can use these slots: // 1. // 2. // 3. // 4. module.exports = md => { const wrap = (wrapped) => (...args) => { const [tokens, idx] = args const token = tokens[idx] const rawCode = wrapped(...args) return `
` + `${rawCode}
` } const { fence, code_block: codeBlock } = md.renderer.rules md.renderer.rules.fence = wrap(fence) md.renderer.rules.code_block = wrap(codeBlock) }