code: func (p *PathSpec) URLPrep(in string) string {
  	if p.UglyURLs {
  		return Uglify(SanitizeURL(in))
  	}
  	pretty := PrettifyURL(SanitizeURL(in))
  	if path.Ext(pretty) == ".xml" {
  		return pretty
  	}
  	url, err := purell.NormalizeURLString(pretty, purell.FlagAddTrailingSlash)
  	if err != nil {
  		return pretty
  	}
  	return url
  }
docs: // URLPrep applies misc sanitation to the given URL.