Skip to content

Commit d97bcb7

Browse files
committed
-
1 parent e146dfe commit d97bcb7

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

src/build/emitter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -906,7 +906,7 @@ export function emitWebIdl(
906906
comments.push("Available only in secure contexts.");
907907
}
908908
if (entity.mdnUrl) {
909-
comments.push("");
909+
if (comments.length > 0) comments.push("");
910910
comments.push(`[MDN Reference](${entity.mdnUrl})`);
911911
}
912912

src/build/mdn-comments.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import fs from "fs/promises";
22
import { basename } from "path";
3+
34
const basePath = new URL(
45
"../../inputfiles/mdn/files/en-us/web/api/",
56
import.meta.url,
@@ -43,7 +44,7 @@ function extractSummary(markdown: string): string {
4344
// Extract the first sentence (ending in . ! or ?)
4445
const sentenceMatch = normalizedText.match(/(.*?[.!?])(?=\s|$)/);
4546
if (sentenceMatch) {
46-
return sentenceMatch[0];
47+
return sentenceMatch[0]; // Return the first full sentence
4748
}
4849

4950
const firstWord = normalizedText.split(" ")[0];

0 commit comments

Comments
 (0)