File tree Expand file tree Collapse file tree 3 files changed +15
-0
lines changed
Expand file tree Collapse file tree 3 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ title: Changelog
1616- ` @include ` with regions now works on files with CRLF line endings, #2902 .
1717- Generated page names now correctly handles UTF-8 characters requiring more than 16 bits #2905 .
1818- Fixed a crash when converting ` module.exports = [] ` , #2909 .
19+ - Fixed URL generation which introduced a superfluous ` ./ ` in relative links, #2910 .
1920
2021### Thanks!
2122
Original file line number Diff line number Diff line change @@ -254,6 +254,11 @@ export abstract class BaseRouter implements Router {
254254 if ( full [ i ] === "/" ) ++ slashes ;
255255 }
256256
257+ // #2910 avoid urls like ".././"
258+ if ( target == "./" && slashes !== 0 ) {
259+ return "../" . repeat ( slashes ) ;
260+ }
261+
257262 return "../" . repeat ( slashes ) + target ;
258263 }
259264
Original file line number Diff line number Diff line change @@ -150,6 +150,15 @@ describe("KindRouter", () => {
150150 router . baseRelativeUrl ( project , "assets/search.js" ) ,
151151 "assets/search.js" ,
152152 ) ;
153+
154+ equal (
155+ router . baseRelativeUrl ( Foo , "./" ) ,
156+ "../" ,
157+ ) ;
158+ equal (
159+ router . baseRelativeUrl ( project , "./" ) ,
160+ "./" ,
161+ ) ;
153162 } ) ;
154163
155164 it ( "Can get a full URL to a reflection" , ( ) => {
You can’t perform that action at this time.
0 commit comments