Markdown inline-code collapses spaces
Summary
There's a big difference between grep '^ ' and grep '^ ' (and you currently don't see it when rendered by gitlab).
Steps to reproduce
-
Put multiple adjacent spaces in an inline code block (
`foo`) in- a Markdown file
- an issue description / comment / …
- or any other place that renders Markdown
-
View rendered HTML.
Example Project
This issue's summary exhibits the same bug. (I think that's enough?)
What is the current bug behavior?
Multiple spaces collapse to a single space.
When inspecting the DOM in Firefox, the extra spaces are already gone. Manually editing the DOM node's text content to add more spaces updates the displayed HTML to show as many spaces as you added. This leads me to suspect that this isn't caused by lack of escaping in the Markdown output (which shouldn't be necessary in <code> nodes anyway), but instead by some phase of the conversion deliberately removing the spaces in error.
What is the expected correct behavior?
In `code` blocks, any number of inner spaces should be preserved as-is. (Outer spaces needed to separate `` `multi-backtick` ``-fences from the content should still go away.)
Checklist:
-
a blooks likea bNOTa b -
make `uname`(still) looks likemake `uname`NOTmake `uname`
Output of checks
This bug happens on GitLab.com
Possible fixes
(no idea / did not dig into the code)
Workaround
Use <code>…</code> instead of `…` where necessary.
(And remember to escape backticks and anything else that needs escaping – <code>make \`uname\`</code> etc.)