A content fragment
Input
<h2>Title</h2><p>Some <strong>bold</strong> text.</p><ul><li>one</li><li>two</li></ul>Output
## Title
Some **bold** text.
- one
- twoSemantic elements map to Markdown; the list becomes hyphen bullets.
Converting HTML to Markdown is lossy by nature, because HTML can express far more than Markdown can. The goal is not a perfect representation but readable Markdown that keeps the content and its meaningful structure.
This is what you want for turning a web page into documentation, cleaning up content pasted out of a rich text editor, or getting rendered HTML back into a source format you can edit by hand.
Each example below is executed against this tool by the test suite, so what you see is what the tool actually produces.
Input
<h2>Title</h2><p>Some <strong>bold</strong> text.</p><ul><li>one</li><li>two</li></ul>Output
## Title
Some **bold** text.
- one
- twoSemantic elements map to Markdown; the list becomes hyphen bullets.
The details that decide whether a conversion is correct, and where information can be lost without any error being raised.