Shape clipboard content for its recipient; add Outlook target - #123
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-clipboardplugin — it asks where the message is going and who it is for, then shapes itaccordingly.
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. Outlookhonours
<p>spacing and draws no gridlines on an unstyled table.--outlookkeeps the<p>elements and the real typography, adds the legacy
border/cellspacing/cellpaddingattributes Word's renderer honours, and drops pandoc's
<colgroup>, whose source-derived columnwidths bear no relation to rendered content.
fix(md2clip): stop padding around headings and blockquotes— the Teams path rebuildsparagraph spacing with blank lines, skipping elements that already carry their own margins.
h1–h6andblockquotewere missing from that exclusion list, so a heading got a blank lineon 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 anythingreaches 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 --debugretains<p>, preserves em dash and smart quotes, and emitsborder/cellspacing/cellpaddingwithborder-collapseon the tablemd2clip --debug(Teams) still flattens<p>to blank lines and leaves<table>bareparagraphs is unchanged
tests/run.shstructural checks pass (final newline, executable bit, indentation, README)Note for the reviewer
tests/run.shresolvesREPO_ROOTwithgit rev-parse --show-toplevel, so it only passes wheninvoked from inside this repo and fails immediately when run from another working directory. Not
addressed here, but worth a follow-up.