Skip to content

Shape clipboard content for its recipient; add Outlook target - #123

Merged
Jodre11 merged 3 commits into
mainfrom
feat/md2clip-outlook-and-audience-shaping
Aug 23, 2026
Merged

Jodre11 merged 3 commits into
mainfrom
feat/md2clip-outlook-and-audience-shaping

Conversation

@Jodre11

@Jodre11 Jodre11 commented Aug 23, 2026

Copy link
Copy Markdown
Owner

When we share a Claude response with a colleague, two things go wrong often enough to be
annoying: it gets pasted into Outlook in the wrong format and has to be re-requested, and it
carries context that is accurate but irrelevant to the person reading it, which is the main
reason colleagues stop reading these messages at all. This PR closes both gaps in the
md-to-clipboard plugin — it asks where the message is going and who it is for, then shapes it
accordingly.

The three commits are separable and can be reviewed in order.

Changes

feat(md2clip): add --outlook target — Teams and Outlook need opposite HTML. Teams strips
<p> margins, so spacing has to be faked with blank lines, and it auto-borders tables. Outlook
honours <p> spacing and draws no gridlines on an unstyled table. --outlook keeps the <p>
elements and the real typography, adds the legacy border/cellspacing/cellpadding
attributes Word's renderer honours, and drops pandoc's <colgroup>, whose source-derived column
widths bear no relation to rendered content.

fix(md2clip): stop padding around headings and blockquotes — the Teams path rebuilds
paragraph spacing with blank lines, skipping elements that already carry their own margins.
h1–h6 and blockquote were missing from that exclusion list, so a heading got a blank line
on top of its own margin and a blockquote was padded both inside and outside. Both guards now
include them; plain paragraph gaps are unchanged.

feat(md-to-clipboard): shape content for its recipient — adds two gates before anything
reaches the clipboard. The channel (Teams or Outlook) is never guessed, since a wrong guess costs
a round trip. The recipient selects one of three tone tiers — engineer, manager, executive.
Both are inferred silently when the user has already stated them, and skipped entirely on a
verbatim copy. Selection is by whether a fact changes the recipient's decision, so length falls
out of the filter rather than being a target, and structure is judged the same way: comparative
tables and ordered steps stay, headings above single paragraphs go.

Test plan

  • md2clip --outlook --debug retains <p>, preserves em dash and smart quotes, and emits
    border/cellspacing/cellpadding with border-collapse on the table
  • md2clip --debug (Teams) still flattens <p> to blank lines and leaves <table> bare
  • Headings and blockquotes no longer gain surrounding blank lines; the gap between two plain
    paragraphs is unchanged
  • tests/run.sh structural checks pass (final newline, executable bit, indentation, README)
  • Paste both targets into Teams and Outlook and confirm the rendering by eye

Note for the reviewer

tests/run.sh resolves REPO_ROOT with git rev-parse --show-toplevel, so it only passes when
invoked from inside this repo and fails immediately when run from another working directory. Not
addressed here, but worth a follow-up.

Teams and Outlook need opposite HTML. Teams strips <p> margins, so spacing
has to be faked with blank lines, and it auto-borders tables. Outlook honours
<p> spacing and draws no gridlines on an unstyled table, so flattening the
paragraphs there collapses every gap into one and tables paste bare.

--outlook keeps the <p> elements and the real typography, adds the legacy
border/cellspacing/cellpadding attributes Word's renderer honours, and drops
pandoc's <colgroup> whose source-derived widths bear no relation to rendered
content.
…utput

The Teams path rebuilds paragraph spacing with blank lines, skipping elements
that already carry their own margins. Headings and blockquotes were missing
from that exclusion list, so a heading got a blank line on top of its own
margin and a blockquote was padded both inside and outside, giving visibly
larger gaps than between plain paragraphs.

Adds h1-h6 and blockquote, opening and closing, to both guards. Paragraph
gaps are unchanged.
The skill silently defaulted to the Teams target, so a message bound for
Outlook pasted unformatted and had to be re-requested. It also copied content
verbatim, which meant forwarding responses carrying context that was accurate
but irrelevant to the recipient - the main reason they stop reading.

Adds two gates before anything reaches the clipboard: the channel, which is
never guessed, and the recipient, which selects one of three tone tiers
(engineer, manager, executive). Both are inferred silently when the user has
already stated them, and skipped entirely on a verbatim copy.

Selection is by whether a fact changes the recipient's decision, so length
falls out rather than being targeted. Structure is judged the same way -
comparative tables and ordered steps stay, headings over single paragraphs go.
@Jodre11
Jodre11 merged commit b1c7fa2 into main Aug 23, 2026
3 checks passed
@Jodre11
Jodre11 deleted the feat/md2clip-outlook-and-audience-shaping branch September 7, 2026 09:19
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.

1 participant