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

riveriseriverise32 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
  • Devidier
  • Code blocks
  • Callouts

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 the repository:

https://github.com/Riverise/obsidian-paste-polish

  1. Place both main.js and manifest.json inside your vault:
.obsidian/plugins/obsidian-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,}|\||[\~]{3,}|>|[-*+][ \t]+|\d+\.[ \t]+|\$\$|#{1,6}[ \t]+)/

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

95%
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
2 months ago
Created
2 months ago
Updates
2 releases
Downloads
32
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.

Various Complements

Complete words similar to auto-completion in an IDE.

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.

Easy Typing

Auto format when typing.

Blur

Create obfuscated blocks of text.

List Callouts

Create simple callouts in lists.

Columns

Create columns in Markdown.

Advanced Tables

Improved table navigation, formatting, and manipulation.

Importer

Import data from Notion, Evernote, Apple Notes, Microsoft OneNote, Google Keep, Bear, Roam, and HTML files.

Meta Bind

Make your notes interactive with inline input fields, metadata displays, and buttons.