We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fdddfa6 commit 968a4e4Copy full SHA for 968a4e4
1 file changed
src/build/mdn-comments.ts
@@ -42,7 +42,12 @@ function extractSummary(markdown: string): string {
42
43
// Extract the first sentence (ending in . ! or ?)
44
const sentenceMatch = normalizedText.match(/(.*?[.!?])(?=\s|$)/);
45
- return sentenceMatch ? sentenceMatch[0] : normalizedText.split(" ")[0] || "";
+ if (sentenceMatch) {
46
+ return sentenceMatch[0];
47
+ }
48
+
49
+ const firstWord = normalizedText.split(" ")[0];
50
+ return firstWord || "";
51
}
52
53
async function walkDirectory(dir: URL): Promise<URL[]> {
0 commit comments