Skip to content

Commit a567dee

Browse files
committed
fix(build): add patch for generate-routes explicit anchor ID
1 parent c530eca commit a567dee

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Workaround until this issue has been resolved: https://github.com/angular/angular/pull/67201
2+
diff --git a/adev/scripts/routes/generate-routes.mts b/adev/scripts/routes/generate-routes.mts
3+
index 605262d172..8ef9d7ead2 100644
4+
--- a/adev/scripts/routes/generate-routes.mts
5+
+++ b/adev/scripts/routes/generate-routes.mts
6+
@@ -75,6 +75,11 @@ main();
7+
8+
// TODO: refactor so this function is shared with the generation pipeline (adev/shared-docs/pipeline/shared/marked/transformations/heading.mts)
9+
function getIdFromHeading(heading: string): string {
10+
+ // Check for explicit ID in {#id} format (used in translations)
11+
+ const explicitIdMatch = heading.match(/\{#([^}]+)\}/);
12+
+ if (explicitIdMatch) {
13+
+ return explicitIdMatch[1];
14+
+ }
15+
return heading
16+
.toLowerCase()
17+
.replace(/\s|\//g, '-') // replace spaces and slashes with dashes

0 commit comments

Comments
 (0)