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
283 stars 67 forks source link

Inline Code should not be encoded #33

Closed RickStrahl closed 5 years ago

RickStrahl commented 5 years ago

If inline code blocks in single ticks contain special HTML characters the inline code is not HTML decoded properly.

[Fact]
public void When_InlineCode_Shouldnt_Contain_Encoded_Chars()
{
    var html = @"This is inline code: <code>&lt;AspNetCoreHostingModel&gt;</code>.";
    var expected = @"This is inline code: `<AspNetCoreHostingModel>`.";

    var converter = new Converter();
    var result = converter.Convert(html);
    Assert.Equal(expected, result, StringComparer.OrdinalIgnoreCase);
}
This is inline code: <code>&lt;AspNetCoreHostingModel&gt;</code>.

renders as:

This is inline code: `&lt;AspNetCoreHostingModel&gt;`.";

but should render as:

This is inline code: `<AspNetCoreHostingModel>`.";
mysticmind commented 5 years ago

Closed via #34

mysticmind commented 5 years ago

Available in v3.4.0