diff --git a/client/model.go b/client/model.go index fe97e6a8..9d9ab08e 100644 --- a/client/model.go +++ b/client/model.go @@ -107,7 +107,7 @@ type Subscription struct { } 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 subscriptions. diff --git a/internal/integration/matrixbot/matrixbot.go b/internal/integration/matrixbot/matrixbot.go index 8b2c6961..3e29d83d 100644 --- a/internal/integration/matrixbot/matrixbot.go +++ b/internal/integration/matrixbot/matrixbot.go @@ -28,7 +28,7 @@ func PushEntries(feed *model.Feed, entries model.Entries, matrixBaseURL, matrixU for _, entry := range entries { textMessages = append(textMessages, fmt.Sprintf(`[%s] %s - %s`, feed.Title, entry.Title, entry.URL)) - formattedTextMessages = append(formattedTextMessages, fmt.Sprintf(`
  • %s: %s
  • `, feed.Title, entry.URL, entry.Title)) + formattedTextMessages = append(formattedTextMessages, fmt.Sprintf(`
  • %s: %s
  • `, feed.Title, entry.URL, entry.Title)) } _, err = client.SendFormattedTextMessage( diff --git a/internal/model/app_session.go b/internal/model/app_session.go index 9d4f7469..a672ad26 100644 --- a/internal/model/app_session.go +++ b/internal/model/app_session.go @@ -67,5 +67,5 @@ type Session struct { } func (s *Session) String() string { - return fmt.Sprintf(`ID="%s", Data={%v}`, s.ID, s.Data) + return fmt.Sprintf(`ID=%q, Data={%v}`, s.ID, s.Data) } diff --git a/internal/model/user_session.go b/internal/model/user_session.go index 9f889242..bec4cc77 100644 --- a/internal/model/user_session.go +++ b/internal/model/user_session.go @@ -21,7 +21,7 @@ type UserSession struct { } func (u *UserSession) String() string { - return fmt.Sprintf(`ID="%d", UserID="%d", IP="%s", Token="%s"`, u.ID, u.UserID, u.IP, u.Token) + return fmt.Sprintf(`ID=%q, UserID=%q, IP=%q, Token=%q`, u.ID, u.UserID, u.IP, u.Token) } // UseTimezone converts creation date to the given timezone. diff --git a/internal/reader/rewrite/rewrite_functions.go b/internal/reader/rewrite/rewrite_functions.go index e84f3d3c..122b2327 100644 --- a/internal/reader/rewrite/rewrite_functions.go +++ b/internal/reader/rewrite/rewrite_functions.go @@ -292,7 +292,7 @@ func addInvidiousVideo(entryURL, entryContent string) string { func addPDFLink(entryURL, entryContent string) string { if strings.HasSuffix(entryURL, ".pdf") { - return fmt.Sprintf(`PDF
    %s`, entryURL, entryContent) + return fmt.Sprintf(`PDF
    %s`, entryURL, entryContent) } return entryContent } diff --git a/internal/reader/sanitizer/sanitizer.go b/internal/reader/sanitizer/sanitizer.go index 9d0d8ee8..94e20f02 100644 --- a/internal/reader/sanitizer/sanitizer.go +++ b/internal/reader/sanitizer/sanitizer.go @@ -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 { diff --git a/internal/reader/subscription/subscription.go b/internal/reader/subscription/subscription.go index 6642c4c6..c366b6d8 100644 --- a/internal/reader/subscription/subscription.go +++ b/internal/reader/subscription/subscription.go @@ -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. diff --git a/internal/ui/static_javascript.go b/internal/ui/static_javascript.go index 1172252a..e11c125a 100644 --- a/internal/ui/static_javascript.go +++ b/internal/ui/static_javascript.go @@ -27,7 +27,7 @@ func (h *handler) showJavascript(w http.ResponseWriter, r *http.Request) { contents := static.JavascriptBundles[filename] if filename == "service-worker" { - variables := fmt.Sprintf(`const OFFLINE_URL="%s";`, route.Path(h.router, "offline")) + variables := fmt.Sprintf(`const OFFLINE_URL=%q;`, route.Path(h.router, "offline")) contents = append([]byte(variables)[:], contents[:]...) }