mirror of
https://github.com/xoofx/markdig.git
synced 2026-02-04 05:44:50 +00:00
ToPlainText() removes essential characters from code blocks including quotes and angle brackets
#725
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @luomo-pro on GitHub (Feb 28, 2025).
Description
I've discovered that when using
Markdown.ToPlainText(info)to convert markdown to plain text, it not only removes markdown syntax (as expected) but also removes certain characters inside code blocks that should be preserved.Problem
When converting markdown to plain text, essential characters in code blocks such as double quotes (
"), greater than (>), and less than (<) symbols are being removed from the output.Example
Original markdown:
Expected output after ToPlainText():
Actual output after ToPlainText():
As you can see, the double quotes have been stripped from the code, which significantly changes the meaning of the code and makes it invalid.