We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent aa2ed0f commit b231adfCopy full SHA for b231adf
packages/gitbook/src/lib/links.ts
@@ -82,7 +82,9 @@ export function baseUrl(): string {
82
*/
83
export function absoluteHref(href: string, withHost: boolean = false): string {
84
const base = withHost ? baseUrl() : basePath();
85
- return `${base}${href.startsWith('/') ? href.slice(1) : href}`;
+ const absoluteHref = `${base}${href.startsWith('/') ? href.slice(1) : href}`;
86
+ // Trim trailing slashes
87
+ return absoluteHref.replace(/\/$/, '');
88
}
89
90
/**
0 commit comments