mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-21 21:35:28 +02:00
Added the url modules test files.
Added the new url module test file. This replaces the original helpers_test.go file. The TestUrlPrep test currently fails. The only minor change to url.go is to add some trace printf's to UrlPrep.
This commit is contained in:
@@ -81,6 +81,7 @@ func MakePermalink(host, plink string) *url.URL {
|
||||
func UrlPrep(ugly bool, in string) string {
|
||||
if ugly {
|
||||
x := Uglify(SanitizeUrl(in))
|
||||
fmt.Printf("Ugly case. Returning x = %q\n", x)
|
||||
return x
|
||||
} else {
|
||||
x := PrettifyUrl(SanitizeUrl(in))
|
||||
@@ -89,8 +90,10 @@ func UrlPrep(ugly bool, in string) string {
|
||||
}
|
||||
url, err := purell.NormalizeURLString(x, purell.FlagAddTrailingSlash)
|
||||
if err != nil {
|
||||
fmt.Printf("ERROR returned by NormalizeURLString. Returning in = %q\n", in)
|
||||
return in
|
||||
}
|
||||
fmt.Printf("NO error returning url = %q\n", url)
|
||||
return url
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user