Skip to content
P.

Mark It Down

Got a README, a spec, or release notes in Markdown? Turn it into one good-looking, self-contained HTML page — syntax highlighting and all — and share it as a link in seconds.

marked.js DOMPurify highlight.js One HTML file

pastehtml.dev publishes one thing: a single HTML file. Markdown is not HTML — so to share a .md we wrap it in a thin HTML shell that renders the Markdown in the reader's browser. The raw Markdown rides along inside the file (easy to view-source and copy), and a tiny script turns it into the pretty page you see.

The recipe

Embed the raw Markdown in a non-executed <script type="text/markdown"> block → parse it with marked → scrub the result with DOMPurify → colorize code with highlight.js → drop it into a comic-styled body. All three libraries load from a CDN, which pastes are explicitly allowed to do.

How it works

  1. Your Markdown is stored verbatim in a <script type="text/markdown"> tag — the browser never executes it, and any </script> inside it is safely escaped.
  2. On load, marked converts that Markdown (GitHub-flavored: tables, task lists, fenced code) into HTML.
  3. DOMPurify sanitizes the generated HTML, stripping anything dangerous so a malicious snippet in the source can't run.
  4. Each code block is highlighted with highlight.js, and the comic prose styles make headings, tables, and quotes pop.

Try it. Paste Markdown below and watch it render live; then build a self-contained page you can publish.

The Markdown Forge

Live preview
⚠ A couple of honest caveats

The page renders in the browser, so readers need JavaScript on. Pin the CDN versions (this forge does) so your page can't break when a library ships a new major. And keep it self-contained — relative image links won't resolve on a paste's isolated origin, so use full https:// image URLs or data URIs.

Publish it

Option A — Drag & drop

Drop the downloaded .html onto pastehtml.dev and copy the https://<token>.pastehtml.dev/ link it hands back.

Option B — The API (one-liner)

Already have your Markdown rendered to a file? Ship it straight from the terminal:

curl -F "[email protected]" https://pastehtml.dev/api/pastes

The 201 response gives you the shareable live_url and a one-time update_token — keep it to PATCH the same link when the doc changes. Full guide: pastehtml.dev/llms.txt.

Agents can skip the forge entirely: convert Markdown to this shell server-side, then POST it.

What the forge bakes in

The published file is just your Markdown plus this renderer. Here's the heart of it — the same code runs in the preview above and in every page you build:

<script type="text/markdown" id="md">
# Your Markdown lives here, verbatim
</script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/marked.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/purify.min.js"></script>
<script src="https://cdn.jsdelivr.net/gh/highlightjs/[email protected]/build/highlight.min.js"></script>
<script>
  var raw = document.getElementById("md").textContent.replace(/<\/(script)/gi, "</$1");
  var html = DOMPurify.sanitize(marked.parse(raw, { gfm: true }));
  document.getElementById("doc").innerHTML = html;
  document.querySelectorAll("#doc pre code").forEach(function (el) { hljs.highlightElement(el); });
</script>
Now go make it pretty.

A pastehtml.dev field guide. Rendered with marked, DOMPurify, and highlight.js.

pastehtml.dev — share HTML in seconds. Free · Anonymous · Instant.