Links not working in 0.26 targeting .NetFramework 4.7 #484

Closed
opened 2026-01-29 14:37:52 +00:00 by claunia · 3 comments
Owner

Originally created by @raulcristiann on GitHub (Oct 25, 2021).

Looks like in version 0.23 everything works fine but starting with 0.24 links are not working anymore.
Try this code:

using System;
using Markdig;

public class Program
{
    public static void Main()
    {
        var pipeline = new MarkdownPipelineBuilder()
               .UseAdvancedExtensions()
               .Build();

        var notWorking = @"
text ==Marked text== text.

this is ![](https://pbs.twimg.com/profile_images/234/kt0hiSmv_400x400.jpg) image

> Dorothy followed her through many of the beautiful rooms in her castle.

Content with **bold** more content

Content with  ***italic bold***  more content

this [link1] sparta

[link1]: /url ""title1""

    internal class Sparta
        {
            public void Say()
            {
                Console.WriteLine(""This is Sparta"");
            }
        }

<div>
<span style = ""font-weight:bold;"" >
this is
a test
this should be
visible
</span>

</div>

<div> <span> asdasdasd asdads</span> </div>
";


        var working = @"

this [link1] sparta

[link1]: \url ""title1""";
        var workingResult = Markdown.ToHtml(working, pipeline);
        var notWorkingResult = Markdown.ToHtml(notWorking, pipeline);

        Console.WriteLine(notWorkingResult);
        Console.WriteLine(workingResult); //Check links
    }
}
Originally created by @raulcristiann on GitHub (Oct 25, 2021). Looks like in version 0.23 everything works fine but starting with 0.24 links are not working anymore. Try this code: ``` using System; using Markdig; public class Program { public static void Main() { var pipeline = new MarkdownPipelineBuilder() .UseAdvancedExtensions() .Build(); var notWorking = @" text ==Marked text== text. this is ![](https://pbs.twimg.com/profile_images/234/kt0hiSmv_400x400.jpg) image > Dorothy followed her through many of the beautiful rooms in her castle. Content with **bold** more content Content with ***italic bold*** more content this [link1] sparta [link1]: /url ""title1"" internal class Sparta { public void Say() { Console.WriteLine(""This is Sparta""); } } <div> <span style = ""font-weight:bold;"" > this is a test this should be visible </span> </div> <div> <span> asdasdasd asdads</span> </div> "; var working = @" this [link1] sparta [link1]: \url ""title1"""; var workingResult = Markdown.ToHtml(working, pipeline); var notWorkingResult = Markdown.ToHtml(notWorking, pipeline); Console.WriteLine(notWorkingResult); Console.WriteLine(workingResult); //Check links } } ```
claunia added the bug label 2026-01-29 14:37:52 +00:00
Author
Owner

@raulcristiann commented on GitHub (Nov 8, 2021):

Any updates on this?

@raulcristiann commented on GitHub (Nov 8, 2021): Any updates on this?
Author
Owner

@MihaZupan commented on GitHub (Dec 3, 2021):

Looks like it happens when a LinkReferenceDefinition containing a title is followed by a new line.

string markdown = @"
[foo]

[foo]: /url ""bar""
";

vs

string markdown = @"
[foo]

[foo]: /url ""bar""";

cc: @generateui

@MihaZupan commented on GitHub (Dec 3, 2021): Looks like it happens when a `LinkReferenceDefinition` containing a title is followed by a new line. ```c# string markdown = @" [foo] [foo]: /url ""bar"" "; ``` vs ```c# string markdown = @" [foo] [foo]: /url ""bar"""; ``` cc: @generateui
Author
Owner

@xoofx commented on GitHub (Mar 31, 2022):

It looks like it is fixed in 0.28.1

@xoofx commented on GitHub (Mar 31, 2022): It looks like it is fixed in 0.28.1
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/markdig#484