diff --git a/packages/rehype-jargon/src/index.mjs b/packages/rehype-jargon/src/index.mjs index a8b9f8548ce..411d8e5ea8a 100644 --- a/packages/rehype-jargon/src/index.mjs +++ b/packages/rehype-jargon/src/index.mjs @@ -17,6 +17,7 @@ export default (options) => { const isJargon = (node) => { if ( node.tagName === 'em' && + node.children.every((n) => n.type === 'text') && Object.keys(options.jargon).indexOf(node.children[0].value.toLowerCase()) !== -1 ) return true