cmd/sgblog-comment-add/main.go | 7 +++++-- common.go | 2 +- diff --git a/cmd/sgblog-comment-add/main.go b/cmd/sgblog-comment-add/main.go index d9446942964892c4cd151a9c9a5b6fa8c6e4948f08ea5aedeb4a0c8d122494c3..55eeac5417b04631ec6e9d4352cfd93cacca108c56eec5a841365093879eb1df 100644 --- a/cmd/sgblog-comment-add/main.go +++ b/cmd/sgblog-comment-add/main.go @@ -106,10 +106,13 @@ note, _ := cmd.Output() note = bytes.TrimRight(note, "\r\n") // Remove trailing whitespaces, because git-notes-add will remove - // them anyway, and we have to know exact bytes count + // them anyway, and we have to know exact bytes count. Also convert + // all tabs into spaces lines := strings.Split(string(body), "\n") for i, line := range lines { - lines[i] = strings.TrimRight(line, " \r") + line = strings.ReplaceAll(line, " ", " ") + line = strings.TrimRight(line, " \r") + lines[i] = line } for lines[len(lines)-1] == "" { lines = lines[:len(lines)-1] diff --git a/common.go b/common.go index cc245a43bd273b1b911e512bacf4274811762b93353ef61bf43b921fee19432c..6c596e946de8beaf9c26969b86d3c9393c01a2ef313ef64b87a1bdaa691e3d81 100644 --- a/common.go +++ b/common.go @@ -2,6 +2,6 @@ // SGBlog -- Git-backed CGI/inetd blogging/phlogging engine package sgblog const ( - Version = "0.6.0" + Version = "0.6.1" WhenFmt = "2006-01-02 15:04:05Z07:00" )