
Reflow text to or from wrapped form, with Markdown awareness. Two no-view commands you can hotkey-bind:
The classifier recognizes paragraphs, ATX and setext headings, fenced and indented code, blockquotes (with nesting), bullet/ordered/task lists, pipe tables, HTML blocks, reference link definitions, and hard breaks. Unwrap groups by blockquote prefix and inner role, so > - item reflows as a list item under a quote without losing structure.
| Command | Description |
|---|---|
| Wrap Text | Wrap text at a configurable column width. |
| Unwrap Text | Reflow wrapped text into continuous paragraphs while preserving Markdown structure. |
Both commands share Preferred Source, Primary Action, Hide HUD, and Pop to Root After Action:
| Preference | Default | What it does |
|---|---|---|
| Preferred Source | Selected Text | Try the selection first; fall back to the clipboard if none. Choose Clipboard to flip the priority. |
| Primary Action | Paste | Paste the result into the focused app. Choose Copy to put the result on the clipboard instead. |
| Hide HUD | off | Suppress the success HUD ("Pasted wrapped text" / "Copied unwrapped text"). |
| Pop to Root After Action | off | Return to Raycast root after the action completes. (No-op when launched via hotkey.) |
Wrap Text also has:
| Preference | Default | What it does |
|---|---|---|
| Wrap Column | 80 | The column at which lines are wrapped. The wrap budget is the full line including blockquote and list-item prefixes. Width values below 20 are clamped to 20. |
Unwrap Text also has:
| Preference | Default | What it does |
|---|---|---|
| Strip Soft Hyphens | on | When joining lines, remove a trailing soft hyphen (U+00AD) — the invisible character that marks an optional break. A regular - is always kept, so well- + known rejoins as well-known and state-of-the-art stays intact; either way the halves join with no space. |
| Keep Blank Lines | off | Preserve blank lines between paragraphs instead of collapsing runs. |
| Strip Bullet Indentation | off | Re-indent bullet and numbered lists to a fixed 2-space-per-level step, removing the leading spaces that pasted terminal or rich-text content adds in front of markers. Nesting depth is preserved by relative indent order, so pasting into an email client produces native bullets. Recognizes Unicode bullets (•, ‣, ▪, ▸, –, —) too. |
Bind these in Raycast → Extensions → Wrap Unwrap. Suggestions:
Wrap Unwrap implements the LitoMore cross-extension convention on the provider side using only built-in Raycast SDK primitives. Pass a launchContext with the text and an optional callbackLaunchOptions describing where to send the result:
import { launchCommand, LaunchType } from "@raycast/api";
await launchCommand({
name: "unwrap-text",
type: LaunchType.UserInitiated,
extensionName: "wrap-unwrap",
ownerOrAuthorName: "chrismessina",
context: {
text: "Some\nwrapped\ntext\nto reflow",
hyphenation: true,
callbackLaunchOptions: {
name: "your-callback-command",
type: LaunchType.Background,
extensionName: "your-extension",
ownerOrAuthorName: "you",
},
},
});
The provider invokes your callback command with context: { result: "..." } containing the transformed text. When callbackLaunchOptions is present, the provider does not paste, copy, or show a HUD — it just hands the result back.
UnwrapContext accepts text, hyphenation, keepBlankLines, flattenBullets, and callbackLaunchOptions. WrapContext accepts text, width, and callbackLaunchOptions.
The Preferred Source / Primary Action preference pattern follows the popular Change Case extension's convention.
Wrap text at a configurable column width.
Reflow wrapped text into continuous paragraphs while preserving Markdown structure.
well- + known now rejoins as well-known, not well- known. Applies to compounds, hyphen chains (state-of-the-art), and numeric ranges (5-10).- is always preserved, since it cannot be distinguished from a genuine compound.`foo-` + `bar` no longer becomes `foobar`). Link destinations with balanced parentheses are handled correctly.>text rather than > text) — the wrapped continuation lines were left as separate lines instead of reflowing. >text and > text are the same quote, so they now group together.-, #, ```, >, or ---, which was then re-read as a new list item, heading, code fence, blockquote, or heading underline. In the > case the character was deleted outright on the next unwrap.> markers were indented inconsistently — CommonMark allows up to three spaces before the marker, so those lines belong to the same quote.> marker is structural, not decoration.-, #, >). The check that prevents those characters from beginning a wrapped line now inspects a fixed number of words rather than a full line's worth, so wrapping stays fast at any column width.` or ](, which was read as opening real inline code or a link and suppressed the correct hyphen rejoining.- [ ]) not clearing the checkbox, so wrapped text sat under the [ ] instead of aligning with the item's text.12px) being accepted as 12 instead of falling back to 80.inter- + esting would become interesting, which is no longer the behavior.•, ‣, ▪, ▸, –, —) as list items so pasted rich-text and terminal output reflows correctly.`foo`42) no longer drops the span and digits.launchCommand callback (LitoMore convention).