Skip to content

rustdoc styling issue: .docblock occasionally has problematic right padding #86184

Closed
@davidbarsky

Description

@davidbarsky

In tracing, we use warnings blocks to surface potential gotchas to users (this is arguably a misuse of blocks in rustdoc, but anyways...). Unforuntately, I noticed that blocks add 1ex of right padding to anything rendered as code, including inline comments. Here's an example: https://deploy-preview-1430--tracing-rs.netlify.app/tracing/struct.span#method.entered. A screenshot is below for posterity.

Screen Shot 2021-06-09 at 7 34 08 PM

The extra right padding results in a poor reading experience while reading some of tracing's documentation. While I recognize that we're misusing docblocks to render tooltips and #83550 attempted to solve this problem in more well-trodden use-cases, I was hoping that this rendering issue could either be fixed or we can be given a decently stable workaround. Thanks!

Meta

rustc --version --verbose:

❯ rustc --version --verbose
rustc 1.54.0-nightly (e4a603270 2021-06-07)
binary: rustc
commit-hash: e4a60327063e82413eed50a10df3b7d19b77bda0
commit-date: 2021-06-07
host: x86_64-apple-darwin
release: 1.54.0-nightly
LLVM version: 12.0.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-rustdoc-uiArea: Rustdoc UI (generated HTML)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