Wire up markdown-to-HTML conversion for cards, schedule, and sweep#302
Wire up markdown-to-HTML conversion for cards, schedule, and sweep#302
Conversation
There was a problem hiding this comment.
Pull request overview
This PR wires Basecamp CLI rich-text handling into additional commands so Markdown input is converted to Basecamp-ready HTML before sending requests, aligning behavior across cards, schedule entries, and todo sweep comments.
Changes:
- Convert card body/content Markdown to HTML on
cards create,cards update --body, and thecardshortcut (including mention resolution; create/shortcut also resolve local images). - Convert schedule entry
--descriptionMarkdown to HTML onschedule create(full pipeline) andschedule update(mentions-only). - Convert
todos sweep --commentMarkdown to HTML (matchingcomment createpipeline) and add unit tests for each path.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| internal/commands/cards.go | Runs card content through Markdown→HTML and mention/image resolution before API requests (update matches existing “mentions-only on update” behavior). |
| internal/commands/cards_test.go | Adds request-capture tests asserting card content is sent as HTML. |
| internal/commands/schedule.go | Adds Markdown→HTML conversion (and mention/local-image resolution where applicable) for schedule descriptions. |
| internal/commands/schedule_test.go | Adds request-capture tests asserting schedule descriptions are sent as HTML. |
| internal/commands/todos.go | Converts sweep --comment content through the rich-text pipeline before creating comments. |
| internal/commands/todos_test.go | Adds request-capture test asserting sweep comment content is sent as HTML. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
This PR standardizes rich-text handling across multiple write paths so user-provided Markdown is converted into Basecamp-compatible HTML, including local image upload/embedding and @mention resolution, before requests are sent to the API.
Changes:
- Run the full rich-text pipeline (Markdown → local image resolution → mention resolution) for Cards content, Schedule description, and Todos sweep comments.
- Add local image resolution to existing Markdown-to-HTML update flows for Messages and Comments.
- Add/extend unit tests to assert HTML conversion and local-image error behavior for Cards, Schedule, and Sweep.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| internal/commands/todos.go | Converts todos sweep --comment through the rich-text pipeline before creating comments. |
| internal/commands/todos_test.go | Adds sweep tests asserting HTML conversion and missing-local-image errors. |
| internal/commands/schedule.go | Converts schedule entry --description (create/update) through the rich-text pipeline. |
| internal/commands/schedule_test.go | Adds tests asserting schedule description HTML conversion and local-image error behavior. |
| internal/commands/cards.go | Converts card body/content (create/update + card shortcut) through the rich-text pipeline. |
| internal/commands/cards_test.go | Adds tests asserting card content HTML conversion and local-image/remote-image behavior. |
| internal/commands/messages.go | Adds local image resolution to message update’s existing Markdown/mention pipeline. |
| internal/commands/comment.go | Adds local image resolution to comment update’s existing Markdown/mention pipeline. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
cards create, cards update, and the card shortcut were sending raw text for the Content field, which the SDK documents as rich text. Markdown syntax appeared literally in Basecamp. All paths now run MarkdownToHTML + resolveLocalImages + resolveMentions.
schedule create and schedule update were sending raw text for the Description field, which the API documents as "event details in HTML". Both paths now run MarkdownToHTML + resolveLocalImages + resolveMentions.
The sweep command was sending raw text for comment content, which the API documents as "comment text in HTML". Now runs the full pipeline (MarkdownToHTML + resolveLocalImages + resolveMentions), matching the comment create command.
Both update paths ran MarkdownToHTML but skipped resolveLocalImages, which meant  produced broken <img src="./file.png"> in the request body. Now both paths run the full pipeline, matching their respective create commands.
Summary
create,update,cardshortcut): Content field now runs through the full rich text pipeline before sending to the API. Previously markdown syntax appeared literally in Basecamp.create,update): Description field ("event details in HTML") now converts markdown to HTML with image and mention support.--comment): Comment content now matchescomment createby running the full pipeline.resolveLocalImages— both paths already ranMarkdownToHTMLbut skipped image resolution, which meantproduced broken<img src="./file.png">tags in the request body.All write paths now run the full pipeline:
MarkdownToHTML→resolveLocalImages→resolveMentions.Test plan
TestCardsCreateContentIsHTML—cards createsends<strong>not**TestCardsUpdateContentIsHTML—cards update --bodyconverts markdownTestCardShortcutContentIsHTML—cardshortcut converts markdownTestCardsCreateLocalImageErrors— local image path errors instead of serializing broken<img>TestCardsUpdateLocalImageErrors— same for update pathTestCardsCreateRemoteImagePassesThrough— remote URLs preserved as<img>TestScheduleCreateDescriptionIsHTML—schedule create --descriptionconvertsTestScheduleUpdateDescriptionIsHTML—schedule update --descriptionconvertsTestScheduleCreateLocalImageErrors— local image errors on createTestScheduleUpdateLocalImageErrors— local image errors on updateTestSweepCommentContentIsHTML—sweep --commentconverts markdownTestSweepCommentLocalImageErrors— local image errors in sweep commentbin/cipasses (lint, vet, unit tests, e2e, surface snapshot, skill drift)