diff options
| author | Mukund Lakshman <yaymukund@gmail.com> | 2021-10-01 06:17:15 -0400 |
|---|---|---|
| committer | Mukund Lakshman <yaymukund@gmail.com> | 2021-10-04 05:01:04 -0400 |
| commit | a8a40ea9a4947a7b46421564517ee2aa4e3711f0 (patch) | |
| tree | b636e1f880c0f4aa70866dbc99e60621b2e80664 /src/test | |
| parent | e737694a4d66b01308b73d4559a35b43e414faf9 (diff) | |
| download | rust-a8a40ea9a4947a7b46421564517ee2aa4e3711f0.tar.gz rust-a8a40ea9a4947a7b46421564517ee2aa4e3711f0.zip | |
librustdoc: Use correct heading levels.
- Avoid multiple <h1>s on a page. - The <h#> tags should follow a semantic hierarchy. - Cap at h6 (no h7)
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/rustdoc/external-cross.rs | 2 | ||||
| -rw-r--r-- | src/test/rustdoc/external-doc.rs | 6 | ||||
| -rw-r--r-- | src/test/rustdoc/issue-42760.rs | 2 | ||||
| -rw-r--r-- | src/test/rustdoc/short-docblock.rs | 4 | ||||
| -rw-r--r-- | src/test/rustdoc/smart-punct.rs | 2 |
5 files changed, 8 insertions, 8 deletions
diff --git a/src/test/rustdoc/external-cross.rs b/src/test/rustdoc/external-cross.rs index 056ed353462..3f8e1688291 100644 --- a/src/test/rustdoc/external-cross.rs +++ b/src/test/rustdoc/external-cross.rs @@ -6,5 +6,5 @@ extern crate external_cross; // @has host/struct.NeedMoreDocs.html -// @has - '//h1' 'Cross-crate imported docs' +// @has - '//h2' 'Cross-crate imported docs' pub use external_cross::NeedMoreDocs; diff --git a/src/test/rustdoc/external-doc.rs b/src/test/rustdoc/external-doc.rs index fc29cb252e2..bd322d67a37 100644 --- a/src/test/rustdoc/external-doc.rs +++ b/src/test/rustdoc/external-doc.rs @@ -1,6 +1,6 @@ // @has external_doc/struct.IncludeStrDocs.html -// @has - '//h1' 'External Docs' -// @has - '//h2' 'Inline Docs' +// @has - '//h2' 'External Docs' +// @has - '//h3' 'Inline Docs' #[doc = include_str!("auxiliary/external-doc.md")] /// ## Inline Docs pub struct IncludeStrDocs; @@ -8,7 +8,7 @@ pub struct IncludeStrDocs; macro_rules! dir { () => { "auxiliary" } } // @has external_doc/struct.EagerExpansion.html -// @has - '//h1' 'External Docs' +// @has - '//h2' 'External Docs' #[doc = include_str!(concat!(dir!(), "/external-doc.md"))] /// ## Inline Docs pub struct EagerExpansion; diff --git a/src/test/rustdoc/issue-42760.rs b/src/test/rustdoc/issue-42760.rs index b07dc3f6e96..4944f815701 100644 --- a/src/test/rustdoc/issue-42760.rs +++ b/src/test/rustdoc/issue-42760.rs @@ -1,5 +1,5 @@ // @has issue_42760/struct.NonGen.html -// @has - '//h1' 'Example' +// @has - '//h2' 'Example' /// Item docs. /// diff --git a/src/test/rustdoc/short-docblock.rs b/src/test/rustdoc/short-docblock.rs index 74fa783174d..17c44eab091 100644 --- a/src/test/rustdoc/short-docblock.rs +++ b/src/test/rustdoc/short-docblock.rs @@ -2,7 +2,7 @@ // @has foo/index.html '//*[@class="item-right docblock-short"]/p' 'fooo' // @!has foo/index.html '//*[@class="item-right docblock-short"]/p/h1' 'fooo' -// @has foo/fn.foo.html '//h1[@id="fooo"]/a[@href="#fooo"]' 'fooo' +// @has foo/fn.foo.html '//h2[@id="fooo"]/a[@href="#fooo"]' 'fooo' /// # fooo /// @@ -11,7 +11,7 @@ pub fn foo() {} // @has foo/index.html '//*[@class="item-right docblock-short"]/p' 'mooood' // @!has foo/index.html '//*[@class="item-right docblock-short"]/p/h2' 'mooood' -// @has foo/foo/index.html '//h2[@id="mooood"]/a[@href="#mooood"]' 'mooood' +// @has foo/foo/index.html '//h3[@id="mooood"]/a[@href="#mooood"]' 'mooood' /// ## mooood /// diff --git a/src/test/rustdoc/smart-punct.rs b/src/test/rustdoc/smart-punct.rs index 5319892c99c..7ae5bd69945 100644 --- a/src/test/rustdoc/smart-punct.rs +++ b/src/test/rustdoc/smart-punct.rs @@ -21,7 +21,7 @@ //! ``` // @has "foo/index.html" "//p" "This is the “start” of the ‘document’! How’d you know that “it’s” the start?" -// @has "foo/index.html" "//h1" "Header with “smart punct’”" +// @has "foo/index.html" "//h2" "Header with “smart punct’”" // @has "foo/index.html" '//a[@href="https://www.rust-lang.org"]' "link with “smart punct’” – yessiree!" // @has "foo/index.html" '//code' "this inline code -- it shouldn't have \"smart punct\"" // @has "foo/index.html" '//pre' "let x = \"don't smart-punct me -- please!\";" |
