A lightweight, dependency-free Markdown to HTML converter.
CartaNova takes plain Markdown text and transforms it into semantic, standards-compliant HTML.
It’s small enough to embed in a single file, yet supports most Markdown syntax — including tables, task lists, inline code, and more.
GitHub repository: enreeco/cartanova-markdown-js
- Headings (
#through######) - Paragraphs and line breaks
- Emphasis styles:
- bold, italic, ++underline++,
strikethrough, ==highlight==, ^superscript^,subscript
- bold, italic, ++underline++,
- Blockquotes (
>) - Lists
- Ordered, unordered, and
[ ]/[x]task lists
- Ordered, unordered, and
- Definition lists (
Term: Definition) - Inline and fenced code blocks (language hints ignored)
- Links and images
- Horizontal rules (
---,***,___) - Tables with column alignment (
:---,:---:,---:) - Safe by default — raw HTML is escaped
Include the parser and its default CSS in your page:
<link rel="stylesheet" href="markdownlite.css">
<script src="markdownlite.js"></script>Then render Markdown:
<div class="mdlite" id="output"></div>
<script>
const md = `
# Hello Markdown
This **text** was parsed by *CartaNova*.
`;
document.getElementById('output').innerHTML = MarkdownLite.parse(md);
</script>All output is wrapped in the .mdlite namespace,
so the included markdownlite.css styles won’t clash with your site.
Converts Markdown into sanitized HTML.
Renders Markdown directly into a DOM element.
CartaNova’s HTML is wrapped inside .mdlite.
You can safely override the default look by redefining these rules in your own stylesheet.
Example:
.mdlite h1 { color: crimson; }
.mdlite blockquote { border-left-color: gold; }The code is intentionally modular — each Markdown feature has a small, well-scoped parser function:
parseBlocks()handles block structurerenderInline()manages inline patterns- You can inject new syntax rules by adding functions and integrating them in the main parser loop
Example: adding custom shortcodes or new inline transforms takes only a few lines.
CartaNova’s purpose is clarity. It doesn’t try to emulate every edge case of CommonMark — instead it provides predictable, human-readable HTML suitable for editors, note-taking apps, or static site generators.
Think of it as “a new sheet of paper” — elegant, minimal, and under your control.
MIT © 2025 — Created with curiosity and caffeine.