photoprism/pkg/txt/quote.go
Michael Mayer 2032b40f2b Backend: Code clean-up
Signed-off-by: Michael Mayer <michael@liquidbytes.net>
2020-05-03 18:00:50 +02:00

16 lines
229 B
Go

package txt
import (
"fmt"
"strings"
)
// Quote adds quotation marks to a string if needed.
func Quote(text string) string {
if strings.ContainsAny(text, " \n'\"") {
return fmt.Sprintf("“%s”", text)
}
return text
}