Skip to content
Prev Previous commit
Next Next commit
Remove NameToUnescapedFilename()
  • Loading branch information
BLumia authored Jul 1, 2021
commit 2aa6f97e55cb46d13b688d5188a66fc1c98cc65b
7 changes: 1 addition & 6 deletions services/wiki/wiki.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,6 @@ func NormalizeWikiName(name string) string {
return strings.ReplaceAll(name, "-", " ")
}

// NameToUnescapedFilename converts a wiki name to its corresponding filename without url query escape.
func NameToUnescapedFilename(name string) string {
return name + ".md"
}

// NameToFilename converts a wiki name to its corresponding filename.
func NameToFilename(name string) string {
name = strings.ReplaceAll(name, " ", "-")
Expand Down Expand Up @@ -89,7 +84,7 @@ func InitWiki(repo *models.Repository) error {
// prepareWikiFileName try to find a suitable file path with file name by the given raw wiki name.
// return: existence, prepared file path with name, error
func prepareWikiFileName(gitRepo *git.Repository, wikiName string) (bool, string, error) {
unescaped := NameToUnescapedFilename(wikiName)
unescaped := wikiName + ".md"
escaped := NameToFilename(wikiName)

// Look for both files
Expand Down