-
-
Notifications
You must be signed in to change notification settings - Fork 74
Closed
Labels
Description
Description
Inline markup (emphasis and strong emphasis) surrounded by leading or trailing white spaces results in incorrectly flanked markdown, causing it not to render as expected.
See https://spec.commonmark.org/0.31.2/#example-351 for further details.
Steps to reproduce
Use HTML that contains leading or trailing white spaces within inline markup like <em>
, <strong>
, <b>
, <i>
or similar.
Here is an example:
var html = """
This <em>results</em> in <strong>invalid </strong> markdown.
""";
Console.WriteLine(new ReverseMarkdown.Converter(new ReverseMarkdown.Config()).Convert(html));
This results in:
This *results* in **invalid ** markdown.
Since the second **
is not flanked correctly, it doesn't render as expected (according to input HTML):
This results in **invalid ** markdown.