Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
virtualritz opened this issue Nov 15, 2024 · 1 comment
Labels
A-rustdoc-ui Area: Rustdoc UI (generated HTML) C-bug Category: This is a bug. E-needs-investigation Call for partcipation: This issues needs some investigation to determine current status T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.

Comments

@virtualritz
Copy link

virtualritz commented Nov 15, 2024

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]
@virtualritz virtualritz added the C-bug Category: This is a bug. label Nov 15, 2024
@epage epage transferred this issue from rust-lang/cargo Nov 15, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Nov 15, 2024
@epage epage added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Nov 15, 2024
@jieyouxu jieyouxu added the T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. label Nov 15, 2024
@fmease fmease changed the title cargo-doc: single comma is put on newline if it occurs after item in double ticks rustdoc: single comma is put on newline if it occurs after item in double ticks Nov 15, 2024
@jieyouxu jieyouxu added the A-rustdoc-ui Area: Rustdoc UI (generated HTML) label Nov 16, 2024
@Shunpoco
Copy link
Contributor

I investigated it and found that it is caused by display: inline-block which added to .docblock p code (It was introduced in #132183). If you turn off the style in the code tag on your web browser, single comma will not be shown.

So we should remove the style, but I'm not sure why we had the error described in #132183, how the style solved the error, and what is the alternative solution.

@lolbinarycat lolbinarycat added the E-needs-investigation Call for partcipation: This issues needs some investigation to determine current status label Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rustdoc-ui Area: Rustdoc UI (generated HTML) C-bug Category: This is a bug. E-needs-investigation Call for partcipation: This issues needs some investigation to determine current status T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.
Projects
None yet
Development

No branches or pull requests

6 participants