Skip to content

Commit c4062ba

Browse files
Bashamegasaschanaz
andauthored
Update src/build/mdn-comments.ts
Co-authored-by: Kagami Sascha Rosylight <saschanaz@outlook.com>
1 parent 8673704 commit c4062ba

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/build/mdn-comments.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@ function generateTypes(content: string): string[] | undefined {
8989
function generateSlug(content: string): string[] {
9090
const match = content.match(/slug:\s*["']?([^"'\n]+)["']?/)!;
9191
const url = match[1].split(":").pop()!;
92-
const parts = url.split("/").slice(2); // skip `/en-US/web/api/...`
92+
const normalized = url.endsWith("_static") ? url.slice(0, -7) : url;
93+
const parts = normalized.split("/").slice(2); // skip `/en-US/web/api/...`
9394
return parts; // Keep only top-level and method
9495
}
9596

0 commit comments

Comments
 (0)