Markdown to HTML Docs
iLoveMD renders Markdown into clean, semantic HTML using a JavaScript parser bundled with this page. Output is sanitized with DOMPurify, headings are real <h1>–<h6> tags, tables are GitHub-flavored, and code blocks tagged as mermaid become rendered diagrams automatically. The whole pipeline runs in your browser — your Markdown source never leaves your device.
Supported syntax
Standard CommonMark plus GitHub-flavored tables. The parser handles:
- Headings (
# H1 through ###### H6)
- Bold (
**bold**), italic (*italic*), strikethrough (~~strike~~)
- Inline code (
\`code\`) and fenced code blocks (\`\`\`lang ... \`\`\`)
- Ordered and unordered lists with arbitrary nesting
- Tables with column alignment (
:-- / :--: / --:)
- Links (
[text](url)), images (), blockquotes (> ...)
- Horizontal rules (
---)
Tip: if your Markdown uses extended syntax like footnotes or YAML frontmatter, the current parser ignores it. CommonMark + tables is the supported feature set.
Mermaid diagrams (new) feature
Markdown containing a fenced code block tagged mermaid renders the diagram in the live preview AND bakes it into the downloaded HTML as a base64 PNG image. Your file opens standalone, offline, with the diagram visible — no runtime dependency on iluvmd.com or the network.
# My doc
\`\`\`mermaid
graph TD
A[Start] --> B[End]
\`\`\`
The diagrams are rendered using the same engine as our Mermaid Editor — locked to securityLevel: 'strict', with init-directive stripping and a Mermaid-aware SVG sanitizer. See the editor's Docs for the full list of supported diagram types (Flowchart, Sequence, Class, State, ER, Gantt, Pie, Git Graph, Mind Map, User Journey).
Tip: for portability, the embed format is PNG. If you want a vector SVG you can edit downstream, use the standalone
Mermaid Editor and choose
Export SVG.
What the output looks like
Click Source above the preview to see the raw HTML. Headings render as real <h1>–<h6> tags, not styled divs — semantically correct for screen readers, search engines, and downstream parsers.
The downloaded .html file is a complete document: <!DOCTYPE html>, language attribute, viewport meta, character set, and a small inline stylesheet that matches the on-page preview. Open it directly in any browser. No external assets, no internet required.
Sanitization
Every HTML string leaving the Markdown parser passes through DOMPurify with a strict configuration: no <svg> root injection, no <style> element, no inline style= attribute, no <iframe>/<object>/<embed>/<form>. That blocks the most common XSS vectors even if the input Markdown smuggles raw HTML.
Every <a> in the output gets target="_blank" rel="noopener noreferrer" automatically — safe to paste into Gmail, Notion, a Google Doc, or anywhere else without the linked page being able to navigate back through window.opener.
Privacy
The Markdown parser, the DOMPurify sanitizer, and the Mermaid renderer all run entirely in your browser. We never see your file. No analytics, no server-side conversion, no third-party CDN fetches at conversion time. Once the page has loaded, the conversion works offline.