copy-as-md
A Chrome extension that copies the page selection as Markdown. The converter underneath is also a self-contained library — paste HTML below to try it.
What it handles
- Headings (h1–h6), paragraphs, blockquotes, hr
- Bold / italic / strikethrough / inline code
- Links (with autolink fallback when text equals href)
- Images (
) - Ordered + unordered lists, including nested
- Code blocks with language hint from
class="language-*" - GFM tables, including
theadpromotion when missing - Skips
script,style,noscript
~230 lines of vanilla JS, 35 jsdom-backed tests. The same module loads in a Chrome MV3 content script and in Node — no DOM shim, no bundler.