Skip to content

Links in "tight" lists are not colored #22493

Closed
@scott-ainsworth

Description

@scott-ainsworth

Markdown list items separated by blank lines are wrapped in p tags within li tags ("loose" list). formatting. List items not separated by blank lines use only li tags ("tight" list). Links in loose lists are displayed in blue and are easily distinguishable as links. Links in tight lists are normal text colored and do not appear as links (although clicking them still works). Examples of both list types follow:

Loose List (links are formatted as expected)
/// * [The Rust Programming Language](http://doc.rust-lang.org/book/)
///
/// * [The Rust Reference](http://doc.rust-lang.org/reference.html)

Tight List (links are not formatted)
/// * [The Rust Programming Language](http://doc.rust-lang.org/book/)
/// * [The Rust Reference](http://doc.rust-lang.org/reference.html)

Adding the missing formatting to loose lists is difference appears to be straight-forward CSS change. In src/librustdoc/html/static/main.css, two rules control link appearance in loose lists (lines 377 & 378 in the dfc5c0f commit):

p a { color: #4e8bca; }
p a:hover { text-decoration: underline; }

Adding a second selector to each rule colors the links:

p a, li a { color: #4e8bca; }
p a:hover, li a:hover { text-decoration: underline; }

There are only two other li rules and these do not affect color. So, the change above may be all that is needed to fix this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    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