By default, Markdig uses LF for line endings, even on Windows. If I check out a git repository for a Statiq-generated website on Windows and git converts the line endings to CRLF, the next time I invoke Statiq to regenerate the site every Markdown -> HTML process will result in LF line endings for all the files. So even though I may have edited only 1 Markdown file, every HTML document in the output shows as "modified". This isn't tragic; git will automatically fix up the line endings for me. But it does result in a lot of noise in git status.
Markdig supplies an extension to modify this behavior. In theory, I can add UseExtension(new ConfigureNewLineExtension("\r\n")) to my pipeline and when I generate the site on Windows, the line endings will match.
Unfortunately, the EscapteAtExtension, which is always last in the extension setup process, inadvertently resets any configured .NewLine property when it sets the TextWriter for the HtmlRenderer, and the output always ends up using LF.
By default, Markdig uses
LFfor line endings, even on Windows. If I check out a git repository for a Statiq-generated website on Windows and git converts the line endings toCRLF, the next time I invoke Statiq to regenerate the site every Markdown -> HTML process will result inLFline endings for all the files. So even though I may have edited only 1 Markdown file, every HTML document in the output shows as "modified". This isn't tragic; git will automatically fix up the line endings for me. But it does result in a lot of noise ingit status.Markdig supplies an extension to modify this behavior. In theory, I can add
UseExtension(new ConfigureNewLineExtension("\r\n"))to my pipeline and when I generate the site on Windows, the line endings will match.Unfortunately, the
EscapteAtExtension, which is always last in the extension setup process, inadvertently resets any configured.NewLineproperty when it sets theTextWriterfor theHtmlRenderer, and the output always ends up usingLF.