Skip to content

Commit 33ec97a

Browse files
committed
fix: update relative link handling
1 parent 6e45024 commit 33ec97a

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/core/render/compiler/link.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,8 @@ export const linkCompiler = ({
3434
href.indexOf('mailto:') !== 0 && attrs.push(`target="${linkTarget}"`);
3535
}
3636
} else {
37-
if (!isAbsolutePath(href) && href.slice(0, 2) === './') {
38-
href =
39-
document.URL.replace(/\/(?!.*\/).*/, '/').replace('#/./', '') + href;
37+
if (!isAbsolutePath(href) && href.startsWith('./')) {
38+
href = router.toURL(href, null, router.getCurrentPath()).replace(/^#\//, '/');
4039
}
4140
attrs.push(href.indexOf('mailto:') === 0 ? '' : `target="${linkTarget}"`);
4241
attrs.push(

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy