mdBook icon indicating copy to clipboard operation
mdBook copied to clipboard

Multiple spaces in inline code are getting converted to single space

Open learnbyexample opened this issue 2 years ago • 1 comments

It would be nice if spaces are preserved as is in inline code. For example, the line below in GitHub

Spacing in inline code `printf 'apple    banana\n'`

will be rendered as shown below:

image

Here's a sample test case with mdBook:

$ mdbook --version
mdbook v0.4.25

$ mdbook init test-book
$ cd test-book/

$ cat src/chapter_1.md
# Chapter 1

Spacing in inline code `printf 'apple    banana\n'`

$ mdbook serve

The above test produces this for me:

image

learnbyexample avatar Dec 23 '22 07:12 learnbyexample

Note: This is accomplished with white-space: break-spaces;

ehuss avatar Dec 29 '22 03:12 ehuss