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:
commit
e2a8e85ba2
1 changed files with 1 additions and 0 deletions
|
@ -17,6 +17,7 @@ export default (options) => {
|
||||||
const isJargon = (node) => {
|
const isJargon = (node) => {
|
||||||
if (
|
if (
|
||||||
node.tagName === 'em' &&
|
node.tagName === 'em' &&
|
||||||
|
node.children.every((n) => n.type === 'text') &&
|
||||||
Object.keys(options.jargon).indexOf(node.children[0].value.toLowerCase()) !== -1
|
Object.keys(options.jargon).indexOf(node.children[0].value.toLowerCase()) !== -1
|
||||||
)
|
)
|
||||||
return true
|
return true
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue