Closed jonatanschroeder closed 2 months ago
@jonatanschroeder - Markdown does not support formatting inside code spans or code blocks; characters inside these elements (thus including styling elements) are displayed literally.
Indeed, so if the intention is to create markdown that can be converted back to equivalent HTML this loses information, as converting it back will not include that formatting. If that is not the intention then I may have misunderstood the purpose of the library.
The purpose is to convert HTML to Markdown, but that is an inherently lossy process as Markdown cannot represent everything that HTML can.
There is a "backdoor" in Markdown for such cases where you can intermix HTML and Markdown syntax in a Markdown document, but most of us converting HTML to Markdown are trying to get away from HTML entirely (for simplified text processing, etc.).
Noted. I will close the issue then.
@jonatanschroeder - for what it's worth, we also wish Markdown supported formatting inside code spans and blocks. Our HTML makes heavy use of emphasizing things inside <pre>
blocks. When we convert it to Markdown for LLM use, the emphasis is lost.
Consider the following construct:
This is valid HTML, and will cause "bold" to be formatted in bold. markdownify causes the
strong
tag to be lost, though: