From: Sergey Matveev Date: Sat, 31 Oct 2020 13:29:40 +0000 (+0300) Subject: Proper URL path escaping X-Git-Tag: v0.10.1^0 X-Git-Url: http://www.git.stargrave.org/?p=sgblog.git;a=commitdiff_plain;h=6411c9756acff5a303b7d1920824bc38b2cd60d9 Proper URL path escaping --- diff --git a/cmd/sgblog/http.go b/cmd/sgblog/http.go index 4712a50..808c3d9 100644 --- a/cmd/sgblog/http.go +++ b/cmd/sgblog/http.go @@ -142,7 +142,7 @@ Topics: {{range .Topics}}[{{.}} {{end}}
{{end}} -{{if .Cfg.CommentsEmail}}[leave comment]{{end}} +{{if .Cfg.CommentsEmail}}[leave comment]{{end}}
{{range $idx, $comment := .Comments}}
comment {{$idx}}:
@@ -798,7 +798,7 @@ func serveHTTP() { Version: sgblog.Version, Cfg: cfg, Title: title, - TitleEscaped: strings.ReplaceAll(title, " ", "%20"), + TitleEscaped: url.PathEscape(fmt.Sprintf("Re: %s (%s)", title, commit.Hash)), When: when, AtomCommentsURL: atomCommentsURL, Parent: parent, diff --git a/common.go b/common.go index 821d5b3..b324d87 100644 --- a/common.go +++ b/common.go @@ -2,6 +2,6 @@ package sgblog const ( - Version = "0.10.0" + Version = "0.10.1" WhenFmt = "2006-01-02 15:04:05Z07:00" )