Skip to content

Markdown: Preserve non-breaking spaces in inline code #6402

@leafac

Description

@leafac

Since #3320 non-breaking spaces are preserved in Markdown prose, but they still aren’t preserved in inline code, which would have been useful to avoid line breaks in things like x = 2.

In the listings below represents a regular space, and represents a non-breaking space.

Prettier 1.18.2
Playground link

--parser markdown

Input:

normal␣space

non-breaking•space

`normal␣space`

`non-breaking•space`

Output:

normal␣space

non-breaking•space

`normal␣space`

`non-breaking␣space`

Expected behavior:

normal␣space

non-breaking•space

`normal␣space`

`non-breaking•space`

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions