mirror of
https://github.com/romdo/go-conver.git
synced 2026-02-19 08:16:40 +00:00
wip: improve whitespace handling in paragraph parsing
This commit is contained in:
@@ -34,10 +34,14 @@ func parseHeader(header []byte) (*Commit, error) {
|
||||
}, nil
|
||||
}
|
||||
|
||||
func paragraphs(input []byte) [][]byte {
|
||||
paras := bytes.Split(normlizeLinefeeds(input), []byte{lf, lf})
|
||||
func paragraphs(commitMsg []byte) [][]byte {
|
||||
paras := bytes.Split(
|
||||
bytes.TrimSpace(normlizeLinefeeds(commitMsg)),
|
||||
[]byte{lf, lf},
|
||||
)
|
||||
|
||||
for i, p := range paras {
|
||||
paras[i] = bytes.Trim(p, crlf)
|
||||
paras[i] = bytes.TrimSpace(p)
|
||||
}
|
||||
|
||||
return paras
|
||||
|
||||
Reference in New Issue
Block a user