Paste as HTML code

Use case or problem

When I paste HTML content copied from a browser into Obsidian, I want to have an option to paste the HTML code without converting it to Markdown format.

Proposed solution

Since Obsidian support HTML block, so I guess this function is not hard to achieve. Just put HTML format of the content in the system clipboard into the HTML block.

Use Ctrl/Cmd + Shift + V to paste without it being converted to Markdown.

I don’t think that’s what OP wants. The above shortcut pastes as plaintext while OP wants to paste as HTML.

As a workaround, rather than focusing on the pasting step of your process, you might want to focus on the copying step:

Use “Selection → HTML” then paste into Obsidian.

1 Like

Obsidian sanitizes HTML. That could be part of the issue.

Thank you, I also found a workaround. Vscode has a extension called “Paste Special”, I can paste HTML code in vscode using this extension, then copy that code into Obsidian.