File tree 1 file changed +9
-1
lines changed
scaladoc/src/dotty/tools/scaladoc/renderers
1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,14 @@ trait SiteRenderer(using DocContext) extends Locations:
29
29
30
30
def siteContent (pageDri : DRI , content : ResolvedTemplate ): PageContent =
31
31
import content .ctx
32
+
33
+ def tryAsDriPlain (str : String ): Option [String ] =
34
+ val (path, prefix) = str match
35
+ case HashRegex (path, prefix) => (path, prefix)
36
+ case _ => (str, " " )
37
+ val res = ctx.driForLink(content.template.file, path).filter(driExists)
38
+ res.headOption.map(pathToPage(pageDri, _) + prefix)
39
+
32
40
def tryAsDri (str : String ): Option [String ] =
33
41
val newStr =
34
42
str.dropWhile(c => c == '.' || c == '/' ).replaceAll(" /" , " ." ) match
@@ -51,7 +59,7 @@ trait SiteRenderer(using DocContext) extends Locations:
51
59
)(
52
60
resolveLink(pageDri, str.stripPrefix(" /" ))
53
61
)
54
- def asStaticSite : Option [String ] = tryAsDri(str)
62
+ def asStaticSite : Option [String ] = tryAsDriPlain(str).orElse( tryAsDri(str) )
55
63
56
64
/* Link resolving checks performs multiple strategies with following priority:
57
65
1. We check if the link is a valid URL e.g. http://dotty.epfl.ch
You can’t perform that action at this time.
0 commit comments