A plugin for Obsidian that reformats pasted HTML and plain text content, giving you precise control over how content is transformed when pasted into your notes.
<vault>/.obsidian/plugins/The Paste Reformatter plugin automatically processes content when you paste it into your notes using Ctrl+V (or Cmd+V on macOS). The plugin:
A notification will appear briefly indicating whether HTML or plain text content was reformatted. This can be disabled in settings.
Note: commands are prefixed with "Paste Reformatter:" in the hot-key list.
| Command | Description |
|---|---|
| Reformat and Paste | By default, Paste Reformatter overrides Obsidian's normal paste behavior. Alternatively, you can disable this behavior (see below) and bind a hot-key to this command. |
| Paste with Escaped Markdown | Pastes text with all markdown escaped. For example, [Data] becomes \[Data]. |
Paste Reformatter can potentially conflict with other Obsidian plugins that override the default paste behavior. To mitigate this, Paste Reformatter will only prevent the default handling of the paste event if it actually performs a transformation on the pasted text. Otherwise, it will allow the default behavior to take place. This won't prevent all potential collisions, however. So if you run into problems, disable "Override default paste behavior" and bind a hotkey to the "Paste and Reformat" command.

When this setting is enabled, the default behavior of Obsidian's Paste function will be enhanced. Otherwise, Reformat and Paste command can be bound to an alternative hot-key to get enhanced paste behavior.
When enabled, a notice appears after reformatting content. Disable this to hide notifications.
These settings control how HTML content is processed before being converted to Markdown.
When enabled, this setting removes empty elements (such as empty paragraphs, divs, spans) from the pasted HTML. This helps clean up content that might contain unnecessary structural elements.
Elements with meaningful content (including images, horizontal rules, etc.) are preserved even when empty.
When enabled, this setting removes <br> tags from the HTML, resulting in paragraph-style text flow. When disabled, line breaks are preserved in the resulting Markdown.
This feature allows you to define custom regular expression patterns and replacements to apply to the HTML content before it's converted to Markdown.
Each replacement consists of:
You can use capture groups in your patterns and reference them in the replacement using $1, $2, etc.
These settings control how the Markdown content is processed after HTML conversion (or directly for plain text).
This setting controls the maximum heading level that will be applied to pasted headings.
The value is an integer between 1 and 6, where:
When set to a value other than H1 (disabled), headings that are shallower than the specified level will be increased to that level.
When enabled, this option preserves the heading hierarchy by cascading levels based on the Max Heading Level setting.
For example, if Max Heading Level is set to H2:
This preserves the relative structure of your headings while ensuring they fit within your document's hierarchy.
This setting is only available when Max Heading Level is set to something other than H1 (disabled).
When enabled, this option adjusts heading levels based on the current context in your document. The plugin detects the heading level at your cursor position and cascades pasted headings relative to that context.
For example, if your cursor is positioned in a section with an H2 heading:
This is particularly useful when pasting content into different sections of your document and wanting the heading structure to fit naturally within the current section's hierarchy.
When used together with Cascade Heading Levels, the relative hierarchy of headings in the pasted content will be preserved.
When enabled, this setting removes blank lines from the Markdown output, resulting in more compact content. When disabled, empty lines are preserved, maintaining the original spacing.
Similar to HTML Regex Replacements, this feature allows you to define custom regular expression patterns and replacements to apply to the Markdown content after conversion.
This is useful for:
When copying content from websites, you often get unwanted elements. With these settings:
A complex web article with various heading levels and formatting will be transformed into clean, hierarchical Markdown with H2 as the top-level heading.
When copying content from a document with specific formatting:
The content will maintain its original structure, but headings will be adjusted to fit within the current document's hierarchy based on your cursor position.
(<img[^>]*)(width|height)="[^"]*"$1<span style="font-weight:\s*bold[^"]*">(.*?)</span><strong>$1</strong>(“|”)"\s*class="[^"]*"<div([^>]*)>(.*?)</div><p$1>$2</p>> Note:(.*?)(\n\n|\n$)> [!note]$1$2\[([^\]]+)\]\(https://en.wikipedia.org/wiki/([^\)]+)\)[[$2|$1]]^(#+\s*.*?)(TODO|REVIEW|IMPORTANT)(.*)$$1$2$3 #task(\d{1,2})/(\d{1,2})/(\d{4})$3-$1-$2^(\s*)\*$1-This project is licensed under the BSD Zero Clause License - see the LICENSE file for details.