1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-08-11 17:51:01 +00:00

Use %q instead of "%s"

This commit is contained in:
jvoisin 2024-02-29 00:27:39 +01:00 committed by Frédéric Guillot
parent 5e5cb056c5
commit b04550e2f2
8 changed files with 8 additions and 8 deletions

View file

@ -292,7 +292,7 @@ func addInvidiousVideo(entryURL, entryContent string) string {
func addPDFLink(entryURL, entryContent string) string {
if strings.HasSuffix(entryURL, ".pdf") {
return fmt.Sprintf(`<a href="%s">PDF</a><br>%s`, entryURL, entryContent)
return fmt.Sprintf(`<a href=%q>PDF</a><br>%s`, entryURL, entryContent)
}
return entryContent
}

View file

@ -154,7 +154,7 @@ func sanitizeAttributes(baseURL, tagName string, attributes []html.Attribute) ([
}
attrNames = append(attrNames, attribute.Key)
htmlAttrs = append(htmlAttrs, fmt.Sprintf(`%s="%s"`, attribute.Key, html.EscapeString(value)))
htmlAttrs = append(htmlAttrs, fmt.Sprintf(`%s=%q`, attribute.Key, html.EscapeString(value)))
}
if !isAnchorLink {

View file

@ -17,7 +17,7 @@ func NewSubscription(title, url, kind string) *Subscription {
}
func (s Subscription) String() string {
return fmt.Sprintf(`Title="%s", URL="%s", Type="%s"`, s.Title, s.URL, s.Type)
return fmt.Sprintf(`Title=%q, URL=%q, Type=%q`, s.Title, s.URL, s.Type)
}
// Subscriptions represents a list of subscription.