Skip to content

Commit 951949c

Browse files
authored
Rollup merge of #105912 - notriddle:notriddle/pre-line-height, r=GuillaumeGomez
rustdoc: force pre tags to have the default line height Fixes #105906
2 parents bcb75e6 + f24c04c commit 951949c

File tree

3 files changed

+25
-0
lines changed

3 files changed

+25
-0
lines changed

src/librustdoc/html/static/css/rustdoc.css

+1
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,7 @@ code, pre, a.test-arrow, .code-header {
338338
}
339339
pre {
340340
padding: 14px;
341+
line-height: 1.5; /* https://github.com/rust-lang/rust/issues/105906 */
341342
}
342343
.item-decl pre {
343344
overflow-x: auto;
+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// Test that code blocks nested within <sub> do not have a line height of 0.
2+
goto: "file://" + |DOC_PATH| + "/test_docs/codeblock_sub/index.html"
3+
4+
store-property: (codeblock_sub_1, "#codeblock-sub-1", "offsetHeight")
5+
assert-property-false: ("#codeblock-sub-3", { "offsetHeight": |codeblock_sub_1| })

src/test/rustdoc-gui/src/test_docs/lib.rs

+19
Original file line numberDiff line numberDiff line change
@@ -455,3 +455,22 @@ impl TypeWithImplDoc {
455455
/// fn doc
456456
pub fn test_fn() {}
457457
}
458+
459+
/// <sub id="codeblock-sub-1">
460+
///
461+
/// ```
462+
/// one
463+
/// ```
464+
///
465+
/// </sub>
466+
///
467+
/// <sub id="codeblock-sub-3">
468+
///
469+
/// ```
470+
/// one
471+
/// two
472+
/// three
473+
/// ```
474+
///
475+
/// </sub>
476+
pub mod codeblock_sub {}

0 commit comments

Comments
 (0)