Drop in two files, write markdown directly in your HTML. no build step, no npm, no configuration.
Built on Web Components standards. No build step, no npm, no framework required — just two files.
One .js and one .css file. No npm, no bundler, no configuration of any kind.
Built on the native Custom Elements API. Works in all modern browsers alongside any framework — or none.
Styles never bleed in or out. Your page and your markdown content stay completely independent.
Write naturally indented markdown inside your HTML. Common leading whitespace is stripped automatically.
Uses currentColor and relative units — adapts to your page's text color and font size seamlessly.
Headings, bold, italic, strikethrough, code blocks, blockquotes, callouts, nested lists, task lists, tables, links, and images.
Elements added to the DOM after page load render automatically via connectedCallback.
~200 lines of readable JavaScript. Easy to audit, easy to understand, easy to fork.
No configuration required. Add two files and start writing markdown anywhere in your HTML.
Download mark-down.js and mark-down.css and place them in your project. That's the entire install.
Add mark-down.js to your <head> with defer. The CSS loads automatically from the same folder.
Place <mark-down> anywhere in your page body, write markdown inside it, and open in a browser.
<!-- Load once in <head> --> <script src="src/mark-down.js" defer></script> <!-- Use anywhere in <body> --> <mark-down> # Hello, World! This is **bold**, this is *italic*, and this is `inline code`. - Item one - Item two - Item three > A blockquote with *formatted* content inside. ```js console.log("Hello from a code block!"); ``` </mark-down>
These are real <mark-down> elements rendered by the library right now on this page.
All standard markdown constructs — write it exactly the way you already know.
| Markdown | Output | Notes |
|---|---|---|
| # Heading 1 | H1 through H6 | One to six # characters followed by a space |
| **bold** | bold | Also works with __double underscores__ |
| *italic* | italic | Also works with _single underscores_ |
| ***bold italic*** | bold italic | Triple asterisks for both at once |
| ~~strikethrough~~ | Double tildes | |
| `inline code` | inline code | Single backtick; content is HTML-escaped |
| ```lang … ``` | Code block | Fenced triple backticks; optional language hint |
| - item | Unordered list | Bullet characters: -, *, or + |
| 1. item | Ordered list | Any digit followed by a period and space |
| - sub-item | Nested list | Indent sub-items with 2+ spaces; can mix ordered and unordered |
| - [ ] task | Task list | [ ] unchecked, [x] checked; nests and mixes freely |
| > quote | Blockquote | Markdown renders recursively inside blockquotes |
| > [!NOTE] | Callout | GitHub-style alerts: NOTE, TIP, IMPORTANT, WARNING, CAUTION |
| --- | Horizontal rule | Three or more ---, ***, or ___ |
| [text](url) | Link | Standard inline link syntax |
|  | Image | Renders responsive with max-width: 100% |
| | col | col | | Table | GFM pipe table with header separator row |
| two trailing spaces | Line break | Hard <br> within a paragraph |
Every color, font, size, and border in mark-down.css is a CSS variable. Override only what you need — everything else stays as the default.
Link one of the included theme files after the script tag. One line, done.
Create a CSS file that sets any --md-* variables on mark-down. Only declare what you want to change.
Set variables directly on any <mark-down> element via a style attribute or targeted CSS selector.
GitHub-dark palette — lighter links, muted borders, and adapted callout colors for dark backgrounds.
md-theme-dark.css
Serif font, no border-radius anywhere, transparent code backgrounds — stripped back to the essentials.
md-theme-minimal.css
Sepia tones and a serif font — earthy palette throughout, great for editorial or documentation sites.
md-theme-warm.css
<!-- Load the library --> <script src="src/mark-down.js" defer></script> <!-- Add a theme (pick one, or write your own) --> <link rel="stylesheet" href="themes/md-theme-dark.css"> <!-- Or override individual variables inline --> <style> mark-down { --md-font-family: Georgia, serif; --md-link-color: #b03a2e; --md-pre-radius: 0; } </style>
Two files. No build step. No npm. Just drop them in and start writing markdown in your HTML today.