Skip to content

Make docblock <code> elements inline so they behave better - #163623

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
GuillaumeGomez:code-inline
Nov 1, 2026
Merged

rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
GuillaumeGomez:code-inline

Conversation

@GuillaumeGomez

@GuillaumeGomez GuillaumeGomez commented Oct 1, 2026 •

Copy link
Copy Markdown
Member

Fixes #133075.

Whole problem description is in #133075 with nice screenshots so not going to duplicate its content here (although I'll add review comments on my PR to help the review 😉 ).

r? @lolbinarycat

@rustbot

rustbot commented Oct 1, 2026

Copy link
Copy Markdown
Collaborator

Some changes occurred in HTML/CSS/JS.

cc @lolbinarycat

@rustbot rustbot added A-rustdoc-js Area: Rustdoc's JS front-end S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Oct 1, 2026
@rustbot rustbot added the T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. label Oct 1, 2026
@@ -499,6 +499,9 @@ code, pre, .code-header, .type-signature {
border-radius: 3px;
padding: 0 0.125em;
}
.docblock code {
padding: 2px 0.125em;

@GuillaumeGomez GuillaumeGomez Oct 1, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Difference between inline-block and inline is that the box-sizing: border-box; isn't taken into account anymore, so we lose ~4px in height (a GUI test failed because of that, yeay person who wrote it!). So to compensate, I added the 2px padding on top and bottom.

View changes since the review

@@ -0,0 +1,93 @@
// This test ensures that `<code>` in docblocks are `display: inline` so comma are

@GuillaumeGomez GuillaumeGomez Oct 1, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hopefully the comments in this file makes sense as I tried to explain how I tested this behaviour.

View changes since the review

@GuillaumeGomez

Copy link
Copy Markdown
Member Author

r? @notriddle

@rustbot rustbot assigned notriddle and unassigned lolbinarycat Oct 23, 2026
@notriddle

Copy link
Copy Markdown
Contributor

@bors r+ rollup

@rust-bors

rust-bors Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

📌 Commit a041b11 has been approved by notriddle

It is now in the queue for this repository.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 1, 2026
rust-bors Bot pushed a commit that referenced this pull request Nov 1, 2026
Rollup of 10 pull requests

Successful merges:

 - #160186 (Implement `Fn` traits for safe functions of any ABI)
 - #160370 (rustdoc: notable trait badge and popover enhancements)
 - #165077 (Fix alloctests for panic=abort)
 - #163623 (Make docblock `<code>` elements inline so they behave better)
 - #163833 (Fix RISC-V inline ASM `clobber_abi` when extra target features are enabled)
 - #165067 (cg_llvm: Use an invariant lifetime brand for LLVM modules )
 - #165227 (Respect `--color=never` when printing `--explain` output to the terminal)
 - #165254 (Cleanup `rustdoc-html` tests)
 - #165258 (impl Eq for AllocRange)
 - #165259 (rustc-dev-guide subtree update)
@rust-bors
rust-bors Bot merged commit 1206de2 into rust-lang:main Nov 1, 2026
14 checks passed
@rustbot rustbot added this to the 1.101.0 milestone Nov 1, 2026
rust-bors Bot pushed a commit that referenced this pull request Nov 1, 2026
Rollup merge of #163623 - GuillaumeGomez:code-inline, r=notriddle

Make docblock `<code>` elements inline so they behave better

Fixes #133075.

Whole problem description is in #133075 with nice screenshots so not going to duplicate its content here (although I'll add review comments on my PR to help the review 😉 ).

r? @lolbinarycat
@GuillaumeGomez
GuillaumeGomez deleted the code-inline branch November 1, 2026 20:39
eduardorittner pushed a commit to eduardorittner/miri that referenced this pull request Nov 2, 2026
Rollup of 10 pull requests

Successful merges:

 - rust-lang/rust#160186 (Implement `Fn` traits for safe functions of any ABI)
 - rust-lang/rust#160370 (rustdoc: notable trait badge and popover enhancements)
 - rust-lang/rust#165077 (Fix alloctests for panic=abort)
 - rust-lang/rust#163623 (Make docblock `<code>` elements inline so they behave better)
 - rust-lang/rust#163833 (Fix RISC-V inline ASM `clobber_abi` when extra target features are enabled)
 - rust-lang/rust#165067 (cg_llvm: Use an invariant lifetime brand for LLVM modules )
 - rust-lang/rust#165227 (Respect `--color=never` when printing `--explain` output to the terminal)
 - rust-lang/rust#165254 (Cleanup `rustdoc-html` tests)
 - rust-lang/rust#165258 (impl Eq for AllocRange)
 - rust-lang/rust#165259 (rustc-dev-guide subtree update)
DaniPopes pushed a commit to DaniPopes/rustc_codegen_cranelift that referenced this pull request Nov 4, 2026
Rollup of 10 pull requests

Successful merges:

 - rust-lang/rust#160186 (Implement `Fn` traits for safe functions of any ABI)
 - rust-lang/rust#160370 (rustdoc: notable trait badge and popover enhancements)
 - rust-lang/rust#165077 (Fix alloctests for panic=abort)
 - rust-lang/rust#163623 (Make docblock `<code>` elements inline so they behave better)
 - rust-lang/rust#163833 (Fix RISC-V inline ASM `clobber_abi` when extra target features are enabled)
 - rust-lang/rust#165067 (cg_llvm: Use an invariant lifetime brand for LLVM modules )
 - rust-lang/rust#165227 (Respect `--color=never` when printing `--explain` output to the terminal)
 - rust-lang/rust#165254 (Cleanup `rustdoc-html` tests)
 - rust-lang/rust#165258 (impl Eq for AllocRange)
 - rust-lang/rust#165259 (rustc-dev-guide subtree update)
github-actions Bot pushed a commit to rust-lang/rustc-dev-guide that referenced this pull request Nov 16, 2026
Rollup of 10 pull requests

Successful merges:

 - rust-lang/rust#160186 (Implement `Fn` traits for safe functions of any ABI)
 - rust-lang/rust#160370 (rustdoc: notable trait badge and popover enhancements)
 - rust-lang/rust#165077 (Fix alloctests for panic=abort)
 - rust-lang/rust#163623 (Make docblock `<code>` elements inline so they behave better)
 - rust-lang/rust#163833 (Fix RISC-V inline ASM `clobber_abi` when extra target features are enabled)
 - rust-lang/rust#165067 (cg_llvm: Use an invariant lifetime brand for LLVM modules )
 - rust-lang/rust#165227 (Respect `--color=never` when printing `--explain` output to the terminal)
 - rust-lang/rust#165254 (Cleanup `rustdoc-html` tests)
 - rust-lang/rust#165258 (impl Eq for AllocRange)
 - rust-lang/rust#165259 (rustc-dev-guide subtree update)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-rustdoc-js Area: Rustdoc's JS front-end S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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

Successfully merging this pull request may close these issues.

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

4 participants