You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What steps will reproduce the problem?
1. Call public Markdown(MarkdownOptions options)
2. Transform text that generates empty html element (eg. <br />)
3. Inspect invalid html
What is the expected output? What do you see instead?
Expect html with '<br />', seeing '<br'
Please provide any additional information below.
This unit-test demonstrated the problem:
[Test]
public void BreaklinesWithEmptyOptions()
{
string input = "Bla bla: \r\nFoo";
string expected = "Bla bla:<br />\nAppHarbor Inc.";
var markdownSharp = new Markdown(
new MarkdownOptions{}
);
string actual = markdownSharp.Transform(input);
Assert.AreEqual(expected, actual);
}
It's due to bad option handling. Supposedly, emptyelementsuffix id initialized
to a sane default in this line:
private string _emptyElementSuffix = " />";
But that gets overriden with 'null' if one foolishly passes an options-object
without setting 'EmptyElementSuffix'
Original issue reported on code.google.com by fri...@gmail.com on 27 Jan 2011 at 1:29
Original issue reported on code.google.com by
fri...@gmail.com
on 27 Jan 2011 at 1:29The text was updated successfully, but these errors were encountered: