A simple Obsidian plugin to copy notes as HTML to the clipboard.
- Converts the Markdown content of a note to HTML (either selected text or entire document) using Obsidian's markdown renderer.
- Should work with all other plugins that add content to your note, like DataView (please keep in mind that all css classes that are not explixitly set in the config will be removed)
- Cleans up the HTML from the clutter obsidian likes to add
- Removes all atrributes from tags (a list of attributes to keep can be configured in the settings)
- Removes all classes (a list of classes to keep can be configured in the settings)
- Converts internal images up to a size of 128KB into base64 strings
- Removes empty paragraphs (leftovers from comment blocks, for example)
- Saves the resulting HTML to the clipboard.
Note
This plugin doesn't generate a full HTML page and I don't intend to add that feature.
- Copies a full note without any frontmatter to the clipboard.
- Can be also used on partially selected text, but it will be nothing more than a normal copy.
- This feature is probably just for my own enjoyment, and that fine. :)
- Open the command palette (default is
Ctrl+PorCmd+P) and search for "Content Copy". - Select Copy as HTML OR Copy as Text to save your current selection, or if nothing is selected, the full file to the clipboard.
- Desktop (Windows & Linux)
- iOS
- Android (not good at storing HTML type text in clipboard, so pasting the result into a Rich Text Editor might cause issues.)
Tip
On Android: Paste contents through the context menu of the text field and not through the keyboard copy option, since that method doesn't cut off the string after a certain amount of characters.
The plugin is now available in the Obsidian Community Hub.
- Download the latest release from the releases page.
- Unzip the downloaded file.
- Copy the folder to your Obsidian plugins directory (usually located at
.obsidian/plugins). - Enable the "Copy Markdown to HTML" plugin from the Settings > Community Plugins menu in Obsidian.