Copy something from the web, paste it into your notes or README — and get a wall of <span> tags instead of clean Markdown. Here is why it happens, what VS Code can do about it on its own, and the fastest way to fix it properly.
Updated August 2026 · 5 minute read
When you copy from a web page, the clipboard holds the page's full HTML fragment — inline styles, spans, smart quotes, tracking attributes. What happens on paste depends on where you land:
VS Code inserts the raw HTML verbatim. Markdown renderers tolerate some inline HTML, so nothing errors — but your clean document fills up with <p style="..."> noise that is painful to edit later.
Smart quotes and non-breaking spaces are invisible in the editor but break string literals, YAML values and regexes at runtime. Classic source of "works on my machine".
Hidden markup bloats diffs and makes documentation inconsistent with hand-written Markdown around it.
The fix is to convert the clipboard between copy and paste — ideally with one keyboard shortcut, without leaving the editor.
| Option | What it does | Catch |
|---|---|---|
| Built-in paste | Inserts clipboard as-is (rich HTML kept when target accepts it) | No conversion at all — the whole problem |
| Paste as plain text | Strips all formatting via the command palette (Paste as plain text) | Loses everything — no headings, no links, no lists |
| Manual cleanup | Paste, then find-and-replace the worst offenders | Slow, error-prone, different every time |
| Clean Copy for VS Code | Converts clipboard HTML to proper Markdown or spotless plain text on paste | Free extension install — one time |
Clean Copy brings the converter behind the Clean Copy browser extension into your editor. Same core, same output — so text you copy to research and text you paste into docs behave identically.
H1–H6 map to the right number of # characters, so document structure survives the trip.
Links become standard Markdown references with the original URL — no relative-path surprises.
Simple HTML tables convert to Markdown pipe tables, including alignment.
Conversion happens inside the editor. Nothing is uploaded, nothing is tracked.
Not natively. Pasting rich text into a Markdown file inserts raw HTML tags. You need an extension such as Clean Copy for VS Code, which converts the clipboard HTML to Markdown (Ctrl/Cmd+Shift+V) before it lands in your editor.
By default there is none. With Clean Copy installed, Ctrl+Shift+V (Cmd+Shift+V on Mac) pastes the clipboard as clean Markdown, and the command palette offers a paste-as-plain-text command as well.
Yes. Headings map to # levels, links become [text](url), lists stay lists, bold and italic survive, code blocks become fenced blocks, and simple tables convert to pipe tables.
No. Clean Copy runs entirely inside your editor. The clipboard content is converted locally and never leaves your machine.