Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

_emptyElementSuffix null when passing empty MarkdownOptions #41

Closed
GoogleCodeExporter opened this issue Jan 27, 2016 · 2 comments
Closed

Comments

@GoogleCodeExporter
Copy link

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

@GoogleCodeExporter
Copy link
Author

Whoops, this is actually a dupe of Issue 38: 
http://code.google.com/p/markdownsharp/issues/detail?id=38

Original comment by fri...@gmail.com on 27 Jan 2011 at 4:33

@GoogleCodeExporter
Copy link
Author

Original comment by wump...@gmail.com on 28 Feb 2011 at 5:03

  • Changed state: Duplicate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant