statiqdev / Statiq.Framework

A flexible and extensible static content generation framework for .NET.
https://statiq.dev/framework
MIT License
426 stars 74 forks source link

Unexpected issue with input files with EOL CRLF #267

Closed EntityAdam closed 1 year ago

EntityAdam commented 1 year ago

Windows, amirite?

I have a rather persnickety issue with the following markdown content in my input files:

This works fine

![alt text][fastcar2]

[fastcar2]: img/car.jfif "VROOM"

This does not work

![alt text][fastcar2]

[fastcar2]: img/car.jfif "VROOM"

any arbitrary text

Screenshots

image

Now, if I switch the individual file to LF end of line (EOL), no problem. Weird huh?

Would love to see this fixed, because of course getting Git for Windows to play nice with LF for a single repository on my developer box is a pain.

daveaglick commented 1 year ago

I can reproduce this behavior locally, which hopefully means it won't take too long to figure out.

daveaglick commented 1 year ago

This looks like an upstream bug with Markdig. I've tested the version Statiq references (0.26.0) side-by-side with the latest version (0.31.0) in LINQPad. I can replicate the buggy behavior with the older version, but not the newer one.

Can you try directly referencing Markdig 0.31.0 in your project and let me know if that resolves the issue? If so, I'll look at doing a new Statiq release with an updated reference (along with some additional unit tests for this case).

Thanks!

EntityAdam commented 1 year ago

Confirmed. Referencing Markdig 0.31.0 resolved the issue.

Thank you!

daveaglick commented 1 year ago

Thanks for confirming - I was also able to reproduce the error in a unit test and observe it passing with a Markdig update. I've updated Markdig to 0.31.0 in Statiq and that will go out with the next version (likely sometime this week).

Thanks!