diff --git a/lib/rehype-sn.js b/lib/rehype-sn.js index fb35bf4b..231c0104 100644 --- a/lib/rehype-sn.js +++ b/lib/rehype-sn.js @@ -16,6 +16,11 @@ export default function rehypeSN (options = {}) { return function transformer (tree) { try { visit(tree, (node, index, parent) => { + if (parent?.tagName === 'code') { + // don't process code blocks + return + } + // Handle inline code property if (node.tagName === 'code') { node.properties.inline = !(parent && parent.tagName === 'pre')