Skip to content

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

Open
kobake wants to merge 1 commit intoStackExchange:masterfrom
kobake:EmptyElementSuffix-DefaultValue
Open

Set default value " />" for MarkdownOptions.EmptyElementSuffix.#12
kobake wants to merge 1 commit intoStackExchange:masterfrom
kobake:EmptyElementSuffix-DefaultValue

Conversation

@kobake
Copy link

@kobake kobake commented Jun 16, 2020

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.

This " />" is the same value as Markdown.EmptyElementSuffix.
@kobake
Copy link
Author

kobake commented Jun 16, 2020

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

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

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant