Skip to content

Commit 1b6509c

Browse files
committed
Try a correction to scala3 and for link to Object
1 parent 2b835d7 commit 1b6509c

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

scaladoc/src/dotty/tools/scaladoc/renderers/SiteRenderer.scala

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,14 @@ trait SiteRenderer(using DocContext) extends Locations:
4848
)
4949
def asStaticSite: Option[String] = tryAsDri(str)
5050
def asApiLink: Option[String] =
51-
{
52-
val strWithoutHtml = str.stripSuffix(".html").stripPrefix("/")
51+
val strWithoutHtml = if str.endsWith("$.html") then
52+
str.stripSuffix("$.html")
53+
else
54+
str.stripSuffix(".html")
5355
val sourceDir = Paths.get("src", "main", "scala")
5456
val scalaPath = sourceDir.resolve(s"$strWithoutHtml.scala")
5557
val scalaDirPath = sourceDir.resolve(strWithoutHtml)
5658
Option.when(Files.exists(scalaPath)|| Files.exists(scalaDirPath))(resolveLink(pageDri, str))
57-
}
5859

5960
/* Link resolving checks performs multiple strategies with following priority:
6061
1. We check if the link is a valid URL e.g. http://dotty.epfl.ch

0 commit comments

Comments
 (0)