Odd markdown results - unexpected whitespace removal

Below are some specific information on how to reproduce the bug and simplified testcases (planned to post this as a bug report, but noticed there is an existing similar thread, so commenting instead):

Bug: whitespace disappears after two adjacent inline code fragments

There is no visible whitespace (though there is in source markdown) after two adjacent code fragments if:

  • the fragments are separated with whitespace or with a single nonwhitespace character not surrounded with whitespace;
  • and there is another inline code fragment after noncode text placed after the first two code fragments.

Testcases:

foo bar (not code) code.

foo/bar (not code) code.


For nonwhitespace separator, a workaround is to add a space before and/or after the separator:

foo / bar (not code) code.

I am not aware of a workaround for fragments separated with just whitespace.


This looks like a specific bug of the Discourse flavor of Markdown since, for example, GitHub’s markdown parser is not affected.