about summary refs log tree commit diff
path: root/src/test/rustdoc
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2021-09-10 08:23:24 -0700
committerGitHub <noreply@github.com>2021-09-10 08:23:24 -0700
commit130e2e1edf211debb8ac9196fb4e525a87bb2607 (patch)
tree25239ed776f35a0be09bc9752ad9302cadb91a36 /src/test/rustdoc
parent1c091e4f630b6e8da44f491180b2196cf7a4fc01 (diff)
parent021b8ff8bd3d351f098847c3507ffb2c6c722aa3 (diff)
downloadrust-130e2e1edf211debb8ac9196fb4e525a87bb2607.tar.gz
rust-130e2e1edf211debb8ac9196fb4e525a87bb2607.zip
Rollup merge of #88742 - GuillaumeGomez:fix-table-in-docblocks, r=nbdd0121
Fix table in docblocks

"Overwrite" of #88702.

Instead of adding a z-index to the sidebar (which only hides the issue, doesn't fix it), I wrap `<table>` elements inside a `<div>` and limit all chidren of `.docblock` elements' width to prevent having the scrollbar on the whole doc block.

![Screenshot from 2021-09-08 15-11-24](https://user-images.githubusercontent.com/3050060/132515740-71796515-e74f-429f-ba98-2596bdbf781c.png)

Thanks `@nbdd0121` for `overflow-x: auto;`. ;)

r? `@notriddle`
Diffstat (limited to 'src/test/rustdoc')
-rw-r--r--src/test/rustdoc/table-in-docblock.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/test/rustdoc/table-in-docblock.rs b/src/test/rustdoc/table-in-docblock.rs
new file mode 100644
index 00000000000..858b589196e
--- /dev/null
+++ b/src/test/rustdoc/table-in-docblock.rs
@@ -0,0 +1,16 @@
+#![crate_name = "foo"]
+
+// @has foo/struct.Foo.html
+// @count - '//*[@class="docblock"]/div/table' 2
+// @!has - '//*[@class="docblock"]/table'
+/// | hello | hello2 |
+/// | ----- | ------ |
+/// | data  | data2  |
+pub struct Foo;
+
+impl Foo {
+    /// | hello | hello2 |
+    /// | ----- | ------ |
+    /// | data  | data2  |
+    pub fn foo(&self) {}
+}