Skip to content

Commit cd95561

Browse files
committed
Try a correction to scala3 and for link to Object
1 parent ad5f3c9 commit cd95561

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
@@ -47,13 +47,14 @@ trait SiteRenderer(using DocContext) extends Locations:
4747
)
4848
def asStaticSite: Option[String] = tryAsDri(str)
4949
def asApiLink: Option[String] =
50-
{
51-
val strWithoutHtml = str.stripSuffix(".html").stripPrefix("/")
50+
val strWithoutHtml = if str.endsWith("$.html") then
51+
str.stripSuffix("$.html")
52+
else
53+
str.stripSuffix(".html")
5254
val sourceDir = Paths.get("src", "main", "scala")
5355
val scalaPath = sourceDir.resolve(s"$strWithoutHtml.scala")
5456
val scalaDirPath = sourceDir.resolve(strWithoutHtml)
5557
Option.when(Files.exists(scalaPath)|| Files.exists(scalaDirPath))(resolveLink(pageDri, str))
56-
}
5758

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

0 commit comments

Comments
 (0)