1
0
Fork 0
forked from forgejo/forgejo

Fix inconsistent wiki path converting. (#24277)

The Infinite Monkey Random Typing catches a bug, inconsistent wiki path
converting.

Close #24276

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Giteabot <teabot@gitea.io>
This commit is contained in:
wxiaoguang 2023-04-23 19:16:30 +08:00 committed by GitHub
parent 44e0cfa96e
commit 60e7963141
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View file

@ -72,7 +72,7 @@ func unescapeSegment(s string) (string, error) {
}
func escapeSegToWeb(s string, hadDashMarker bool) string {
if hadDashMarker || strings.Contains(s, "-") {
if hadDashMarker || strings.Contains(s, "-") || strings.HasSuffix(s, ".md") {
s = addDashMarker(s)
} else {
s = strings.ReplaceAll(s, " ", "-")