There was an error while loading. Please reload this page.
1 parent 28f1ed9 commit fc8065bCopy full SHA for fc8065b
packages/gitbook/src/lib/links.ts
@@ -79,14 +79,9 @@ export function baseUrl(): string {
79
80
/**
81
* Create an absolute href in the current content.
82
- * If it's the root URL, the trailing slash will be removed.
83
*/
84
export function absoluteHref(href: string, withHost: boolean = false): string {
85
const base = withHost ? baseUrl() : basePath();
86
- if (href === '') {
87
- // Remove the trailing slash if it's the root URL
88
- return base.slice(0, -1);
89
- }
90
return `${base}${href.startsWith('/') ? href.slice(1) : href}`;
91
}
92
0 commit comments