Skip to content

Prevent indentation after Markdown line breaks - #345

Merged
robzolkos merged 1 commit into
mainfrom
fix/markdown-hard-break-whitespace
Aug 27, 2026
Merged

Prevent indentation after Markdown line breaks#345
robzolkos merged 1 commit into
mainfrom
fix/markdown-hard-break-whitespace

Conversation

@robzolkos

@robzolkos robzolkos commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator

Summary

Markdown-authored content with a hard line break included a formatting newline after <br>. HEY preserved that whitespace, making continuation lines appear indented.

Before

<p>AAA.<br>
BBB.</p>

After

<p>AAA.<br>BBB.</p>

The corrected output applies to Markdown-authored messages, drafts, forwards, and contact notes while preserving structural whitespace in paragraphs, lists, blockquotes, code blocks, and raw HTML.

Validation

  • GOWORK=off make check
  • GOWORK=off make build
  • GOWORK=off go test -cover ./internal/htmlutil -count=1 — 93.4% statement coverage

@robzolkos
robzolkos requested a review from a team as a code owner August 27, 2026 08:56
Copilot AI balanced review requested due to automatic review settings August 27, 2026 08:56

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Prevents Markdown line breaks from adding indentation when converted to HEY-compatible HTML.

Changes:

  • Adds a Goldmark text renderer that emits <br> without trailing whitespace.
  • Expands regression coverage across HTML utilities, CLI commands, drafts, and TUI composition.

Tip

If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
internal/htmlutil/from_markdown.go Adds whitespace-free line-break rendering.
internal/htmlutil/from_markdown_test.go Covers breaks and structural whitespace.
internal/cmd/compose_test.go Verifies raw HTML preservation.
internal/cmd/contacts_test.go Updates contact-note output expectation.
internal/cmd/draft_test.go Tests flush draft continuation lines.
internal/cmd/forward_test.go Updates forwarded-content expectation.
internal/tui/compose_test.go Updates TUI composition expectation.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@robzolkos
robzolkos requested a review from monorkin August 27, 2026 09:17
@robzolkos
robzolkos merged commit 5782053 into main Aug 27, 2026
24 checks passed
@robzolkos
robzolkos deleted the fix/markdown-hard-break-whitespace branch August 27, 2026 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants