rust-lang / rust-lang/rust

rustdoc: single comma is put on newline if it occurs after item in double ticks

Open
#133,075 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-rustdoc-ui C-bug E-needs-investigation T-rustdoc T-rustdoc-frontend
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

Problem

Here is a part of the documentation in my fork of the colstodian crate's lib.rs:

//! If you also have alpha (i.e. four values instead of three), then
//! [`Color::srgba_u8`], [`Color::srgba_f32`], and [`Color::linear_srgba`]
//! are the equivalents of the above with an alpha component.

And here is how that gets rendered/formatted in the docs:

Image

Note the lonely comma on the 2nd line, this should be connected/stay with the Color::srgba_f32 item at the end of the previous line.

I presume this is a CSS issue rather.

Version
cargo 1.84.0-nightly (4a2d8dc63 2024-11-09)
release: 1.84.0-nightly
commit-hash: 4a2d8dc636445b276288543882e076f254b3ae95
commit-date: 2024-11-09
host: x86_64-unknown-linux-gnu
libgit2: 1.8.1 (sys:0.19.0 vendored)
libcurl: 8.9.0-DEV (sys:0.4.74+curl-8.9.0 vendored ssl:OpenSSL/1.1.1w)
ssl: OpenSSL 1.1.1w  11 Sep 2023
os: Ubuntu 24.10.0 (oracular) [64-bit]

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the rendering from the example in lib.rs using rustdoc, then inspect the generated HTML and relevant rustdoc CSS to find why the comma wraps separately. Done means the comma stays with the preceding linked item without disrupting other documentation formatting.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
documentation
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.