File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -89,14 +89,14 @@ const GlossaryInjector: React.FC<GlossaryInjectorProps> = ({ children }) => {
8989
9090 while ( ( match = regex . exec ( currentText ) ) ) {
9191 const matchedText = match [ 0 ] ; // The full matched text (may include plural suffix).
92-
92+
9393 // Find the base term from the glossary that matches (without plural).
9494 const baseTerm = terms . find ( term =>
9595 matchedText . toLowerCase ( ) === term . toLowerCase ( ) ||
9696 matchedText . toLowerCase ( ) === `${ term . toLowerCase ( ) } s` ||
9797 matchedText . toLowerCase ( ) === `${ term . toLowerCase ( ) } es`
9898 ) ;
99-
99+
100100 if ( ! baseTerm ) {
101101 // Skip if no matching base term found.
102102 continue ;
@@ -116,11 +116,11 @@ const GlossaryInjector: React.FC<GlossaryInjectorProps> = ({ children }) => {
116116 tooltipWrapper . className = 'glossary-term' ;
117117
118118 const definition = glossary [ baseTerm ] ;
119-
119+
120120 // Extract the part to underline (the base term) and the suffix (if plural).
121121 let textToUnderline = matchedText ;
122122 let suffix = '' ;
123-
123+
124124 if ( matchedText . toLowerCase ( ) !== baseTerm . toLowerCase ( ) ) {
125125 // This is a plural form - only underline the base part.
126126 const baseTermLength = baseTerm . length ;
You can’t perform that action at this time.
0 commit comments