Browse Source

Добавлялось лишнего в строку описания ресурса #65

pull/120/head
Artur Galyamov 2 years ago
parent
commit
05f5c04461
  1. 8
      routers/web/repo/resource.go

8
routers/web/repo/resource.go

@ -49,16 +49,16 @@ func GetRenderedResourcesWithSearchLinks(ctx *context.Context, repo interface{},
var resourceName string var resourceName string
var searchQS string var searchQS string
for _, matches := range resourceNamesMatches { for _, resourceNameMatches := range resourceNamesMatches {
resourceName = matches[1] resourceName = resourceNameMatches[1]
searchQS = strings.ReplaceAll(resourceName, " ", "+") searchQS = strings.ReplaceAll(resourceName, " ", "+")
resourceSubstitutionPattern := fmt.Sprintf( resourceSubstitutionPattern := fmt.Sprintf(
`- \[ \] %s [найти](/explore/%s?tab=&q=%s)`, `- [ ] %s [найти](/explore/%s?tab=&q=%s)`,
resourceName, resourceName,
strings.ToLower(fieldName), strings.ToLower(fieldName),
searchQS) searchQS)
resourcesWithSafeURLs = strings.Replace(resourcesWithSafeURLs, resourceName, resourceSubstitutionPattern, -1) resourcesWithSafeURLs = strings.Replace(resourcesWithSafeURLs, resourceNameMatches[0], resourceSubstitutionPattern, -1)
} }
var renderedResourcesWithSafeURLs string var renderedResourcesWithSafeURLs string

Loading…
Cancel
Save