docs: ensure the all _ are replaced by slash for API entry urls. (#57600)

fixes #57599

PR Close #57600
This commit is contained in:
Matthieu Riegler 2024-08-30 11:15:13 +02:00 committed by Andrew Kushnir
parent 001f319865
commit 5e42769ee9
2 changed files with 10 additions and 1 deletions

View file

@ -30,6 +30,15 @@ describe('ManiferHelper', () => {
};
const result2 = getApiUrl(packageEntry2, apiName);
expect(result2).toBe('api/animations/browser/DatePipe');
const packageEntry3: ApiManifestPackage = {
moduleName: '@angular/common/http/testing',
moduleLabel: 'common/http/testing',
normalizedModuleName: 'angular_common_http_testing',
entries: [],
};
const result3 = getApiUrl(packageEntry3, apiName);
expect(result3).toBe('api/common/http/testing/DatePipe');
});
});
});

View file

@ -62,7 +62,7 @@ export function getApiUrl(packageEntry: ApiManifestPackage, apiName: string): st
// packages like `angular_core` should be `core`
// packages like `angular_animation_browser` should be `animation/browser`
.replace('angular_', '')
.replace('_', '/');
.replaceAll('_', '/');
return `${PagePrefix.API}/${packageName}/${apiName}`;
}