The discussion addresses a bug in Discourse’s markdown parser where whitespace between adjacent inline code fragments is unexpectedly removed, particularly when followed by non-code text. DeanMarkTaylor reports the issue with specific examples showing incorrect rendering, while MT_ provides reproducible test cases and notes the bug is specific to Discourse’s implementation, as it does not occur in markdown-it. sam confirms the issue and mentions the team plans to migrate to the new markdown-it engine, which resolves the problem. MT_ asks about the migration timeline, and dandv clarifies that the switch hasn’t happened yet, citing a related issue with backticks. sam adds that the original post was rebaked after a change in CommonMark handling, where ### Notes now requires a space after # to be recognized as a heading.
The following markdown seems to remove white space between letters on the 2nd line
Markdown Code
`leosomethingelse` - `leo address 1` - created `1 year ` - mem `period 11` & `period 12` - seen `6 hours ago`
`leo` x `leo address 2` - created `>10 years` - mem `period 05 to period 08` - seen `never on this planet`
Actual Result
Expected Result
As it displays on here right now
leosomethingelse - leo address 1 - created 1 year - mem period 11 & period 12 - seen 6 hours ago leo x leo address 2 - created >10 years - mem period 05 to period 08 - seen never on this planet
Notes
Introducing a new line between the two lines displays this result, noting the white space between characters on the 2nd line is correct:
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:
foobar (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.