diff --git a/fetcher/fetcher.go b/fetcher/fetcher.go index fa3693a07e37a26ffc13d39a5e9ddf97ccce7341..047c5ec30f7b1a683c19acf36c0b64ed5f68399d 100644 --- a/fetcher/fetcher.go +++ b/fetcher/fetcher.go @@ -248,7 +248,7 @@ func FetchEmailBody(cfg *config.Config, uid uint32) (string, []Attachment, error if textPartID != "" { partMessages := make(chan *imap.Message, 1) partDone := make(chan error, 1) - + fetchItem := imap.FetchItem(fmt.Sprintf("BODY.PEEK[%s]", textPartID)) section, err := imap.ParseBodySectionName(fetchItem) if err != nil { @@ -400,4 +400,4 @@ func ArchiveEmail(cfg *config.Config, uid uint32) error { archiveMailbox = "Archive" } return moveEmail(cfg, uid, archiveMailbox) -} \ No newline at end of file +} diff --git a/main.go b/main.go index a8d247debf6ed614077295bc4471229b39e55ca2..a5079d01f4bb0669d2e3acc272faae4c7b2f7133 100644 --- a/main.go +++ b/main.go @@ -166,7 +166,7 @@ func (m *mainModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) { // Use the index from the message to update the correct email m.emails[msg.Index].Body = msg.Body m.emails[msg.Index].Attachments = msg.Attachments - + emailView := tui.NewEmailView(m.emails[msg.Index], m.width, m.height) m.current = emailView return m, m.current.Init() @@ -280,7 +280,6 @@ func fetchEmailBodyCmd(cfg *config.Config, email fetcher.Email, index int) tea.C } } - func markdownToHTML(md []byte) []byte { var buf bytes.Buffer p := goldmark.New(goldmark.WithRendererOptions(html.WithUnsafe())) diff --git a/tui/messages.go b/tui/messages.go index 66c14af92f387f0f52a40ddaae8e1b202f5064cb..d34659a6ecb5145923b97ac274515a633fc89fe9 100644 --- a/tui/messages.go +++ b/tui/messages.go @@ -91,7 +91,7 @@ type DownloadAttachmentMsg struct { Index int Filename string PartID string - Data []byte + Data []byte } type AttachmentDownloadedMsg struct { diff --git a/tui/styles.go b/tui/styles.go index 88980dbe6826f536e76da6b59fdc57a465d5cc3c..253e7f5aa5f31302d412683aca05c27042874e8e 100644 --- a/tui/styles.go +++ b/tui/styles.go @@ -33,7 +33,7 @@ var ( Align(lipgloss.Center) BodyStyle = lipgloss.NewStyle(). - Bold(true) // A bit bold + Bold(true) // A bit bold ) var DocStyle = lipgloss.NewStyle().Margin(1, 2) diff --git a/view/html.go b/view/html.go index c42f4f6a0cbefa81ad94af3a81f014f4d218bc59..1cdf4afb572916be422f6132d5959d5a8f67625f 100644 --- a/view/html.go +++ b/view/html.go @@ -107,4 +107,4 @@ func ProcessBody(rawBody string, h1Style, h2Style, bodyStyle lipgloss.Style) (st re := regexp.MustCompile(`\n{3,}`) text = re.ReplaceAllString(text, "\n\n") return bodyStyle.Render(text), nil -} \ No newline at end of file +}