Skip to content

feat: Enhanced Markdown Support with Bidirectional Conversion#5

Merged
pchuri merged 2 commits into
mainfrom
feature/enhanced-markdown-support
Jun 30, 2025
Merged

feat: Enhanced Markdown Support with Bidirectional Conversion#5
pchuri merged 2 commits into
mainfrom
feature/enhanced-markdown-support

Conversation

@pchuri
Copy link
Copy Markdown
Owner

@pchuri pchuri commented Jun 30, 2025

Summary

🚀 Major Feature: Enhanced Markdown Support with Bidirectional Conversion

This PR adds comprehensive markdown support to confluence-cli with:

  • 🔄 Bidirectional Conversion: markdown ↔ Confluence storage format
  • 📊 Native Storage Format: Converts to native Confluence elements (no HTML macros)
  • ✨ Confluence Extensions: Support for [\!info], [\!warning], [\!note] admonitions
  • 📋 Rich Elements: Tables, code blocks, lists, links with proper formatting
  • 🧪 Comprehensive Testing: 17 passing tests with full coverage

Key Features

📖 Read Pages in Markdown Format

confluence read <pageId> --format markdown

⚡ Enhanced Conversion Methods

  • markdownToStorage() - Convert markdown to Confluence storage format
  • storageToMarkdown() - Convert Confluence storage to markdown
  • htmlToMarkdown() - Convert HTML to clean markdown
  • setupConfluenceMarkdownExtensions() - Custom markdown extensions

🎯 Confluence-Specific Extensions

[\!info]
This renders as a Confluence info macro

[\!warning]
This renders as a warning macro

```javascript
console.log("Code blocks with syntax highlighting");
Feature Status
Tables
Lists

## Changes Made

- **📄 CLI Enhancement**: Added `--format markdown` to `confluence read` command
- **🔧 Core Functionality**: Enhanced `ConfluenceClient` with bidirectional conversion
- **📚 Documentation**: Updated `CONTRIBUTING.md` with markdown examples
- **🧪 Testing**: Comprehensive test suite with 17 passing tests
- **⚙️ Advanced Features**: Custom markdown-it extensions for Confluence

## Test Results

✅ **All 17 tests passing**  
✅ **Real-world page conversion working perfectly**  
✅ **Complex tables converted to clean markdown**  
✅ **No HTML artifacts remaining**

## Before vs After

**Before**: HTML macro wrapping  
**After**: Native Confluence storage elements with clean markdown output

This enhancement makes confluence-cli much more powerful for markdown workflows\!

## Test plan

- [x] All existing tests pass
- [x] New markdown conversion tests pass  
- [x] Manual testing with real Confluence pages
- [x] Complex table conversion verified
- [x] Code block syntax highlighting preserved
- [x] Admonition extensions working
- [x] Bidirectional conversion maintains data integrity

pchuri added 2 commits June 30, 2025 16:47
- Add --format markdown option to confluence read command
- Update help text to include markdown format option
- Add markdown support documentation with examples
- Add native Confluence storage format conversion (no HTML macros)
- Implement bidirectional conversion: markdown ↔ Confluence storage format
- Support Confluence-specific extensions ([!info], [!warning], [!note])
- Convert complex HTML tables to clean markdown tables
- Preserve text formatting (bold, italic, code blocks)
- Add comprehensive test coverage (17 tests passing)
- Enable advanced markdown-it features (tables, strikethrough, linkify)

Enhanced features:
- storageToMarkdown() - Convert Confluence storage to markdown
- htmlToMarkdown() - Convert HTML to markdown
- setupConfluenceMarkdownExtensions() - Custom markdown extensions
- htmlToConfluenceStorage() - Enhanced HTML to storage conversion
@pchuri pchuri merged commit d17771b into main Jun 30, 2025
5 checks passed
@pchuri pchuri deleted the feature/enhanced-markdown-support branch June 30, 2025 08:04
github-actions Bot pushed a commit that referenced this pull request Jun 30, 2025
# [1.4.0](v1.3.2...v1.4.0) (2025-06-30)

### Features

* Enhanced Markdown Support with Bidirectional Conversion ([#5](#5)) ([d17771b](d17771b))
@github-actions
Copy link
Copy Markdown

🎉 This PR is included in version 1.4.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

bestend pushed a commit to bestend/confluence-cli that referenced this pull request Feb 9, 2026
* feat: add markdown format option to read command

- Add --format markdown option to confluence read command
- Update help text to include markdown format option
- Add markdown support documentation with examples

* feat: implement enhanced markdown support with bidirectional conversion

- Add native Confluence storage format conversion (no HTML macros)
- Implement bidirectional conversion: markdown ↔ Confluence storage format
- Support Confluence-specific extensions ([!info], [!warning], [!note])
- Convert complex HTML tables to clean markdown tables
- Preserve text formatting (bold, italic, code blocks)
- Add comprehensive test coverage (17 tests passing)
- Enable advanced markdown-it features (tables, strikethrough, linkify)

Enhanced features:
- storageToMarkdown() - Convert Confluence storage to markdown
- htmlToMarkdown() - Convert HTML to markdown
- setupConfluenceMarkdownExtensions() - Custom markdown extensions
- htmlToConfluenceStorage() - Enhanced HTML to storage conversion
bestend pushed a commit to bestend/confluence-cli that referenced this pull request Feb 9, 2026
# [1.4.0](pchuri/confluence-cli@v1.3.2...v1.4.0) (2025-06-30)

### Features

* Enhanced Markdown Support with Bidirectional Conversion ([pchuri#5](pchuri#5)) ([78b6cf4](pchuri@78b6cf4))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant