File tree 1 file changed +9
-3
lines changed
scaladoc/src/dotty/tools/scaladoc/renderers
1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -30,9 +30,15 @@ trait SiteRenderer(using DocContext) extends Locations:
30
30
def siteContent (pageDri : DRI , content : ResolvedTemplate ): PageContent =
31
31
import content .ctx
32
32
def tryAsDri (str : String ): Option [String ] =
33
- val (path, prefix) = str match
33
+ val newStr =
34
+ str.dropWhile(c => c == '.' || c == '/' ).replaceAll(" /" , " ." ) match
35
+ case str if str.endsWith(" $.html" ) => str.stripSuffix(" $.html" )
36
+ case str if str.endsWith(" .html" ) => str.stripSuffix(" .html" )
37
+ case _ => str
38
+
39
+ val (path, prefix) = newStr match
34
40
case HashRegex (path, prefix) => (path, prefix)
35
- case _ => (str , " " )
41
+ case _ => (newStr , " " )
36
42
37
43
val res = ctx.driForLink(content.template.file, path).filter(driExists)
38
44
res.headOption.map(pathToPage(pageDri, _) + prefix)
@@ -49,7 +55,7 @@ trait SiteRenderer(using DocContext) extends Locations:
49
55
50
56
/* Link resolving checks performs multiple strategies with following priority:
51
57
1. We check if the link is a valid URL e.g. http://dotty.epfl.ch
52
- 2. We check if the link leads to other static site
58
+ 2. We check if the link leads to other static site or API pages, example: [[exemple.scala.Foo]] || [Foo](../exemple/scala/Foo.html)
53
59
3. We check if the link leads to existing asset e.g. images/logo.svg -> <static-site-root>/_assets/images/logo.svg
54
60
*/
55
61
You can’t perform that action at this time.
0 commit comments