Same content with different line endings produce different HTML #441

Open
opened 2026-01-29 14:36:54 +00:00 by claunia · 0 comments
Owner

Originally created by @yufeih on GitHub (Mar 23, 2021).

Starting from 0.24.0, line ending (\r\n or \n) affects output in certain cases:

Console.WriteLine(Markdown.ToHtml("a\\\nb"));      // <p>a<br />b</p>
Console.WriteLine(Markdown.ToHtml("a\\\r\nb"));    // <p>a\b</p>
Console.WriteLine(Markdown.ToHtml("a  \nb"));      // <p>a</br />b</p>
Console.WriteLine(Markdown.ToHtml("a  \r\nb"));    // <p>a  </br />b</p>

Related: https://github.com/dotnet/docfx/pull/7219 https://github.com/dotnet/docfx/pull/7424

Originally created by @yufeih on GitHub (Mar 23, 2021). Starting from 0.24.0, line ending (`\r\n` or `\n`) affects output in certain cases: ```csharp Console.WriteLine(Markdown.ToHtml("a\\\nb")); // <p>a<br />b</p> Console.WriteLine(Markdown.ToHtml("a\\\r\nb")); // <p>a\b</p> ``` ```csharp Console.WriteLine(Markdown.ToHtml("a \nb")); // <p>a</br />b</p> Console.WriteLine(Markdown.ToHtml("a \r\nb")); // <p>a </br />b</p> ``` Related: https://github.com/dotnet/docfx/pull/7219 https://github.com/dotnet/docfx/pull/7424
claunia added the bug label 2026-01-29 14:36:54 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/markdig#441