Skip to content

Commit 96126c7

Browse files
committed
fix #1940 - broken .md links
1 parent 5995dd3 commit 96126c7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

doc-tool/src/dotty/tools/dottydoc/staticsite/MarkdownLinkVisitor.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@ object MarkdownLinkVisitor {
1414
new VisitHandler(classOf[Link], new Visitor[Link] with MemberLookup {
1515
override def visit(node: Link): Unit = {
1616
val url = node.getUrl
17-
if (EntityLink.unapplySeq(url.toString).isDefined) {
17+
if (url.endsWith(".md")) node.setUrl {
18+
url.subSequence(0, url.lastIndexOf('.')).append(".html")
19+
}
20+
else if (EntityLink.unapplySeq(url.toString).isDefined) {
1821
lookup(NonEntity, docs, url.toString).foreach { ent =>
1922
val (path, suffix) = ent match {
2023
case ent: Val => (ent.path.dropRight(1), ".html#" + ent.signature)
@@ -32,9 +35,6 @@ object MarkdownLinkVisitor {
3235
}
3336
}
3437
}
35-
else if (url.endsWith(".md")) node.setUrl {
36-
url.subSequence(0, url.lastIndexOf('.')).append(".html")
37-
}
3838
}
3939
})
4040
))

0 commit comments

Comments
 (0)