Skip to content
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/markdown.rs
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ impl<'a, I: Iterator<Item = Event<'a>>> Iterator for TableWrapper<'a, I> {
Some(match event {
Event::Start(Tag::Table(t)) => {
self.stored_events.push_back(Event::Start(Tag::Table(t)));
Event::Html(CowStr::Borrowed("<div>"))
Event::Html(CowStr::Borrowed(r#"<div class="table">"#))
}
Event::End(TagEnd::Table) => {
self.stored_events.push_back(Event::Html(CowStr::Borrowed("</div>")));
Expand Down
2 changes: 1 addition & 1 deletion src/librustdoc/html/static/css/rustdoc.css
Original file line number Diff line number Diff line change
Expand Up @@ -1098,7 +1098,7 @@ rustdoc-topbar {
position: relative;
}

.docblock > :not(.more-examples-toggle):not(.example-wrap) {
.docblock pre, .docblock div.table {
max-width: 100%;
overflow-x: auto;
}
Expand Down
12 changes: 11 additions & 1 deletion tests/rustdoc-gui/list-margins.goml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// This test ensures that the documentation list markers are correctly placed.
// It also serves as a regression test for <https://github.com/rust-lang/rust/issues/130622>.
// It also serves as a regression test for <https://github.com/rust-lang/rust/issues/130622>
// and <https://github.com/rust-lang/rust/issues/161144>

go-to: "file://" + |DOC_PATH| + "/test_docs/long_list/index.html"
show-text: true
Expand All @@ -9,3 +10,12 @@ assert-css: (".docblock li p:not(last-child)", {"margin-bottom": "4.8px"})
assert-css: (".docblock li p + p:last-child", {"margin-bottom": "0px"})
// 0.4em
assert-css: (".docblock li", {"margin-bottom": "6.4px"})

// check that the list is allowed to overflow
assert-css: ("details.toggle", {"overflow": "visible"})
assert-css: (".docblock", {"overflow": "visible"})
assert-css: (".docblock ol", {"overflow": "visible"})
assert-css: (".docblock ol li", {"overflow": "visible"})
store-position: ("main", {"x": main_x})
store-position: (".docblock ol li::marker", {"x": marker_x})
assert: |main_x| <= |marker_x|
12 changes: 6 additions & 6 deletions tests/rustdoc-gui/src/test_docs/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -679,12 +679,12 @@ pub mod long_list {
//!
//! Another list:
//!
//! * [`TryFromBytes`](#a) indicates that a type may safely be converted from certain byte
//! sequence (conditional on runtime checks)
//! * [`FromZeros`](#a) indicates that a sequence of zero bytes represents a valid instance of
//! a type
//! * [`FromBytes`](#a) indicates that a type may safely be converted from an arbitrary byte
//! sequence
//! 100. [`TryFromBytes`](#a) indicates that a type may safely be converted from certain byte
//! sequence (conditional on runtime checks)
//! 101. [`FromZeros`](#a) indicates that a sequence of zero bytes represents a valid instance of
//! a type
//! 102. [`FromBytes`](#a) indicates that a type may safely be converted from an arbitrary byte
//! sequence
}

pub struct ImplDoc;
Expand Down
Loading