# Wikinest Markdown to HTML
> Turn wiki Markdown with panels, status lozenges and a table of contents into safe HTML. Converts a Wikinest page written in Markdown into sanitised HTML: headings with anchors, tables, task lists, highlighted code, info/success/warning/error panels, expand sections, status lozenges, dates, mentions, [[page links]] and the table-of-contents and child-pages macros. It reports the outline, links that point nowhere and unsafe addresses it dropped.
Part of usefulweb.app (https://usefulweb.app/). Part of [Wikinest](https://wikinest.usefulweb.app/) (ownerApp: wikinest). Results are deterministic calculations from the inputs and the listed assumptions; the API returns exactly what the web page shows.
## Use it
- Human interface: https://wikinestmarkdowntohtml.usefulweb.app/ (interactive tool at https://wikinestmarkdowntohtml.usefulweb.app/tool)
- JSON API: POST https://wikinestmarkdowntohtml.usefulweb.app/api/v1/calculate with a JSON object of inputs (schema: https://wikinestmarkdowntohtml.usefulweb.app/api/v1/tool)
- OpenAPI: https://wikinestmarkdowntohtml.usefulweb.app/openapi.json
- MCP (Streamable HTTP): https://wikinestmarkdowntohtml.usefulweb.app/mcp - tool `wikinest_markdown_to_html`
## Inputs
- markdown (textarea): Page in Markdown - Wikinest Markdown: CommonMark and GitHub tables/task lists plus [[Page]] links, :::info panels, {status:green|Done}, {date:2026-11-24}, {{toc}} and {{children}}.
- pageTitles (textarea): Existing page titles (optional, one per line) - [[Links]] to these titles become links to .html; others are marked as missing pages.
- children (textarea): Child pages for {{children}} (optional, one per line)
- tocLevels (integer): Headings in the outline down to level
- standalone (boolean): Whole HTML document with a stylesheet (light and dark)
## Method
- Blocks are read line by line: ATX headings, paragraphs, fenced code, block quotes, bullet/numbered/task lists (nested by indentation), GFM tables with alignment, rules, and the Wikinest blocks — :::info/success/warning/error panels (note = info, tip = success), :::expand sections and the {{toc}}, {{children}} and {{embed URL}} macros on a line of their own.
- Inline: code spans, **bold**, *italic*, ~~strike~~, links, images, autolinks and bare https addresses, [[Page]] / [[Page|label]] / [[KEY:Page]] links, @[Name] mentions, {status:colour|text} lozenges and {date:YYYY-MM-DD}.
- Sanitised by construction: every piece of text is escaped, raw HTML in the Markdown is shown as text, links keep only http(s), mailto and #anchors, images only https and attachments; nothing else reaches the output. External links open in a new tab with noopener.
- Heading anchors are slugs of the heading text (duplicates get -2, -3); the outline nests headings by level and numbers them 1, 1.1, 1.2 …
- Code blocks are highlighted by a small one-pass tokenizer (comments, strings, numbers, keywords, literals, tags) for JavaScript/TypeScript, Python, shell, SQL, CSS, JSON, YAML, Go, Rust, Java/Kotlin/C#, C/C++, PHP and HTML/XML.