File tree 1 file changed +1
-3
lines changed
1 file changed +1
-3
lines changed Original file line number Diff line number Diff line change @@ -37,15 +37,13 @@ function extractSummary(markdown: string): string {
37
37
"$1" ,
38
38
) // Handle event, jsxref, cssref, etc.
39
39
. replace ( / \{ \{ \s * ( [ ^ } ] + ) \s * \} \} / g, ( _ , match ) => `[MISSING: ${ match } ]` ) // Catch any remaining unhandled templates
40
- . replace ( / \{ \{ \s * ( [ ^ } ] + ) \s * \} \} / g, ( _ , match ) => `[MISSING: ${ match } ]` )
41
40
. replace ( / \[ ( .* ?) \] \( .* ?\) / g, "$1" ) // Keep link text but remove URLs
42
- . replace ( / \[ ( .* ?) \] \( .* ?\) / g, "$1" )
43
41
. replace ( / \s + / g, " " ) // Normalize spaces
44
- . replace ( / \s + / g, " " )
45
42
. replace ( / \n \s * / g, "\n" ) // Ensure line breaks are preserved
46
43
. replace ( / " / g, "'" )
47
44
. trim ( ) ;
48
45
46
+ // Extract the first sentence (ending in . ! or ?)
49
47
const sentenceMatch = normalizedText . match ( / ( .* ?[ . ! ? ] ) (? = \s | $ ) / ) ;
50
48
return sentenceMatch ? sentenceMatch [ 0 ] : normalizedText . split ( " " ) [ 0 ] || "" ;
51
49
}
You can’t perform that action at this time.
0 commit comments