diff --git a/src/main/scala/gitbucket/core/view/Markdown.scala b/src/main/scala/gitbucket/core/view/Markdown.scala index 9db2a950f..772f1abbf 100644 --- a/src/main/scala/gitbucket/core/view/Markdown.scala +++ b/src/main/scala/gitbucket/core/view/Markdown.scala @@ -192,7 +192,13 @@ object Markdown { .stripSuffix(".git") + "/blob/" + branch + "/" + urlWithRawParam } } else { - repository.httpUrl.replaceFirst("/git/", "/").stripSuffix(".git") + "/wiki/_blob/" + url + // URL is being modified to link to the image file on the repository, but users may want to link to the page if the page name is a link. + // As a interim solution, if the link contains a ., it will use the current conversion, otherwise it will perform the conversion the user wants. + if (url.lastIndexOf(".") > 0) { + repository.httpUrl.replaceFirst("/git/", "/").stripSuffix(".git") + "/wiki/_blob/" + url + } else { + repository.httpUrl.replaceFirst("/git/", "/").stripSuffix(".git") + "/wiki/" + url + } } } }