Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9553c6f

Browse files
committed
Merge pull request scala#2549 from vigdorchik/slash_slash
Prevent slash duplication.
2 parents 3ba3d04 + f628565 commit 9553c6f

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/compiler/scala/tools/nsc/doc/Settings.scala

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -249,10 +249,7 @@ class Settings(error: String => Unit, val printMsg: String => Unit = println(_))
249249
}
250250
}
251251

252-
def appendIndex(url: String): String = {
253-
val index = "/index.html"
254-
if (url.endsWith(index)) url else url + index
255-
}
252+
def appendIndex(url: String): String = url.stripSuffix("index.html").stripSuffix("/") + "/index.html"
256253

257254
// Deprecated together with 'docExternalUrls' option.
258255
lazy val extUrlPackageMapping: Map[String, String] = (Map.empty[String, String] /: docExternalUrls.value) {

0 commit comments

Comments
 (0)