Skip to content

Commit cbe50b3

Browse files
authored
Merge pull request #10809 from dotty-staging/fix-doc-source-links-on-win
Scala3doc: fix rendering source links on Windows
2 parents 02fbd14 + 396f993 commit cbe50b3

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

scala3doc/src/dotty/dokka/SourceLinks.scala

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@ import dotty.dokka.model.api._
66
import dotty.tools.dotc.core.Contexts.Context
77
import scala.util.matching.Regex
88

9-
def pathToString(p: Path) = p.toString.replace('\\', '/')
9+
def pathToString(p: Path) =
10+
import scala.jdk.CollectionConverters._
11+
// !!! gives wrong result for absolute paths!
12+
p.iterator.asScala.mkString("/")
1013

1114
trait SourceLink:
1215
val path: Option[Path] = None
@@ -177,4 +180,4 @@ object SourceLinks:
177180
ctx.args.revision,
178181
// TODO (https://github.com/lampepfl/scala3doc/issues/240): configure source root
179182
Paths.get("").toAbsolutePath
180-
)
183+
)

0 commit comments

Comments
 (0)