Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/MarkdownSharp/Markdown.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public class MarkdownOptions
/// <summary>
/// use ">" for HTML output, or " />" for XHTML output
/// </summary>
public string EmptyElementSuffix { get; set; }
public string EmptyElementSuffix { get; set; } = " />";

/// <summary>
/// when false, email addresses will never be auto-linked
Expand Down
13 changes: 13 additions & 0 deletions tests/MarkdownSharp.Tests/ConfigTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,19 @@ public void TestAutoNewLines()
Assert.Equal("<p>Line1<br />\nLine2</p>\n", markdown.Transform("Line1\nLine2"));
}

[Fact]
public void TestDefaultOptions()
{
var markdownWithoutOptions = new Markdown();
Assert.Equal(" />", markdownWithoutOptions.EmptyElementSuffix);

var markdownWithOptions = new Markdown(new MarkdownOptions { });
Assert.Equal(" />", markdownWithOptions.EmptyElementSuffix);

var options = new MarkdownOptions { };
Assert.Equal(" />", options.EmptyElementSuffix);
}

[Fact]
public void TestEmptyElementSuffix()
{
Expand Down