Don't parse content in code blocks (#1899)
This commit is contained in:
parent
3cdf5c9451
commit
77781e07ed
@ -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')
|
||||
|
Loading…
x
Reference in New Issue
Block a user