Remove redundant sentanceEnders check to reduce false positive.

This commit is contained in:
coolbot100s 2025-07-28 21:04:55 -07:00
parent 1d34a5989e
commit f66bafc06b

View File

@ -20,11 +20,10 @@ function analyzeHeaderLength(markdown: string): { hasLongHeaders: boolean; longH
const sentenceEnders = /[.!?]+/g const sentenceEnders = /[.!?]+/g
const sentences = headerText.split(sentenceEnders).filter((s) => s.trim().length > 0) const sentences = headerText.split(sentenceEnders).filter((s) => s.trim().length > 0)
const hasSentenceEnders = sentenceEnders.test(headerText)
const isVeryLong = headerText.length > MAX_HEADER_LENGTH const isVeryLong = headerText.length > MAX_HEADER_LENGTH
const hasMultipleSentences = sentences.length > 1 const hasMultipleSentences = sentences.length > 1
if (hasSentenceEnders || isVeryLong || hasMultipleSentences) { if (isVeryLong || hasMultipleSentences) {
longHeaders.push(headerText) longHeaders.push(headerText)
} }
}) })