Extension Icon

Wrap Unwrap

Wrap and unwrap text using Markdown-aware reflow.
Overview

Wrap Unwrap

Reflow text to or from wrapped form, with Markdown awareness. Two no-view commands you can hotkey-bind:

  • Wrap Text — wrap the selected text (or clipboard text) at a configurable column width.
  • Unwrap Text — reflow wrapped text into continuous paragraphs, preserving Markdown structure (code fences, lists, blockquotes, tables, links, hyphenation).

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.

Commands

CommandDescription
Wrap TextWrap text at a configurable column width.
Unwrap TextReflow wrapped text into continuous paragraphs while preserving Markdown structure.

Preferences

Both commands share Preferred Source, Primary Action, Hide HUD, and Pop to Root After Action:

PreferenceDefaultWhat it does
Preferred SourceSelected TextTry the selection first; fall back to the clipboard if none. Choose Clipboard to flip the priority.
Primary ActionPastePaste the result into the focused app. Choose Copy to put the result on the clipboard instead.
Hide HUDoffSuppress the success HUD ("Pasted wrapped text" / "Copied unwrapped text").
Pop to Root After ActionoffReturn to Raycast root after the action completes. (No-op when launched via hotkey.)

Wrap Text also has:

PreferenceDefaultWhat it does
Wrap Column80The 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:

PreferenceDefaultWhat it does
Strip Soft HyphensonWhen joining lines, remove a trailing hyphen if it appears to be a soft line-break hyphen (e.g. inter- + estinginteresting). Compounds like state-of-the-art are preserved.
Keep Blank LinesoffPreserve blank lines between paragraphs instead of collapsing runs.

Suggested hotkeys

Bind these in Raycast → Extensions → Wrap Unwrap. Suggestions:

  • Wrap Text → ⌃⌥W
  • Unwrap Text → ⌃⌥U

For other extensions

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 { LaunchType, launchCommand } 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, and callbackLaunchOptions. WrapContext accepts text, width, and callbackLaunchOptions.

Acknowledgements

The Preferred Source / Primary Action preference pattern follows the popular Change Case extension's convention.