Tentative fix for issue #2456 (#3883)

Co-authored-by: Naoki Takezoe <takezoe@gmail.com>
This commit is contained in:
Yasumichi Akahoshi
2025-12-07 01:26:37 +09:00
committed by GitHub
parent 88a8973685
commit 0d6e5af8d7

View File

@@ -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
}
}
}
}