Skip to content

Commit

Permalink
fix: fixed a bug where the parser assumed there was a date (but there
Browse files Browse the repository at this point in the history
wasn't)
  • Loading branch information
TypicalAM committed Dec 31, 2022
1 parent 06ce7d7 commit cd4b313
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cmd/goread/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func main() {
return
}

cfg, err := config.New(config.BackendWeb, "", "fake")
cfg, err := config.New(config.BackendWeb, "", "")
if err != nil {
fmt.Println(err)
return
Expand Down
7 changes: 5 additions & 2 deletions internal/backend/fake/fake.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,14 +142,17 @@ func (i Item) MoreContent() string {
var mdown string

mdown += "# " + i.Title
mdown += "\n"
mdown += i.PublishedParsed.String()
if i.PublishedParsed != nil {
mdown += "\n"
mdown += "Published: " + i.PublishedParsed.Format("2006-01-02 15:04:05")
}
mdown += "\n\n"
mdown += parseHTML(i.Description)

out, _ := glamour.Render(mdown, "dark")
return out

// TODO: redundant code, integrade glamour better
sections = append(
sections,
titleTextStyle.Render(i.Title), "",
Expand Down

0 comments on commit cd4b313

Please sign in to comment.