Ultra Paste

approvedunreviewed

by Mohammad Mahdi Zamani

Cross-platform smart paste for Markdown, math, PDFs and images with mobile-safe network and clipboard fallbacks.

Updated todayMIT

๐Ÿš€ Ultra Paste

A smarter, safer clipboard for Obsidian โ€” Markdown, AI text, math, links, PDFs, images, and custom rules in one plugin.

Version: 0.2.1 ยท Platform: Desktop & Mobile ยท License: MIT ยท Built with: Plain JavaScript (no build required to install)

Ultra Paste helps turn content copied from browsers, AI assistants, articles, PDFs, and other apps into useful Obsidian notes. It combines smart formatting with explicit escape hatches: paste exactly what you copied, preview the result, or choose a specialized command when needed.

[!IMPORTANT] Strict plain paste means strict plain paste. Ctrl/Cmd + Shift + V inserts the clipboard's text/plain without regex rules, title fetching, whitespace cleanup, LaTeX repair, URL rewriting, HTML conversion, or any other Ultra Paste transformation. Text already selected in the editor is replaced as with a normal paste; the clipboard text itself is not rewritten.

โœจ Feature overview

๐Ÿง  Smart Paste & clipboard handling

  • โœ… Automatic clipboard detection using an ordered detector pipeline: code context โ†’ standalone web URL โ†’ rich HTML or text, with a native Obsidian fallback when no detector claims the paste.
  • โœ… Three paste modes: Auto (recommended), Prefer rich HTML, and Plain text only.
  • โœ… Rich HTML โ†’ Markdown: preserve headings, emphasis, links, lists, tables, blockquotes, and code where supported by the clipboard HTML and Obsidian's converter.
  • โœ… AI/chat cleanup: repair common copied-markdown formatting, heading artifacts, extra blank lines, and optionally remove synthetic AI citation markers.
  • โœ… Markdown-first option: keep already useful plain-text Markdown instead of unnecessarily rebuilding it from HTML.
  • โœ… Protected content: keep fenced code, inline code, existing math, and other protected spans out of ordinary prose transformations.
  • โœ… Code-friendly paste: detect when the cursor is inside a code fence or inline code and insert plain clipboard text without smart formatting.
  • โœ… Smart large-paste fallback: unusually large ordinary clipboard payloads are left to Obsidian's native paste handling.
  • โœ… Multi-format safety: image-plus-meaningful-text clipboard content is handed back to Obsidian rather than silently discarding the text.
  • โœ… Preview before insertion: inspect plain text, clipboard HTML, and proposed Markdown; choose Insert formatted, Insert original, or Cancel.
  • โœ… Raw HTML command: insert clipboard text/html as literal HTML source, preserving markup and inline styles supplied by the clipboard (not the same as HTML โ†’ Markdown).
  • โœ… Reader-style article extraction: an optional command extracts the main article content from copied HTML using a lightweight built-in extractor; regular Smart Paste never strips content as if it were a full article.

๐Ÿงฎ AI & LaTeX math repair

  • โœ… Convert \(...\) โ†’ $...$ and \[...\] โ†’ $$...$$.
  • โœ… Extract LaTeX from common KaTeX, MathJax, and MathML clipboard markup, including TeX annotations when present.
  • โœ… Recover clear AI-generated math in [ formula ] blocks, including multiline and quoted equations.
  • โœ… Recognize selected nested-bracket, matrix, and AI heading-export artifacts.
  • โœ… Preserve existing $...$ / $$...$$, code, links, citations, and typical Markdown constructs where recognized.
  • โœ… Optional plain-parentheses detection, such as (x=y); off by default because it can modify ordinary prose.
  • โœ… Optional experimental repair of ambiguous matrix separators; off by default.
  • โœ… Three on-demand math commands:
    • ๐Ÿ›ก๏ธ Safe: conservative delimiter and obvious-expression repair.
    • โš–๏ธ Balanced: broader mathematical-pattern detection and limited structural repair.
    • ๐Ÿช„ Aggressive: additional heuristic fixes with a mandatory before/after preview.
  • โœ… Commands operate on the selection or, if nothing is selected, the current note. They do not change your normal Smart Paste settings.
  • โœ… Counts and reports repaired expressions when running manual math commands.

๐Ÿ”— Links & URL cleanup

  • โœ… Remove common tracking query parameters, including utm_*, fbclid, gclid, and similar identifiers, while retaining other parameters.
  • โœ… Automatically fetch the page title of a single pasted public web URL (enabled by default).
  • โœ… Use selected text as the Markdown link label when you paste a URL over a selection.
  • โœ… Preserve already-labeled links rather than needlessly changing their titles.
  • โœ… Escape special Markdown characters in fetched titles.
  • โœ… Configure excluded websites and a maximum title length.
  • โœ… Keep the original URL if a title cannot be retrieved; skip local/private addresses and obvious non-page assets.
  • โœ… Use limited network requests for title retrieval. Mobile WebView restrictions may prevent some lookups.

๐Ÿงฑ Smart Structure Paste

  • โœ… Nested lists: rebase indentation when a pure Markdown list is pasted into another list item.
  • โœ… Checklists: preserve checkbox markers and relative nesting where the list format is recognized.
  • โœ… Blockquotes & callouts: continue the existing quote prefix across the pasted lines.
  • โœ… Context-aware activation: structure changes run only when the destination matches a supported pattern.
  • โœ… Two independent default-on toggles: Keep nested list indentation and Continue blockquotes and callouts.
  • โœ… Never runs for strict plain paste.

๐Ÿ“„ Clean PDF Text

  • โœ… Dedicated selection-only Command Palette action; no automatic PDF cleanup during ordinary paste.
  • โœ… Rejoin lines wrapped by a PDF page layout.
  • โœ… Repair common hyphenated words split across lines.
  • โœ… Expand typographic ligatures such as ๏ฌ โ†’ fi.
  • โœ… Try to preserve recognized Markdown structure, links, code fences, and display math.
  • โœ… Optional Remove isolated page numbers and Join prose into one paragraph switches, both initially off.
  • โœ… Review Original selection and Cleaned preview, then Apply cleaned text or Cancel.

๐Ÿ–ผ๏ธ Smart Image Paste

  • โœ… Handle actual pasted/dropped image files without taking over unrelated attachments.
  • โœ… Support recognized PNG, JPEG, WebP, GIF, BMP, and AVIF image clipboard types.
  • โœ… Show an optional image preview, size, dimensions (when available), proposed filename, and destination before saving.
  • โœ… Automatic filename templates, with tokens: {{noteName}}, {{date}}, {{datetime}}, {{counter}}, {{originalName}}, {{imageNameKey}}, and {{frontmatter:key}}.
  • โœ… Collision-safe names: allocate distinct names instead of overwriting existing files.
  • โœ… Duplicate detection: reuse an identical destination image using SHA-256 when hashing is available.
  • โœ… Follow Obsidian's native attachment location by default; optionally use per-note images/<note-name>/ folders.
  • โœ… Optional display-width limits for portrait and landscape images, without resampling the underlying file.
  • โœ… Optional image compression/resizing (off by default). Original GIF animations are not recompressed.
  • โœ… Respect Obsidian's preferred Markdown-link or Wikilink style for image embeds.
  • โœ… Command to download an image from a public HTTPS URL, only after an explicit user action (up to 25 MB, subject to response checks).
  • โœ… Command to rename the image at the cursor with confirmation using Obsidian's file-management mechanisms.
  • โœ… Safer async handling: check the destination note before inserting image links. If the note changed after files were saved, insertion is canceled rather than writing into the wrong note.
  • โœ… No automatic mass moves, deletion of image folders, or image-URL downloads on ordinary paste.

๐Ÿงฉ Custom rules & configuration

  • โœ… Ordered regex find-and-replace rules, with individual enable/disable switches and Move Up / Move Down buttons.
  • โœ… Two rule scopes: Prose only (protects code, math, and URLs) and All content (potentially unsafe).
  • โœ… Support regex flags, capture-group replacements ($1, $2, โ€ฆ), and $SEL for the editor selection.
  • โœ… Optional JavaScript rules with matching context; disabled globally by default and not sandboxed.
  • โœ… Import an Ultra Paste settings JSON or supported Paste Transform rule export. Imported JavaScript rules remain disabled until explicitly reviewed.
  • โœ… Export settings to JSON through the clipboard.
  • โœ… Preserve the Settings page scroll position when adding, deleting, moving, or changing a rule's type.
  • โœ… Toggle the entire automatic Smart Paste engine from the Command Palette; manual specialized commands remain available.
  • โœ… Optional paste-success notices and debug logging (both off by default).

๐Ÿ”’ Performance, privacy & compatibility

  • โœ… Optimized protected-span restoration for large Markdown/math pastes.
  • โœ… Guard asynchronous clipboard, preview, and link-title operations against note/cursor changes where supported.
  • โœ… Protect the ordinary paste workflow with native-Obsidian fallbacks.
  • โœ… Support Obsidian Desktop and Mobile (isDesktopOnly: false).
  • โœ… Avoid requiring Node.js or Electron on mobile; use Web Crypto where available for image hashes.
  • โœ… Provide a mobile one-shot system Plain Paste command for platforms that block direct clipboard reads.
  • โœ… No analytics or telemetry implemented by Ultra Paste. Website-title requests and manually requested image downloads connect to the respective remote sites.

โŒจ๏ธ Keyboard shortcuts

ShortcutActionWhat it does
Ctrl + V (Windows/Linux) or Cmd + V (macOS)Smart PasteDetect clipboard content and apply enabled formatting features.
Ctrl + Shift + V or Cmd + Shift + VStrict Plain PasteInsert exact clipboard text/plain; no Ultra Paste replacements or processing.
Ctrl + Alt + V or Cmd + Option + VPreview PasteReview clipboard and formatted output before choosing what to insert.
Ctrl/Cmd + PObsidian Command PaletteSearch Ultra Paste to access the specialized commands below.

[!TIP] If another plugin or a custom Obsidian hotkey uses one of these shortcuts, check Settings โ†’ Hotkeys for conflicts. Shortcut availability also depends on the operating system and physical keyboard.

๐ŸŽ›๏ธ Command Palette reference

Open Ctrl/Cmd + P, then type Ultra Paste.

Command name (searchable text)How to use it
Toggle Ultra PasteEnable or disable automatic Smart Paste interception.
Preview clipboard and pasteCompare source and output; insert formatted text, insert original plain text, or cancel.
Paste as plain text (no transforms)Paste text/plain literally, without running rules or cleanup.
Paste next OS clipboard event as plain text (mobile)Arm a one-time plain paste, then invoke the device's normal Paste within 20 seconds. Useful if direct clipboard access is blocked.
Paste rich HTML from clipboardConvert clipboard HTML to Markdown, preferring the rich input.
Paste as HTML (raw clipboard HTML)Insert the literal clipboard HTML source, including available inline styles, without Markdown conversion.
Paste article from clipboard (reader extraction)Copy web/article content, then request a best-effort main-content extraction.
Fix AI math in selection or current noteRun the standard manual math repair command on the selection or entire note.
Fix Math โ€” Safe (selection or note)Run conservative math repair immediately (Undo is available).
Fix Math โ€” Balanced (selection or note)Apply broader math repair to the selection or note.
Fix Math โ€” Aggressive (preview required)Compare original and repaired math; Apply repaired math or cancel.
Clean PDF text in selection (preview)Select text copied from a PDF, set optional cleanup switches, review, then apply.
Save image from clipboard URL (confirm)Copy a single public HTTPS image URL, run the command, then review/confirm naming and saving.
Rename image at cursor (confirm)Place the cursor on a supported embedded image link and run the rename dialog.

๐Ÿ“ฑ Mobile quick guide

  1. Use your device's regular Paste action for Smart Paste; it uses whatever clipboard formats the operating system exposes.
  2. To bypass all processing, run Paste next OS clipboard event as plain text (mobile), then tap the device's Paste action within 20 seconds.
  3. Consider adding your favorite Ultra Paste commands to Obsidian's Mobile Toolbar.
  4. Direct clipboard HTML reading and certain network requests may be restricted by Android, iOS, or the embedded WebView. When unavailable, the command should report the limitation rather than inventing clipboard content.

โš™๏ธ Recommended settings

All controls live under Settings โ†’ Community plugins โ†’ Ultra Paste.

SettingDefaultRecommendation
Smart Paste enabledOnKeep on for routine use.
Paste modeAutoPrefer Auto unless you consistently copy rich HTML.
Prefer existing MarkdownOnPreserve properly structured AI Markdown.
Protect codeOnStrongly recommended.
Convert AI math delimitersOnReliable delimiter normalization.
Repair AI bracket mathOnConservative bracket repairs.
Detect bare parenthesis mathOffEnable only for documents that need it.
Repair ambiguous formula formattingOffExperimental; check results manually.
Clean link trackingOnRemove common trackers.
Auto-fetch link titlesOnTurn off if you do not want title-network requests.
Keep nested list indentationOnContext-sensitive.
Continue blockquotes and calloutsOnContext-sensitive.
Smart Image PasteOnUses image files from the clipboard.
Image naming previewOnReview names/paths before saving.
Image duplicate detectionOnReuse identical files where supported.
Per-note image foldersOffDefault to your Obsidian attachment settings.
Auto image display widthOffOptional for visual consistency.
Image compressionOffKeep originals unless size matters.
JavaScript rulesOffEnable only for code you trust.
Remove synthetic AI citationsOffOpt in only if those markers are unwanted.

๐Ÿงช Simple custom rule example

Add a Regular expression rule under Custom rules, then enable it:

  • Name: Replace TODO
  • Pattern: \bTODO\b
  • Flags: g
  • Replacement: Task
  • Scope: Prose only

JavaScript rules run with Obsidian/plugin privileges and are not sandboxed. Do not import executable rules from untrusted sources. Synchronous JavaScript is supported; asynchronous script rules are not.

๐Ÿ“ฆ Installation and updates

Requirements: Obsidian 1.5.0 or newer on Windows, macOS, Linux, Android, or iOS. The plugin includes the ready-to-run JavaScript bundle: no npm install, TypeScript compiler, or build step is required for installation.

  1. Download the Ultra Paste release ZIP and extract it.
  2. Find your vault's plugin directory: <your-vault>/.obsidian/plugins/.
  3. Copy the extracted ultra-paste folder into that directory. At minimum, Obsidian needs main.js and manifest.json.
  4. In Obsidian, open Settings โ†’ Community plugins, and enable Ultra Paste.
  5. If you previously installed an older version, back up and preserve .obsidian/plugins/ultra-paste/data.json before replacing the plugin files.
  6. Disable other plugins that intercept the same paste events, at least while testing, to avoid duplicate or conflicting transformations.

[!NOTE] The install ZIP contains JavaScript already ready for Obsidian. The separate source/test package is only for inspection and regression testing. Mobile support has passed simulated-runtime checks, but has not yet been verified on physical Android and iOS devices.

๐Ÿ’ก Everyday workflows

  • Copy from ChatGPT or a website โ†’ Ctrl/Cmd + V: keep useful Markdown, repair supported LaTeX delimiters, and clean common URL trackers.
  • Need untouched data or code โ†’ Ctrl/Cmd + Shift + V: insert only raw clipboard plain text, preserving its exact characters and line breaks as delivered by the clipboard API.
  • Not sure what will change โ†’ Ctrl/Cmd + Alt/Option + V: compare and choose the result manually.
  • Copy a long article โ†’ Paste article from clipboard: extract the central content when a reader-style result is desired.
  • Copy from a PDF โ†’ select the pasted text โ†’ Clean PDF text in selection (preview): repair wrapping only after checking the preview.
  • Math notation looks broken โ†’ Fix Math โ€” Safe / Balanced / Aggressive: escalate only as needed.
  • Paste an image โ†’ naming preview: confirm a meaningful name or cancel; duplicates can be reused instead of saved twice.

๐Ÿ›ก๏ธ Known limits and safety notes

  • Ultra Paste cannot reconstruct line breaks that were already missing from the original clipboard text.
  • Math recovery is heuristic beyond explicit LaTeX delimiters. Review Balanced and especially Aggressive changes in important academic notes.
  • The included article reader is a lightweight implementation, not the full Defuddle library.
  • Some MathML, complex HTML layouts, CSS-based formatting, and remote page titles may not survive or be available through the clipboard.
  • Mobile clipboard APIs and cross-origin networking vary across devices; title fetching and manual image downloads may fail for restricted sites.
  • A text-only clipboard cannot reproduce a binary image through Strict Plain Paste; this is intentional.
  • For safety, certain asynchronous operations are canceled if you change the target note, cursor, or selection before they complete.
  • Automatic image-folder deletion, mass relocation, and automatic web-image downloads are intentionally not implemented.
  • Custom JavaScript rules run with plugin privileges. Review them carefully and keep backups of your vault and settings.

๐Ÿ™ Acknowledgements

๐Ÿ’œ Many thanks to the creators and contributors of Clean AI Paste, Paste Transform, Defuddle, Auto Link Title, Fix Math, Paste as HTML, Better Paste, Paste Plus, Paste Image Rename, and Smart Paste Image for sharing their work and inspiring Ultra Paste. ๐Ÿ™

๐Ÿ“œ License

MIT License โ€” see LICENSE.


โœจ Paste smarter when you want. Paste exactly when you need.

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.