diff --git a/lib/remark-glossary.ts b/lib/remark-glossary.ts index 3b87950e6..95e7fec7f 100644 --- a/lib/remark-glossary.ts +++ b/lib/remark-glossary.ts @@ -78,6 +78,17 @@ export function remarkGlossary(options: RemarkGlossaryOptions) { return SKIP; } + // Skip text already inside a GlossaryTerm we inserted. After a term + // is wrapped mid-sentence the visitor descends into the new node; + // re-wrapping a shorter term here nests a