Skip to content

[bug] Inline code block starting with space is trimmed #65555

Closed
@jhpratt

Description

@jhpratt

In some documentation that I recently wrote, I had an inline code block that has a leading space.

` 5`

This is rendered as <code>5</code> — notice the lack of a leading space.

Given that the documentation in question is literally to show how a leading space is added, and given that code blocks otherwise display content as-is, this seems like a bug to me.

Reference for full source code in case this behavior isn't consistent: https://github.com/time-rs/time/blob/7dc4cf32c48d4e5113661423b4869b5015decb64/src/lib.rs#L80-L84

Metadata

Metadata

Labels

C-bugCategory: This is a bug.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions