From 6ef7cc0ccbe8013a5e10b0137f4c8398af905d5f Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Sat, 2 Nov 2024 16:09:14 -0700 Subject: [PATCH] Set line-height of superscripts to 0 This changes it so that superscript (and in particular footnote tags) do not bump the line spacing of previous lines. --- src/theme/css/general.css | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/theme/css/general.css b/src/theme/css/general.css index 7670b087..0862b516 100644 --- a/src/theme/css/general.css +++ b/src/theme/css/general.css @@ -190,6 +190,16 @@ kbd { vertical-align: middle; } +sup { + /* Set the line-height for superscript and footnote references so that there + isn't an awkward space appearing above lines that contain the footnote. + + See https://github.com/rust-lang/mdBook/pull/2443#discussion_r1813773583 + for an explanation. + */ + line-height: 0; +} + :not(.footnote-definition) + .footnote-definition, .footnote-definition + :not(.footnote-definition) { margin-block-start: 2em;