Markdown to Confluence Markup Converter
Convert Markdown to Confluence Wiki Markup instantly. Supports headings, tables, code blocks, links, lists, and all standard Markdown syntax.
About
Confluence Wiki Markup uses a proprietary syntax that diverges from Markdown in nearly every construct. Headings use h1. instead of #. Bold wraps in single asterisks, not double. Code blocks require {code} tags. Links invert to [label|url]. Manual conversion across a large document introduces transposition errors that break page rendering in Confluence without clear diagnostics. This converter implements a two-pass parser: block-level tokenization followed by inline markup transformation. It handles nested lists, pipe tables with header rows, multi-line code fences with language hints, blockquotes, images, and horizontal rules. The tool approximates correct output assuming standard CommonMark input. Edge cases include raw HTML passthrough (not converted) and deeply nested blockquote-list combinations, which Confluence itself renders inconsistently.
Formulas
This converter applies a deterministic two-pass text transformation algorithm. No mathematical formulas are involved. The logic is rule-based pattern matching.
Pass 1 → Block Tokenization
The input string S is split by newline into lines L0, L1, …, Ln. Each line is classified into a block type B ∈ {HEADING, CODE_FENCE, UL, OL, BLOCKQUOTE, TABLE, HR, PARAGRAPH} via regex prefix matching.
Pass 2 → Inline Transformation
Within each non-code block, inline patterns are replaced sequentially: bold (**text** → *text*), italic (*text* → _text_), strikethrough (~~text~~ → -text-), code (`text` → {{text}}), image, link. Order matters: bold must be matched before italic to avoid single-asterisk conflicts.
Where S = input Markdown string, Li = individual line at index i, B = block type classification, n = total number of lines.
Reference Data
| Markdown Syntax | Confluence Wiki Markup | Element Type | Notes |
|---|---|---|---|
| # Heading | h1. Heading | Heading 1 | Levels 1-6 supported |
| ## Heading | h2. Heading | Heading 2 | |
| **bold** | *bold* | Bold | Single asterisks in Confluence |
| *italic* or _italic_ | _italic_ | Italic | Underscores in both systems |
| ~~strikethrough~~ | -strikethrough- | Strikethrough | Hyphens in Confluence |
| `inline code` | {{inline code}} | Inline Code | Double curly braces |
| ```lang ... ``` | {code:lang}...{code} | Code Block | Language parameter optional |
| [text](url) | [text|url] | Link | Label and URL separated by pipe |
|  | !src|alt=alt! | Image | Exclamation marks wrap source |
| - item | * item | Unordered List | Nested: **, *** |
| 1. item | # item | Ordered List | Nested: ##, ### |
| > quote | {quote}...{quote} | Blockquote | Block-level macro |
| --- or *** | ---- | Horizontal Rule | Four hyphens in Confluence |
| | H1 | H2 | | || H1 || H2 || | Table Header | Double pipes for headers |
| | C1 | C2 | | | C1 | C2 | | Table Cell | Single pipes for body rows |
| [text](url "title") | [text|url] | Link with Title | Title attribute discarded |
| \*escaped\* | *escaped* | Escaped Characters | Backslash escapes removed |