1
0
Fork 0

Merge pull request #6778 from jlvandenhout/fix/check-only-text-elements

fix(rehype-jargon): Ignore `em` elements that contain nested elements
This commit is contained in:
Joost De Cock 2024-06-12 15:01:08 +02:00 committed by GitHub
commit e2a8e85ba2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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