fix(taskwarrior): parsing and convertion of times and contents
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
@@ -36,6 +37,9 @@ func (gitea *Gitea) GetComments(repo Repository) ([]Comment, error) {
|
||||
if err = decoder.Decode(&data); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
for _, comment := range data {
|
||||
comment.Body = strings.ReplaceAll(comment.Body, "\r\n", "\n")
|
||||
}
|
||||
return data, nil
|
||||
}
|
||||
|
||||
@@ -53,6 +57,7 @@ func (gitea *Gitea) GetComment(repo Repository, id uint) (Comment, error) {
|
||||
if err = decoder.Decode(&comment); err != nil {
|
||||
return comment, err
|
||||
}
|
||||
comment.Body = strings.ReplaceAll(comment.Body, "\r\n", "\n")
|
||||
return comment, err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user