File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -37,15 +37,13 @@ function extractSummary(markdown: string): string {
3737 "$1" ,
3838 ) // Handle event, jsxref, cssref, etc.
3939 . replace ( / \{ \{ \s * ( [ ^ } ] + ) \s * \} \} / g, ( _ , match ) => `[MISSING: ${ match } ]` ) // Catch any remaining unhandled templates
40- . replace ( / \{ \{ \s * ( [ ^ } ] + ) \s * \} \} / g, ( _ , match ) => `[MISSING: ${ match } ]` )
4140 . replace ( / \[ ( .* ?) \] \( .* ?\) / g, "$1" ) // Keep link text but remove URLs
42- . replace ( / \[ ( .* ?) \] \( .* ?\) / g, "$1" )
4341 . replace ( / \s + / g, " " ) // Normalize spaces
44- . replace ( / \s + / g, " " )
4542 . replace ( / \n \s * / g, "\n" ) // Ensure line breaks are preserved
4643 . replace ( / " / g, "'" )
4744 . trim ( ) ;
4845
46+ // Extract the first sentence (ending in . ! or ?)
4947 const sentenceMatch = normalizedText . match ( / ( .* ?[ . ! ? ] ) (? = \s | $ ) / ) ;
5048 return sentenceMatch ? sentenceMatch [ 0 ] : normalizedText . split ( " " ) [ 0 ] || "" ;
5149}
You can’t perform that action at this time.
0 commit comments