From f66bafc06bd50cda89cfd05c04cb6befffec0dc7 Mon Sep 17 00:00:00 2001 From: coolbot100s <76798835+coolbot100s@users.noreply.github.com> Date: Mon, 28 Jul 2025 21:04:55 -0700 Subject: [PATCH] Remove redundant sentanceEnders check to reduce false positive. --- packages/moderation/data/nags/description.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/moderation/data/nags/description.ts b/packages/moderation/data/nags/description.ts index 31528caf1..6e75cd28a 100644 --- a/packages/moderation/data/nags/description.ts +++ b/packages/moderation/data/nags/description.ts @@ -20,11 +20,10 @@ function analyzeHeaderLength(markdown: string): { hasLongHeaders: boolean; longH const sentenceEnders = /[.!?]+/g const sentences = headerText.split(sentenceEnders).filter((s) => s.trim().length > 0) - const hasSentenceEnders = sentenceEnders.test(headerText) const isVeryLong = headerText.length > MAX_HEADER_LENGTH const hasMultipleSentences = sentences.length > 1 - if (hasSentenceEnders || isVeryLong || hasMultipleSentences) { + if (isVeryLong || hasMultipleSentences) { longHeaders.push(headerText) } })