MD2Wiki - Markdown to Confluence Converter
Convert your Markdown files to Confluence rich text format with one click!
Features
- Bidirectional Conversion: Convert between Markdown and Confluence formats
- Markdown → Confluence: Convert and copy Markdown to Confluence rich text
- Confluence → Markdown: Paste Confluence content and convert to Markdown
- Right-Click Conversion: Convert Markdown files to Confluence format with a simple right-click
- Automatic Table of Contents: Automatically inserts TOC macro at the beginning
- Mermaid Diagram Support: Preserves Mermaid code blocks (Confluence renders them automatically)
- Table Support: Converts HTML tables to Markdown tables (Confluence → Markdown)
- Selection Conversion: Convert only selected text
- Configurable: Customize TOC style, auto-insertion, and notifications
Usage
Convert Entire File
- Open a Markdown file in VSCode
- Right-click anywhere in the editor
- Select "MD2Wiki: Convert to Confluence Format"
- Content is converted and copied to clipboard
- Paste (
Cmd+V or Ctrl+V) into Confluence editor
Alternative: Use Command Palette
- Open Command Palette (
Cmd+Shift+P / Ctrl+Shift+P)
- Type "MD2Wiki: Convert to Confluence Format"
Convert Selection Only
- Select text in a Markdown file
- Right-click on the selected text
- Choose "MD2Wiki: Convert Selection to Confluence Format"
- Paste into Confluence
Note: This option only appears when you have text selected.
Paste from Confluence (Convert to Markdown)
- Copy content from Confluence (Cmd+C / Ctrl+C)
- Open a Markdown file in VSCode
- Position cursor where you want to paste
- Right-click and select "MD2Wiki: Paste from Confluence" or use Command Palette
- Confluence content is automatically converted to Markdown
Supported Confluence Elements:
- Headings and formatted text (bold, italic, code)
- Tables (automatically converted to Markdown tables)
- Mermaid diagrams (preserved as code blocks)
- Lists and links
- Unknown macros (with customizable handling)
Insert Table of Contents
- Open a Markdown file in VSCode
- Right-click in the editor
- Select "MD2Wiki: Insert Table of Contents"
- TOC macro is copied to clipboard
- Paste into Confluence
Supported Elements
Markdown → Confluence
- Headings (H1-H6)
- Bold and italic text
- Code blocks (with syntax highlighting)
- Mermaid diagrams
- Lists (ordered and unordered)
- Links
- Blockquotes
- Horizontal rules
- And more via GFM (GitHub Flavored Markdown)
Confluence → Markdown
- Headings and formatted text
- Tables (including nested formatting in cells)
- Code blocks and inline code
- Mermaid diagrams (preserved)
- Lists and links
- Macros (with user-selectable handling for unknown macros)
Configuration
Access settings via Preferences > Settings > Extensions > MD2Wiki:
| Setting |
Default |
Description |
md2wiki.autoInsertTOC |
true |
Automatically insert Table of Contents at the beginning |
md2wiki.tocStyle |
"none" |
TOC list style: none, disc, circle, or square |
md2wiki.mermaidAsCodeBlock |
true |
Keep Mermaid as code blocks (recommended, Confluence handles automatically) |
md2wiki.notifyOnSuccess |
true |
Show notification when content is copied |
Commands
All commands are available via:
- Right-click menu (when editing a Markdown file)
- Command Palette (
Cmd+Shift+P / Ctrl+Shift+P)
| Command |
Description |
When Available |
MD2Wiki: Convert to Confluence Format |
Convert current file |
Markdown files |
MD2Wiki: Convert Selection to Confluence Format |
Convert selected text only |
Markdown files with selection |
MD2Wiki: Paste from Confluence |
Paste and convert Confluence content to Markdown |
Markdown files |
MD2Wiki: Insert Table of Contents |
Insert TOC macro |
Markdown files |
Examples
Example 1: Markdown → Confluence
Before (Markdown)
```markdown
My Document
Overview
This is a sample document with some formatting.
```javascript
console.log('Hello, World!');
```
```mermaid
graph TD
A[Start] --> B[End]
```
```
After (Confluence)
- Automatic Table of Contents at top
- Proper heading hierarchy
- Code block with JavaScript syntax highlighting
- Mermaid diagram rendered natively in Confluence
Example 2: Confluence → Markdown (Table Conversion)
Before (Confluence)
Copy a table from Confluence with formatted headers:
| Date |
Note |
| 2024.03.11 |
Add supporting collecting shared libraries dependencies into SBOM |
| 2024.03 |
Add SbomScannerSoDeps, The found in SBOM |
After (Paste from Confluence)
```markdown
| Date | Note |
| --- | --- |
| 2024.03.11 | Add supporting collecting shared libraries dependencies into SBOM |
| 2024.03 | Add SbomScannerSoDeps, The found in SBOM |
```
- Table structure is preserved
- Bold formatting in headers is maintained
- Ready to use in Markdown files
Requirements
- VSCode 1.80.0 or later
- Confluence account with editor access
Known Limitations
Markdown → Confluence
- Very large files (>10MB) may take a few seconds to convert
- Some advanced Markdown extensions may not be fully supported
Confluence → Markdown
- Table merged cells: Tables with
rowspan or colspan attributes will have all cells split independently. Merged cells are not preserved in the conversion.
- Tables larger than 100KB: Very large tables are skipped for security reasons (ReDoS protection)
- Nested tables: Nested tables are not fully supported
- Complex macros: Some advanced Confluence macros may not be recognized
Release Notes
0.2.1
- Bug Fix: Fixed backtick handling in inline code
- Backticks inside
<code> tags are now properly preserved in Markdown
- HTML entity encoded backticks (`) are correctly decoded
- Uses double backticks when content contains backticks
- Bug Fix: Improved whitespace cleanup
- Removed excessive blank lines in converted Markdown
- Better handling of HTML whitespace and line endings
- Cleaner output with consistent paragraph spacing
0.2.0
- Table Conversion: Full support for Confluence tables to Markdown
- Smart header detection (detects
<th> tags)
- Preserves formatting in cells (bold, italic, code, links)
- Handles special characters (escapes pipes, removes newlines)
- Security: ReDoS protection with 100KB size limit
- Enhanced Detection: Standalone table detection support
- Code Quality: Refactored shared formatting logic
- Improved Entity Decoding: Support for more HTML entities (em dash, copyright, etc.)
- Better Documentation: Added examples and known limitations
0.1.0
- Initial release
- Bidirectional conversion between Markdown and Confluence
- TOC and Diagram macro support
- Mermaid diagram support
- User-selectable handling for unknown Confluence macros
- Configurable options
Contributing
Found a bug or want a feature? Open an issue!
License
MIT
Enjoy converting your Markdown to Confluence! 🚀