Skip to content
Markdown → HTML
Sanitized live preview · raw HTML source to copy.
Blog

Converting Markdown to HTML Without Getting Burned

What to watch when you turn Markdown into HTML: table support, the sanitized preview versus the raw source, and the line-break gotcha.

Image correction — October 13, 2026: We removed the illustrated card set from this guide. Its “safe to preview and share” and “no tracking” wording overstated what this converter verifies, and its “Source: raw” illustration showed Markdown rather than the copied HTML. The examples below describe the actual output; the preview is not a publishing approval.

You wrote a clean README in Markdown, and now a CMS or an email needs it as HTML. Pasting it into a converter feels like the whole job, until the table falls apart, the lines run together, or someone converts a stranger’s Markdown and ships it straight into a page that then runs a script. Here is what actually matters when you convert.

Output correction — October 14, 2026: The earlier example wrongly changed the word “strikethrough” to “old.” Conversion keeps the text between the markers; it does not rewrite that word. The repeatable check below now shows the actual source.

How Markdown turns into HTML

The basics are familiar: # becomes a heading, * becomes emphasis. The tricky parts are extensions like tables and strikethrough.

The PiPi Worlds Markdown converter follows GitHub-flavored Markdown (GFM). A table expands into <table>, <thead>, and <td>, and ~~strikethrough~~ becomes <del>strikethrough</del>. Autolinks work too. GFM syntax support does not promise GitHub’s styling. The destination’s CSS, allowed tags, and email rendering rules can change the result.

The preview is sanitized; the copied source is raw

This is the distinction that matters most. What you see in the preview and what the copy button hands you are not the same thing.

The preview uses a separate formatting conversion: images become alt text, links become non-navigating text, and raw HTML is omitted. DOMPurify then processes that limited result with an allowlist. The copyable HTML source, by contrast, is the raw conversion. Convert Hi <img src=x onerror="alert(1)"> <script>alert(2)</script> and the source keeps that onerror and <script> intact. Not knowing this difference is where people get burned.

So where do you sanitize again?

Authorship alone is not a safety check. Even your own README can contain copied HTML or remote image URLs. Check what your destination permits, not just who wrote the document.

Intended useCheck before publishing
Showing HTML as a code exampleUse the destination’s code-block or escaping feature so tags stay text rather than being interpreted as HTML.
Rendering a page from HTMLApply the destination’s allowed-tag, attribute, and URL policy. Do not use this preview as approval of user-submitted HTML.
Passing sanitized HTML through another processorCheck what that processor changes. DOMPurify warns that later modifications can undermine sanitization.

Try [Read the notes](https://example.com/notes) in the converter. The preview shows the words without navigation; the HTML source still contains an anchor with an href. A working link in your CMS is therefore not a preview bug: the two outputs intentionally differ. This example checks conversion, not whether a destination URL or publication is safe.

Compare one input with both outputs

Paste this non-sensitive sample into the converter:

[Read the notes](https://example.com/notes)

The preview displays Read the notes as text, not a working link. The copyable HTML is:

<p><a href="https://example.com/notes">Read the notes</a></p>

That is HTML source, not the original Markdown. If you publish it as HTML, the destination may make the link clickable. Inspect that destination before publishing; this example does not certify it.

Use a private draft to check tables, line breaks, link destinations, and image sources before release. This is a publication checklist, not a security audit of your CMS or email service.

Why a single newline keeps the same line

It is small, but it trips people up constantly. You press Enter once in the Markdown and the HTML does not break the line.

Standard Markdown treats a single newline as a soft wrap. Split line 1 and line 2 with one Enter and they stay inside the same <p> paragraph. To truly separate paragraphs, leave a blank line between them. To force a break inside one paragraph, end the line with two spaces. When the spacing in an email or a CMS comes out wrong, this rule is usually why.

Check three formatting rules in one small example

Paste the following invented text into the English converter, then select HTML source. The end of line 3 contains two spaces before its newline. If your editor trims trailing whitespace, add those two spaces again; do not paste the words “two spaces.”

~~strikethrough~~

line 1
line 2

line 3  
line 4

The source is:

<p><del>strikethrough</del></p>
<p>line 1
line 2</p>
<p>line 3<br>line 4</p>

Compare the tags, not just the apparent spacing: <del> preserves the word, the single newline between lines 1 and 2 stays inside one paragraph without a <br>, and the two trailing spaces after line 3 produce a <br>. Switch to Preview to see the formatting difference. This checks conversion in this tool; a CMS or email client can style those tags differently.

Example check — October 14, 2026: We entered this non-sensitive sample in the live English converter and compared its source view with the conversion function. This does not test your publishing destination or certify arbitrary HTML as safe.

Where are you running that conversion?

The last point is about where the conversion happens. When you turn a draft, a meeting note, or an unreleased spec into HTML, a tool that sends that text somewhere routes your pre-publication content through an outside server.

The PiPi Worlds Markdown converter processes the input in your browser and does not send the text to a conversion endpoint. That does not control browser extensions or the service where you later paste copied HTML. Do not test with real credentials or sensitive documents; use the live preview and keep the sanitized-preview versus raw-source distinction in mind when copying. If a base64 blob shows up inside the HTML, the Base64 tool handles it, and if a chunk of JSON is in there, the JSON formatter does.

Frequently asked questions

Does it convert Markdown tables and strikethrough too?
Yes. It follows GitHub-flavored Markdown (GFM), so tables become `<table>` and `~~strikethrough~~` becomes `<del>`. Autolinks work too. The copied HTML source is not sanitized. Sanitize untrusted input before publishing it in a CMS or email template.
What does a 'safe' preview actually mean?
It is a formatting-only view. Markdown images become alt text, links become non-navigating text, and raw HTML is omitted in a separate conversion path before DOMPurify processes the result. This is not a faithful page simulation or a security certificate. The copyable HTML source, however, is the raw conversion, so re-sanitize on your own server if the input is untrusted.
Why doesn't a single line break start a new line?
In standard Markdown a single newline is a soft wrap, so the text stays in the same paragraph. Put a blank line between paragraphs, or end a line with two spaces to force a hard break within one.
Can I paste raw HTML inside the Markdown?
Yes, and it passes straight through into the copyable source. The preview omits raw HTML, but the copyable source itself is raw, so publishing untrusted HTML as is can be dangerous.
Is the Markdown I paste sent to a server?
This conversion runs in your browser and does not send the text to a conversion endpoint. Browser extensions and services where you later paste copied HTML are outside this tool’s control. Do not use real credentials or sensitive documents as test input.

Sources

Review record: Codex code and copy review · not a human security audit

Recorded checks and limits

On October 14, reproduced strikethrough and soft/hard line breaks in the live English converter and checked the same input against its conversion function. Corrected the mismatched strikethrough output and added exact source for readers to compare. This is a conversion-example check, not a new security audit; external source access dates remain unchanged. Previously inspected all four displayed English card images and removed their misleading safety/HTML-output illustrations from this guide. Reproduced the linked-text example against both conversion functions. Checked MarkdownHtml.jsx local input state, markdownToHtml(input), the separate markdownToPreviewHtml(input) and sanitizeMarkdownPreview path, and MarkdownGuide.jsx warnings about extensions and copied output. I did not measure every browser or extension or certify secret-input safety.

What this guide adds — I compared the input and output paths in MarkdownHtml.jsx and markdown.js: the conversion has no request to a conversion endpoint, while DOMPurify is applied to the preview rather than the copied HTML. The FAQ and body now distinguish that local processing from browser extensions and downstream paste destinations.

This records the stated checks; it is not an independent guarantee of accuracy.

Back to the tool →