Clean AI Paste
approvedby Jeremy Hou
This plugin has not been manually reviewed by Obsidian staff. Instantly turns messy AI output into clean Obsidian notes on paste. Removes excessive blank lines, fixes code blocks, headers, removes emojis, and more.
Clean AI Paste for Obsidian
Clean AI Paste is an Obsidian plugin designed to automatically clean up and format text pasted from AI chatbots (ChatGPT, Claude, Gemini, etc.) instantly and silently, every time you paste.
When you copy text from an AI web interface, the result in Obsidian is often cluttered with excessive blank lines, malformed code blocks, over-bolded headers, and broken LaTeX math. This plugin intercepts the paste event, converts the clipboard HTML to native Markdown, and applies a fully customizable set of formatting rules before inserting it into your note.
Main Features Before & After
| Feature | Original AI Paste | With Clean AI Paste |
|---|---|---|
| Headers | ### **Introduction** | ### Introduction |
| Blank Lines | Paragraph.Next paragraph. | Paragraph.Next paragraph. |
| Code Blocks | python```print("hi")``` | ```pythonprint("hi")``` |
| Math (LaTeX) | \( x = y \) | $ x = y $ |
| Tracking URLs | https://example.com/?utm_source=chatgpt.com | https://example.com/ |
Features
Formatting & Cleanup
- Condense Blank Lines - Strips excessive vertical spacing generated by AI between paragraphs, lists, and sections.
- Strip Trailing Whitespaces - Removes invisible trailing spaces at the end of every line.
- Strip Emojis - Removes all emoji characters from pasted text.
- Clean Link Tracking Parameters - Automatically removes marketing and tracking parameters (e.g.,
?utm_source=chatgpt.com) from URLs in pasted text while preserving important query parameters.
Markdown Elements
- Unbold Headers - Strips bold markers (
**or__) from Markdown headers (**## Header**→## Header). - Unbold Links - Removes bold formatting wrapped around links (e.g.,
**[Link Text](url)**→[Link Text](url)). - Header Downgrade Level - Automatically shifts pasted headers down by 1, 2, or 3 levels (e.g.,
#→##). - Convert Math Delimiters - Converts LaTeX delimiters (
\(,\),\[,\]) into Obsidian's native$and$$. - Format Horizontal Rules - Ensures proper blank-line padding around
---separators. - Padding Before/After Code Blocks - Independently control whether a blank line is inserted before and after every code block.
Code Block Intelligence
- Detached Language Labels - Automatically detects floating language names (e.g., a bare line reading
pythonabove an unlabeled code block) and binds them into the opening backticks (```python). - Duplicate Label Removal - Detects and removes the redundant language label that Claude generates when copying manually (e.g.,
bashfloating above```bash). - Indentation Stripping - Automatically left-aligns code blocks that are deeply indented inside numbered lists or step-by-step instructions.
Other
- Add Tracking Signature - Wraps pasted text with fully customizable hidden HTML comments (invisible in Reading View) to track AI-generated text in source. The start and end tags are independently configurable and can be toggled on/off.
- Enable Paste Notifications - Shows a brief Obsidian
Noticepopup when the plugin fires (off by default). - Ignore Formatting with
Shift+Ctrl/Cmd+V- Paste with markdown structure preserved but no plugin transforms applied.
How to Use
Simply paste from your AI tool of choice using the standard shortcut:
- Windows / Linux:
Ctrl+V - macOS:
Cmd+V
All formatting rules fire instantly and automatically. To bypass the plugin entirely and paste unformatted text, use Shift+Ctrl+V or Shift+Cmd+V.
Settings
All rules are individually toggleable from Settings → Clean AI Paste. Settings are organized into three sections:
- Formatting & Cleanup - Global text cleanup rules.
- Markdown Elements - Rules for specific Markdown syntax.
- AI Tracking & Notifications - Source-level tracking and user feedback.
Installation
From the Community Plugin Store (Recommended)
- Open Obsidian and go to Settings → Community plugins.
- Disable Restricted mode if prompted.
- Click Browse and search for Clean AI Paste.
- Click Install, then Enable.
Manual Installation
- Download the latest release from the GitHub repository.
- Copy the
main.jsandmanifest.jsonfiles into a new folder atYourVault/.obsidian/plugins/clean-ai-paste/. - In Obsidian, go to Settings → Community plugins, refresh Obsidian, find Clean AI Paste, and toggle it ON.
Compatibility
- Obsidian: 0.15.0+
- Platform: Desktop and Mobile (iOS & Android)
License
For plugin developers
Search results and similarity scores are powered by semantic analysis of your plugin's README. If your plugin isn't appearing for searches you'd expect, try updating your README to clearly describe your plugin's purpose, features, and use cases.