Search...Search plugins and themes...
⌘K
Sign in
  • Get started
  • Download
  • Pricing
  • Enterprise
  • Account
  • Obsidian
  • Overview
  • Sync
  • Publish
  • Canvas
  • Mobile
  • Web Clipper
  • CLI
  • Learn
  • Help
  • Developers
  • Changelog
  • About
  • Roadmap
  • Blog
  • Resources
  • System status
  • License overview
  • Terms of service
  • Privacy policy
  • Security
  • Community
  • Plugins
  • Themes
  • Discord
  • Forum / 中文论坛
  • Merch store
  • Brand guidelines
Follow us
DiscordTwitterBlueskyThreadsMastodonYouTubeGitHub
© 2026 Obsidian

PastePolish

riveriseriverise192 downloads

Polish your AI-generated notes by properly removing redundant blank lines while protecting critical Markdown rendering.

Add to Obsidian
  • Overview
  • Scorecard
  • Updates2

PastePolish is an Obsidian plugin that fixes the “spatial bloating” commonly introduced when pasting content from AI assistants such as ChatGPT, Gemini, or Claude.

When rich text is converted into Markdown, it often produces excessive blank lines. PastePolish intelligently compresses these gaps while preserving Markdown structure, allowing you to clean pasted content safely in Edit Mode.


✨ Features

Smart Markdown Protection

PastePolish detects Markdown block elements and preserves the required buffer lines above them.

Protected structures include:

  • Tables
  • Setext headings and horizontal rules

This prevents formatting breakage caused by overly aggressive whitespace removal.


Gradual Refinement (x → x − 1)

A unique mode that reduces consecutive blank lines one step at a time.

This allows you to gradually adjust the spacing of a document instead of applying a single irreversible cleanup.


Aggressive Cleanup

Instantly collapse all redundant blank lines into exactly one line, restoring clean Markdown formatting with a single command.


Preview

PastePolish Before and After Comparison

Example showing text pasted from Gemini Web. HTML-to-Markdown conversion introduced excessive blank lines, which PastePolish cleans up while preserving structural spacing.


🚀 Installation

Community Plugins (after official review)

  1. Open Settings → Community plugins
  2. Search for PastePolish
  3. Install and enable

Manual Installation

  1. Download main.js and manifest.json from the latest release.

  2. Place both main.js and manifest.json inside your vault:

.obsidian/plugins/paste-polish
  1. Reload Obsidian and enable the plugin in Community Plugins.

🧭 Usage

  1. Paste content into a note
  2. Select the text you want to clean
  3. Run the command:
PastePolish: Polish pasted spacing

You can trigger this via the Command Palette or assign a custom hotkey.


⚙️ Settings

Compression Mode

Gradual (Default) Reduces consecutive blank lines by one per execution.

Aggressive Collapses all consecutive blank lines into exactly one.


🔍 Implementation Overview

PastePolish uses a context-aware regex engine rather than simple global replacement.

Block Detection

The plugin identifies Markdown block syntax using patterns such as:

/^[ \t]*([-=]{3,}|\|)/

These heuristics allow the plugin to maintain safe spacing around structural elements.

State-Based Gap Reduction

A newline counter tracks consecutive blank lines and safely reduces them while respecting platform-specific line endings (\n or \r\n).


⌨️ Hotkeys

Hotkeys can be configured in Settings → Hotkeys.

Search for PastePolish to bind your preferred shortcut.


📄 License

MIT License

HealthExcellent
ReviewSatisfactory
About
Polish pasted Markdown by removing excessive blank lines while preserving tables, dividers, code blocks, and callouts. Choose gradual one-step reductions to refine spacing step-by-step or use aggressive cleanup to collapse consecutive blank lines into a single line in Edit Mode.
MarkdownFormattingEditing
Details
Current version
1.0.1
Last updated
5 months ago
Created
5 months ago
Updates
2 releases
Downloads
192
Compatible with
Obsidian 0.15.0+
Platforms
Desktop, Mobile
License
MIT
Report bugRequest featureReport plugin
Author
riveriseriverise
github.com/Riverise
GitHubriverise
  1. Community
  2. Plugins
  3. Markdown
  4. PastePolish

Related plugins

Outliner

Work with your lists like in Workflowy or Roam Research.

Linter

Format and style your notes. Linter can be used to format YAML tags, aliases, arrays, and metadata; footnotes; headings; spacing; math blocks; regular Markdown contents like list, italics, and bold styles; and more with the use of custom rule options.

Various Complements

Complete words similar to auto-completion in an IDE.

Sort and Permute lines

Sort and Permute lines in whole file or selection.

Heading Shifter

Easily Shift and Change Markdown headings.

Shortcuts extender

Use shortcuts for input special symbols without language switching.

List Callouts

Create simple callouts in lists.

Blur

Create obfuscated blocks of text.

Symbols Prettifier

Prettify the symbols with actual symbols you commonly type, like arrows.

Easy Copy

Easily copy the text within inline code, bold text (and many other formats), or quickly generate an elegant link to a heading or block.