mysticmind / reversemarkdown-net

ReverseMarkdown.Net is a Html to Markdown converter library in C#. Conversion is very reliable since HtmlAgilityPack (HAP) library is used for traversing the Html DOM
MIT License
270 stars 62 forks source link

Strange escape issue links #355

Closed jerriep closed 8 months ago

jerriep commented 1 year ago

I have the following code:

using System;

public class Program
{
    public static void Main()
    {
        var converter = new ReverseMarkdown.Converter();

        string html = "This a sample <strong>paragraph</strong> from <a href=\"https://www.w3schools.com/html/mov_bbb.mp4\">https://www.w3schools.com/html/mov_bbb.mp4</a>";

        string result = converter.Convert(html);

        Console.WriteLine(result);
    }
}

I expect the output to be as follows:

This a sample **paragraph** from [https://www.w3schools.com/html/mov_bbb.mp4](https://www.w3schools.com/html/mov_bbb.mp4)

Instead it is

This a sample **paragraph** from [https://www.w3schools.com/html/mov\_bbb.mp4](https://www.w3schools.com/html/mov_bbb.mp4)

Not that the URL has a backslash added in front of the _. It seems that there is some escaping going on which is not correct. Any idea why this is happening?

mysticmind commented 11 months ago

Hey @jerriep, sorry, I am just catching up on the issues list, will check and revert to you sooner on this.

mysticmind commented 11 months ago

In hindsight, it is mostly a bug.

mysticmind commented 8 months ago

https://github.com/mysticmind/reversemarkdown-net/releases/tag/4.1.0