jhogue/inclusive-language

Issue with Regex or order of operations

Open

#9 aperta il 18 ago 2025

Vedi su GitHub
 (0 commenti) (0 reazioni) (0 assegnatari)CSS (1 fork)github user discovery
bugenhancementhelp wanted

Metriche repository

Star
 (3 star)
Metriche merge PR
 (Metriche PR in attesa)

Descrizione

Line 109 and 100 of the JS file state:

// Right now we have a problem where words in the explanation are also searched and flagged as a problematic word/phrase. Test with the word “black” // Because of this, a phase like “black list” will never match because “black” is matched first

I'd like to figure out a way around this. I would bet that the Regex (line 52) might be able to avoid matching on words inside the title attribute. Or, the order in which words are matched needs to change. Or or the results need to be stored in an array before they are output, which might avoid being checked again in a loop.

Guida contributor