The Quest for Comfortable Text: A Solution for Clipboard Normalization
Coverage of lessw-blog
In a recent post, lessw-blog discusses a pragmatic solution to a common digital annoyance: the formatting limitations of standard copy-paste functionality.
In a recent post on LessWrong, lessw-blog explores a subtle yet pervasive inefficiency in modern computing: the clipboard. For developers, researchers, and technical writers, moving text between applications is a high-frequency task that often results in formatting friction. The author identifies a gap in the current operating system paradigms, which typically offer only two binary options: Rich Text or Plain Text.
This topic is critical because the standard clipboard behaviors often fail the needs of knowledge workers. Copying "Rich Text" frequently carries over unwanted artifacts-specific font families, background colors (especially problematic when moving between dark and light modes), and rigid sizing. Conversely, "Plain Text" (often accessed via "Paste and Match Style") is too destructive; while it removes the visual clutter, it also strips essential semantic information, such as hyperlinks, list hierarchies, and code block formatting. For a researcher trying to share a sourced snippet, losing the embedded hyperlink renders the text significantly less useful.
The Concept of "Comfortable Text"
lessw-blog proposes a middle ground described as "comfortable text." This format aims to preserve the structure of the content without retaining the style. The goal is to keep:
- Hyperlinks and anchor tags
- List structures (bulleted and numbered)
- Basic emphasis (bold/italics)
- Code blocks
Simultaneously, it aims to discard:
- Font faces and sizes
- Text and background colors
- Layout-specific HTML (like complex divs or spans)
The Technical Implementation
The post outlines a custom solution developed to automate this normalization process. Rather than building a complex HTML sanitizer from scratch, the author leverages Pandoc, a universal document converter. The workflow involves a Mac command/status-bar app that intercepts the clipboard content. It pipes the raw HTML input into Pandoc, converting it first into GitHub-flavored Markdown. It then immediately converts that Markdown back into HTML.
This round-trip conversion is the key innovation. Because Markdown supports structural elements but generally ignores inline CSS styling, the conversion process acts as a strict filter. The intermediate Markdown stage effectively strips out the visual noise while preserving the semantic skeleton of the document. The result is clean, structured HTML that pastes predictable, readable content into tools like Slack, Google Docs, or Obsidian.
While this tool is a personal utility, the methodology highlights a broader need for better data portability in technical workflows. As we increasingly work with structured data and AI-generated content, the ability to normalize text for human readability without losing information density is becoming essential.
For those interested in the intersection of developer tooling and workflow optimization, the full post offers a concise look at solving this specific friction point.
Read the full post on LessWrong
Key Takeaways
- Current clipboard options present a false dichotomy between messy Rich Text and information-poor Plain Text.
- The author introduces 'Comfortable Text,' a format that retains semantic structure (links, lists, code) but removes visual styling.
- The solution utilizes Pandoc to convert HTML to Markdown and back, using the Markdown format as a filter to strip CSS and layout data.
- This workflow addresses specific pain points in technical communication, ensuring links and code snippets remain intact during sharing.