Skip to content

fix(mail): render single newlines in draft bodies as line breaks - #33

Merged
piekstra merged 1 commit into
mainfrom
fix/32-markdown-hard-wraps
Sep 23, 2026
Merged

piekstra merged 1 commit into
mainfrom
fix/32-markdown-hard-wraps

Conversation

@piekstra

Copy link
Copy Markdown
Member

Fixes #32

gro mail draft rendered markdown bodies with CommonMark soft breaks, so a single newline became a space and a two-line sign-off (Thanks, then a name) arrived joined on one line. The renderer now uses goldmark's WithHardWraps, so a single newline becomes <br> while a blank line still separates paragraphs. This matches how the quoted-reply path in the same command already treats newlines.

TestRenderMarkdown_SingleNewlineIsALineBreak pins both halves: the sign-off keeps its line break and the blank line still yields two paragraphs. It fails on main and passes with the change; make lint is clean.

A markdown draft body used CommonMark soft breaks, so a two-line sign-off
arrived as one line. Render with goldmark's hard-wraps option.

Fixes #32

@monit-reviewer monit-reviewer left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated PR Review

Reviewed commit: d18e7a0cb46e
Profile: claude-monit-reviewer - Posting as: monit-reviewer

Summary

Reviewer Findings
go:implementation-tests 0

Reviewer Coverage

  • go:implementation-tests — complete (broad); skipped: none; constraints: none
Inspected files (2)
  • internal/cmd/mail/draft.go
  • internal/cmd/mail/draft_test.go

0 PR discussion threads considered. 0 summarized; 0 resolved.


Completed in 1m 42s | ~$0.83 (est.) | claude-sonnet-5 | cr 0.10.311
Field Value
Model claude-sonnet-5
Reviewers go:implementation-tests
Engine claude_cli · claude-sonnet-5
Reviewed by cr · monit-reviewer
Duration 1m 42s wall · 1m 19s compute
Cost ~$0.83 (est.)
Pricing basis anthropic-public-2026-09-02
Tokens 26 in / 3.1k out

Per-workstream usage

  • orchestrator-selection — claude-sonnet-5
    • In: 6
    • Out: 1.0k
    • Cache read: 104.5k
    • Cache create: 74.4k
    • Cost: ~$0.33 (est.)
    • Duration: 23s
  • go:implementation-tests — claude-sonnet-5
    • In: 14
    • Out: 1.7k
    • Cache read: 399.9k
    • Cache create: 74.2k
    • Cost: ~$0.39 (est.)
    • Duration: 45s
  • orchestrator-rollup — claude-sonnet-5
    • In: 6
    • Out: 332
    • Cache read: 182.9k
    • Cache create: 16.0k
    • Cost: ~$0.10 (est.)
    • Duration: 9s

@piekstra
piekstra marked this pull request as ready for review September 23, 2026 17:13
@piekstra
piekstra merged commit 1799ae8 into main Sep 23, 2026
11 checks passed
@piekstra
piekstra deleted the fix/32-markdown-hard-wraps branch September 23, 2026 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

mail draft: single newlines in a markdown body are collapsed into spaces

2 participants