MarkdownSharp icon indicating copy to clipboard operation
MarkdownSharp copied to clipboard

Set default value " />" for MarkdownOptions.EmptyElementSuffix.

Open kobake opened this issue 5 years ago • 1 comments

Problem

I met the problem like #9 when I wrote the code as follows.

var markdown = new Markdown(new MarkdownOptions { AutoNewlines = true });
var html = markdown.Transform("AB\nCD"); // Result: "<p>AB<br\nCD</p>" (Unexpected)

"\n" was converted to "<br\n". It's not expected for me and everyone, I think.

We can fix this code like var markdown = new Markdown(new MarkdownOptions { AutoNewlines = true, EmptyElementSuffix = " />" });, but it's more useful if the default value of MarkdownOptions .EmptyElementSuffix was set.

Solution

This PR sets default value " />" for MarkdownOptions.EmptyElementSuffix. It's the same default value as Markdown.EmptyElementSuffix.

kobake avatar Jun 16 '20 08:06 kobake

https://ci.appveyor.com/project/StackExchange/markdownsharp/builds/33547200/job/dcqr2n2ujsxdmd4s

An error seemed to occur in AppVayor Ubuntu phase. Can we ignore that?

kobake avatar Jun 16 '20 09:06 kobake