fix(taskwarrior): parsing and convertion of times and contents

This commit is contained in:
2023-10-22 12:32:53 +02:00
parent ce2a4769c9
commit 5764a32f02
5 changed files with 103 additions and 26 deletions

View File

@@ -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
}