Skip to content

Conversation

@AezanPathan
Copy link

@AezanPathan AezanPathan commented Sep 28, 2025

Purpose

  • Adds a new tool class HtmlToMarkdownTool to convert HTML back to Markdown.
    This allows users to perform two-way conversion between Markdown and HTML using separate tools (MarkdownToHtmlTool and HtmlToMarkdownTool).

Does this introduce a breaking change?

[ ] Yes
[x] No

Pull Request Type

What kind of change does this Pull Request introduce?

[ ] Bugfix
[x] New feature to existing sample
[ ] New sample
[ ] Refactoring (no functional changes, no api changes)
[ ] Documentation content changes
[ ] Other... Please describe:

README updated?

The top-level readme for this repo contains a link to each sample in the repo. If you're adding a new sample did you update the readme?

[ ] Yes
[x] No
[ ] N/A

How to Test

  • Get the code
git clone https://github.com/AezanPathan/mcp-dotnet-samples.git
cd mcp-dotnet-samples
git checkout feature/reverse-markdown

  • Test the code
Use the HtmlToMarkdownTool.ConvertAsync method to convert an HTML string back to Markdown.

Verify that HTML input is correctly converted to Markdown output.

Existing ConvertAsync method for Markdown → HTML should continue to work without changes.

What to Check

Verify that the following are valid

  • HTML content is properly converted back to Markdown using HtmlToMarkdownTool.

  • Existing Markdown → HTML conversion still works.

  • No errors or exceptions occur when using either conversion method.

Other Information

  • Uses the ReverseMarkdown NuGet package for HTML → Markdown conversion.

  • Tested locally and works alongside the existing Markdown → HTML pipeline.

@AezanPathan
Copy link
Author

@microsoft-github-policy-service agree

Copy link
Contributor

@justinyoo justinyoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AezanPathan Thanks for this PR! However, I'd like you to add another tool class like HtmlToMarkdownTool.cs and put your logic there. Would you please take a look please?

@AezanPathan
Copy link
Author

Hi @justinyoo, I’ve updated the PR — moved the logic into the new HtmlToMarkdownTool class as suggested and adjusted the PR description accordingly. Please review when you get a chance. Thanks for the guidance!

@AezanPathan AezanPathan requested a review from justinyoo October 6, 2025 06:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants