Skip to content

Commit 16ef393

Browse files
committed
-
1 parent 576b872 commit 16ef393

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/build/mdn-comments.ts

+1-3
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)