rust-lang / rust-lang/rust

Rustdoc table row highlighting for even lines and code highlighting match

Open Beginner friendly
#162,662 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Code

/// Some documentation
///
/// | Heading |
/// | - |
/// | Before `Foo` after |
/// | Before `Bar` after |
fn main() {
    println!("Hello, world!");
}

Reproduction Steps

cargo doc

Expected Outcome

Table rows with code blocks have the code block highlighted in a way to render them separately from normal text

Actual Output

Even numbered rows in tables have the same background color as the code blocks. Relevant CSS (first selector includes other targets omitted for simplicity, both include other rules)

.docblock code, {
    background-color: var(--code-block-background-color);
}
.docblock table tbody tr:nth-child(2n) {
	background: var(--table-alt-row-background-color);
}
--table-alt-row-background-color: #f5f5f5;
--code-block-background-color: #f5f5f5;

Rendered result:

Image

Version

rustdoc 1.98.1 (48a229cea 2026-09-01)

Additional Details

@rustbot label +A-a11y A-rustdoc-ui

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

Run cargo doc with the provided Rust snippet and inspect the rustdoc CSS rules for .docblock code and alternating table rows. Adjust the relevant styling so code blocks and even-numbered table rows have distinct backgrounds, then regenerate the documentation to confirm the rendered result.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.