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

Remove bolding on associated constants #88410

Merged
merged 1 commit into from
Sep 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/librustdoc/html/render/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -753,7 +753,7 @@ fn assoc_const(
) {
write!(
w,
"{}{}const <a href=\"{}\" class=\"constant\"><b>{}</b></a>: {}",
"{}{}const <a href=\"{}\" class=\"constant\">{}</a>: {}",
extra,
it.visibility.print_with_space(it.def_id, cx),
naive_assoc_href(it, link, cx),
Expand Down
15 changes: 15 additions & 0 deletions src/test/rustdoc-gui/font-weight.goml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,21 @@ goto: file://|DOC_PATH|/test_docs/struct.Foo.html
assert-css: (".impl-items .method", {"font-weight": "600"}, ALL)

goto: file://|DOC_PATH|/lib2/trait.Trait.html

// This is a complex selector, so here's how it works:
//
// * //*[@class='docblock type-decl'] — selects element of any tag with classes docblock and type-decl
// * /pre[@class='rust trait'] — selects immediate child with tag pre and classes rust and trait
// * /code — selects immediate child with tag code
// * /a[@class='constant'] — selects immediate child with tag a and class constant
// * //text() — selects child that is text node
// * /parent::* — selects immediate parent of the text node (the * means it can be any tag)
//
// This uses '/parent::*' as a proxy for the style of the text node.
camelid marked this conversation as resolved.
Show resolved Hide resolved
// We can't just select the '<a>' because intermediate tags could be added.
assert-count: ("//*[@class='docblock type-decl']/pre[@class='rust trait']/code/a[@class='constant']//text()/parent::*", 1)
assert-css: ("//*[@class='docblock type-decl']/pre[@class='rust trait']/code/a[@class='constant']//text()/parent::*", {"font-weight": "400"})

assert-count: (".methods .type", 1)
assert-css: (".methods .type", {"font-weight": "600"})
assert-count: (".methods .constant", 1)
Expand Down